Commit d2ecfe0b authored by Emmanuel Christophe's avatar Emmanuel Christophe

STYLE: removing trailing spaces

parent 3ba66e74
......@@ -10,8 +10,8 @@
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
......@@ -35,7 +35,7 @@
// The following example illustrates the use of the \doxygen{otb}{DEMToImageGenerator} class
// combined with the \doxygen{otb}{ScalarToRainbowRGBPixelFunctor}
//
// Software Guide : EndLatex
// Software Guide : EndLatex
#include "otbImage.h"
......@@ -51,25 +51,25 @@
int main(int argc, char * argv[])
{
if(argc<9)
{
std::cout << argv[0] <<" output filename, Longitude Output Orign point , Latitude Output Origin point , X Output Size, Y Output size , X Spacing , Y Spacing, DEM folder path" << std::endl;
return EXIT_FAILURE;
}
typedef double PixelType;
typedef unsigned char UCharPixelType;
typedef itk::RGBPixel<UCharPixelType> RGBPixelType;
typedef otb::Image<PixelType, 2> ImageType;
typedef otb::Image<RGBPixelType, 2> RGBImageType;
typedef otb::StreamingImageFileWriter<RGBImageType> WriterType;
WriterType::Pointer writer = WriterType::New();
writer->SetFileName(argv[1]);
typedef otb::DEMToImageGenerator<ImageType> DEMToImageGeneratorType;
DEMToImageGeneratorType::Pointer demToImage = DEMToImageGeneratorType::New();
......@@ -98,7 +98,7 @@ int main(int argc, char * argv[])
spacing[1] = ::atof(argv[7]);
demToImage->SetOutputSpacing(spacing);
typedef otb::Functor::ScalarToRainbowRGBPixelFunctor<PixelType>
ColorMapFunctorType;
typedef itk::UnaryFunctorImageFilter<ImageType,
......@@ -106,11 +106,11 @@ int main(int argc, char * argv[])
ColorMapFilterType::Pointer colormapper = ColorMapFilterType::New();
colormapper->GetFunctor().SetMaximum(4000);
colormapper->GetFunctor().SetMinimum(0);
colormapper->SetInput(demToImage->GetOutput());
writer->SetInput(colormapper->GetOutput());
try
{
writer->Update();
......@@ -120,15 +120,15 @@ int main(int argc, char * argv[])
std::cerr << "Exception caught !" << std::endl;
std::cerr << excep << std::endl;
}
catch( ... )
{
std::cout << "Unknown exception !" << std::endl;
catch( ... )
{
std::cout << "Unknown exception !" << std::endl;
return EXIT_FAILURE;
}
}
return EXIT_SUCCESS;
return EXIT_SUCCESS;
}
......@@ -10,8 +10,8 @@
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
......@@ -25,7 +25,7 @@
// Software Guide : BeginCommandLineArgs
// INPUTS: {GomaSmall.png}
// OUTPUTS: {GomaSmallLeeFiltered.png}
// OUTPUTS: {GomaSmallLeeFiltered.png}
// 3 1
// Software Guide : EndCommandLineArgs
......@@ -39,9 +39,9 @@
// multiplicative speckle model.
//
//
// The first step required to use this filter is to include its header file.
// The first step required to use this filter is to include its header file.
//
// Software Guide : EndLatex
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
#include "otbLeeImageFilter.h"
......@@ -57,15 +57,15 @@ int main( int argc, char * argv[] )
if( argc != 5 )
{
std::cerr << "Usage: " << argv[0] << " inputImageFile ";
std::cerr << " outputImageFile radius NbLooks" << std::endl;
std::cerr << " outputImageFile radius NbLooks" << std::endl;
return EXIT_FAILURE;
}
// Software Guide : BeginLatex
//
// Then we must decide what pixel type to use for the image.
// Then we must decide what pixel type to use for the image.
//
// Software Guide : EndLatex
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
typedef unsigned char PixelType;
......@@ -75,7 +75,7 @@ int main( int argc, char * argv[] )
//
// The images are defined using the pixel type and the dimension.
//
// Software Guide : EndLatex
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
typedef otb::Image< PixelType, 2 > InputImageType;
......@@ -87,7 +87,7 @@ int main( int argc, char * argv[] )
//
// The filter can be instantiated using the image types defined above.
//
// Software Guide : EndLatex
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
typedef otb::LeeImageFilter< InputImageType, OutputImageType > FilterType;
......@@ -97,20 +97,20 @@ int main( int argc, char * argv[] )
// Software Guide : BeginLatex
//
// An \doxygen{otb}{ImageFileReader} class is also instantiated in order to read
// image data from a file.
// image data from a file.
//
// Software Guide : EndLatex
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
typedef otb::ImageFileReader< InputImageType > ReaderType;
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
//
// An \doxygen{otb}{ImageFileWriter} is instantiated in order to write the
// output image to a file.
//
// Software Guide : EndLatex
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
typedef otb::ImageFileWriter< OutputImageType > WriterType;
......@@ -123,7 +123,7 @@ int main( int argc, char * argv[] )
// Both the filter and the reader are created by invoking their \code{New()}
// methods and assigning the result to SmartPointers.
//
// Software Guide : EndLatex
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
ReaderType::Pointer reader = ReaderType::New();
......@@ -136,14 +136,14 @@ int main( int argc, char * argv[] )
// Software Guide : BeginLatex
//
//
// The image obtained with the reader is passed as input to the
// \doxygen{otb}{LeeImageFilter}.
//
// \index{otb::LeeImageFilter!SetInput()}
// \index{otb::FileImageReader!GetOutput()}
//
// Software Guide : EndLatex
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
filter->SetInput( reader->GetOutput() );
......@@ -151,7 +151,7 @@ int main( int argc, char * argv[] )
// Software Guide : BeginLatex
//
//
// The method \code{SetRadius()} defines the size of the window to
// be used for the computation of the local statistics. The method
// \code{SetNbLooks()} sets the number of looks of the input
......@@ -159,9 +159,9 @@ int main( int argc, char * argv[] )
//
// \index{otb::LeeImageFilter!SetRadius()}
// \index{otb::LeeImageFilter!NbLooks()}
// \index{SetNbLooks()!otb::LeeImageFilter}
// \index{SetNbLooks()!otb::LeeImageFilter}
//
// Software Guide : EndLatex
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
FilterType::SizeType Radius;
......@@ -174,13 +174,13 @@ int main( int argc, char * argv[] )
// Software Guide : BeginLatex
//
//
// The filter is executed by invoking the \code{Update()} method. If the
// filter is part of a larger image processing pipeline, calling
// \code{Update()} on a downstream filter will also trigger update of this
// filter.
//
// Software Guide : EndLatex
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
filter->Update();
......@@ -199,7 +199,7 @@ int main( int argc, char * argv[] )
// \includegraphics[width=0.44\textwidth]{GomaSmall.eps}
// \includegraphics[width=0.44\textwidth]{GomaSmallLeeFiltered.eps}
// \itkcaption[Lee Filter Application]{Result of applying the
// \doxygen{otb}{LeeImageFilter} to a SAR image.}
// \doxygen{otb}{LeeImageFilter} to a SAR image.}
// \label{fig:LEE_FILTER}
// \end{figure}
//
......@@ -208,7 +208,7 @@ int main( int argc, char * argv[] )
// \item \doxygen{otb}{FrostImageFilter}
// \end{itemize}
//
// Software Guide : EndLatex
// Software Guide : EndLatex
return EXIT_SUCCESS;
......
......@@ -32,10 +32,10 @@ REGISTER_TEST(DEMToRainbowExampleTest);
#undef main
#define main LeeImageFilterTest
#include "LeeImageFilter.cxx"
#undef main
#define main DEMToRainbowExampleTest
#include "DEMToRainbowExample.cxx"
......@@ -10,8 +10,8 @@
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
......@@ -32,12 +32,12 @@
// \doxygen{otb}{BinaryFunctorNeighborhoodImageFilter}s, that is, they
// are filters taking two images as input and providing one image as
// output. The change detection computation itself is performed on a
// the neighborhood of each pixel of the input images.
// the neighborhood of each pixel of the input images.
//
// The first step required to build a change detection filter is to
// include the header of the parent class.
// include the header of the parent class.
//
// Software Guide : EndLatex
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
#include "otbBinaryFunctorNeighborhoodImageFilter.h"
......@@ -62,15 +62,15 @@
//
// Since change detectors operate on neighborhoods, the functor
// call will take 2 arguments which are
// \doxygen{itk}{ConstNeighborhoodIterator}s.
// \doxygen{itk}{ConstNeighborhoodIterator}s.
//
// The change detector functor is templated over the types of the
// input iterators and the output result type. The core of the change
// detection is implemented in the \code{operator()} section.
//
// Software Guide : EndLatex
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
// Software Guide : BeginCodeSnippet
template< class TInput1, class TInput2, class TOutput>
class MyChangeDetector
{
......@@ -79,23 +79,23 @@ public:
MyChangeDetector() {};
~MyChangeDetector() {};
// Change detection operation
inline TOutput operator()( const TInput1 & itA,
inline TOutput operator()( const TInput1 & itA,
const TInput2 & itB)
{
TOutput result = 0.0;
for(unsigned long pos = 0; pos< itA.Size(); ++pos)
{
result += static_cast<TOutput>(itA.GetPixel(pos)-itB.GetPixel(pos));
}
return static_cast<TOutput>( result/itA.Size() );
}
};
// Software Guide : EndCodeSnippet
};
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
......@@ -115,13 +115,13 @@ public:
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
// Software Guide : BeginCodeSnippet
template <class TInputImage1, class TInputImage2, class TOutputImage>
class ITK_EXPORT MyChangeDetectorImageFilter :
public otb::BinaryFunctorNeighborhoodImageFilter<
TInputImage1,TInputImage2,TOutputImage,
MyChangeDetector<
typename itk::ConstNeighborhoodIterator<TInputImage1>,
typename itk::ConstNeighborhoodIterator<TInputImage1>,
typename itk::ConstNeighborhoodIterator<TInputImage2>,
typename TOutputImage::PixelType> >
{
......@@ -129,18 +129,18 @@ public:
/** Standard class typedefs. */
typedef MyChangeDetectorImageFilter Self;
typedef typename otb::BinaryFunctorNeighborhoodImageFilter<
TInputImage1,TInputImage2,TOutputImage,
MyChangeDetector<
typename itk::ConstNeighborhoodIterator<TInputImage1>,
TInputImage1,TInputImage2,TOutputImage,
MyChangeDetector<
typename itk::ConstNeighborhoodIterator<TInputImage1>,
typename itk::ConstNeighborhoodIterator<TInputImage2>,
typename TOutputImage::PixelType>
typename TOutputImage::PixelType>
> Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self);
protected:
MyChangeDetectorImageFilter() {}
virtual ~MyChangeDetectorImageFilter() {}
......@@ -151,7 +151,7 @@ private:
};
// Software Guide : EndCodeSnippet
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
......@@ -164,7 +164,7 @@ private:
//
// SoftwareGuide : EndLatex
int main(int argc, char* argv[] )
int main(int argc, char* argv[] )
{
if( argc < 5 )
......@@ -186,7 +186,7 @@ int main(int argc, char* argv[] )
// SoftwareGuide : EndLatex
// Software Guide : BeginCodeSnippet
// Software Guide : BeginCodeSnippet
typedef float InternalPixelType;
typedef unsigned char OutputPixelType;
typedef otb::Image<InternalPixelType, Dimension> InputImageType1;
......@@ -203,13 +203,13 @@ int main(int argc, char* argv[] )
//
// SoftwareGuide : EndLatex
// Software Guide : BeginCodeSnippet
// Software Guide : BeginCodeSnippet
typedef otb::ImageFileReader< InputImageType1 > ReaderType1;
typedef otb::ImageFileReader< InputImageType2 > ReaderType2;
typedef otb::ImageFileWriter< OutputImageType > WriterType;
typedef itk::RescaleIntensityImageFilter< ChangeImageType,
OutputImageType > RescalerType;
// Software Guide : EndCodeSnippet
OutputImageType > RescalerType;
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
......@@ -218,14 +218,14 @@ int main(int argc, char* argv[] )
//
// SoftwareGuide : EndLatex
// Software Guide : BeginCodeSnippet
// Software Guide : BeginCodeSnippet
typedef MyChangeDetectorImageFilter<
InputImageType1,
InputImageType2,
ChangeImageType > FilterType;
// Software Guide : EndCodeSnippet
// Software Guide : EndCodeSnippet
ReaderType1::Pointer reader1 = ReaderType1::New();
ReaderType2::Pointer reader2 = ReaderType2::New();
WriterType::Pointer writer = WriterType::New();
......@@ -242,21 +242,21 @@ int main(int argc, char* argv[] )
//
// SoftwareGuide : EndLatex
// Software Guide : BeginCodeSnippet
// Software Guide : BeginCodeSnippet
reader1->SetFileName( inputFilename1 );
reader2->SetFileName( inputFilename2 );
writer->SetFileName( outputFilename );
rescaler->SetOutputMinimum( itk::NumericTraits< OutputPixelType >::min());
rescaler->SetOutputMaximum( itk::NumericTraits< OutputPixelType >::max());
filter->SetInput1( reader1->GetOutput() );
filter->SetInput1( reader1->GetOutput() );
filter->SetInput2( reader2->GetOutput() );
filter->SetRadius( atoi(argv[3]) );
rescaler->SetInput( filter->GetOutput() );
writer->SetInput( rescaler->GetOutput() );
// Software Guide : EndCodeSnippet
// Software Guide : EndCodeSnippet
typedef otb::CommandProgressUpdate<FilterType> CommandType;
......@@ -264,25 +264,25 @@ int main(int argc, char* argv[] )
filter->AddObserver(itk::ProgressEvent(), observer);
try
{
writer->Update();
}
catch( itk::ExceptionObject & err )
{
std::cout << "ExceptionObject caught !" << std::endl;
std::cout << err << std::endl;
try
{
writer->Update();
}
catch( itk::ExceptionObject & err )
{
std::cout << "ExceptionObject caught !" << std::endl;
std::cout << err << std::endl;
return -1;
}
}
// Software Guide : BeginLatex
//
// And that is all.
// And that is all.
//
// SoftwareGuide : EndLatex
return EXIT_SUCCESS;
}
......
......@@ -10,8 +10,8 @@
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
......@@ -42,19 +42,19 @@
// \includegraphics[width=0.35\textwidth]{ERSBefore.eps}
// \includegraphics[width=0.35\textwidth]{ERSAfter.eps}
// \itkcaption[ERS Images for Change Detection]{Images used for the
// change detection. Left: Before the flood. Right: during the flood.}
// change detection. Left: Before the flood. Right: during the flood.}
// \label{fig:CORRCHDETINIM}
// \end{figure}
//
// We start by including the corresponding header file.
//
// Software Guide : EndLatex
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
#include "otbCorrelationChangeDetector.h"
// Software Guide : EndCodeSnippet
int main(int argc, char* argv[] )
int main(int argc, char* argv[] )
{
if( argc < 5 )
......@@ -70,8 +70,8 @@ int main(int argc, char* argv[] )
// Software Guide : BeginLatex
// We start by declaring the types for the two input images, the
// change image and the image to be stored in a file for visualization.
//
// Software Guide : EndLatex
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
typedef float InternalPixelType;
......@@ -81,7 +81,7 @@ int main(int argc, char* argv[] )
typedef otb::Image<InternalPixelType, Dimension> ChangeImageType;
typedef otb::Image<OutputPixelType, Dimension> OutputImageType;
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We can now declare the types for the readers. Since the images
......@@ -89,15 +89,15 @@ int main(int argc, char* argv[] )
// streaming. For this purpose, the file writer will be
// streamed. This is achieved by using the
// \doxygen{otb}{StreamingImageFileWriter} class.
//
// Software Guide : EndLatex
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
typedef otb::ImageFileReader< InputImageType1 > ReaderType1;
typedef otb::ImageFileReader< InputImageType2 > ReaderType2;
typedef otb::StreamingImageFileWriter< OutputImageType > WriterType;
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// The change detector will give a response which is normalized
......@@ -105,21 +105,21 @@ int main(int argc, char* argv[] )
// saving the image to a file in, for instance, PNG format, we will
// rescale the results of the change detection in order to use all
// the output pixel type range of values.
//
// Software Guide : EndLatex
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
typedef itk::ShiftScaleImageFilter< ChangeImageType,