Commit e16412a4 authored by Cyrille Valladeau's avatar Cyrille Valladeau

STYLE : try/catch blocs supression in Learning testing.

parent 04a2b7f1
......@@ -28,82 +28,69 @@
int otbPeriodicSOM(int argc, char* argv[])
{
try
{
const unsigned int Dimension = 2;
char * inputFileName = argv[1];
char * outputFileName = argv[2];
unsigned int sizeX = atoi(argv[3]);
unsigned int sizeY = atoi(argv[4]);
unsigned int neighInitX = atoi(argv[5]);
unsigned int neighInitY= atoi(argv[6]);
unsigned int nbIterations= atoi(argv[7]);
double betaInit = atof(argv[8]);
double betaEnd= atof(argv[9]);
double initValue = atof(argv[10]);
const unsigned int Dimension = 2;
char * inputFileName = argv[1];
char * outputFileName = argv[2];
unsigned int sizeX = atoi(argv[3]);
unsigned int sizeY = atoi(argv[4]);
unsigned int neighInitX = atoi(argv[5]);
unsigned int neighInitY= atoi(argv[6]);
unsigned int nbIterations= atoi(argv[7]);
double betaInit = atof(argv[8]);
double betaEnd= atof(argv[9]);
double initValue = atof(argv[10]);
typedef double ComponentType;
typedef itk::VariableLengthVector<ComponentType> PixelType;
typedef itk::Statistics::EuclideanDistance<PixelType> DistanceType;
typedef otb::SOMMap<PixelType,DistanceType,Dimension> MapType;
typedef otb::VectorImage<ComponentType,Dimension> ImageType;
typedef otb::ImageFileReader<ImageType> ReaderType;
typedef itk::Statistics::ListSample<PixelType> ListSampleType;
typedef double ComponentType;
typedef itk::VariableLengthVector<ComponentType> PixelType;
typedef itk::Statistics::EuclideanDistance<PixelType> DistanceType;
typedef otb::SOMMap<PixelType,DistanceType,Dimension> MapType;
typedef otb::VectorImage<ComponentType,Dimension> ImageType;
typedef otb::ImageFileReader<ImageType> ReaderType;
typedef itk::Statistics::ListSample<PixelType> ListSampleType;
typedef otb::PeriodicSOM<ListSampleType,MapType> SOMType;
typedef otb::ImageFileWriter<MapType> WriterType;
typedef otb::PeriodicSOM<ListSampleType,MapType> SOMType;
typedef otb::ImageFileWriter<MapType> WriterType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(inputFileName);
reader->Update();
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(inputFileName);
reader->Update();
ListSampleType::Pointer listSample = ListSampleType::New();
ListSampleType::Pointer listSample = ListSampleType::New();
itk::ImageRegionIterator<ImageType> it(reader->GetOutput(),reader->GetOutput()->GetLargestPossibleRegion());
itk::ImageRegionIterator<ImageType> it(reader->GetOutput(),reader->GetOutput()->GetLargestPossibleRegion());
it.GoToBegin();
it.GoToBegin();
while(!it.IsAtEnd())
{
listSample->PushBack(it.Get());
++it;
}
while(!it.IsAtEnd())
{
listSample->PushBack(it.Get());
++it;
}
std::cout<<"LIST SAMPLE SIZE: "<<listSample->GetMeasurementVectorSize()<<std::endl;
std::cout<<"LIST SAMPLE SIZE: "<<listSample->GetMeasurementVectorSize()<<std::endl;
// Instantiation
SOMType::Pointer som = SOMType::New();
som->SetListSample(listSample);
SOMType::SizeType size;
size[0]=sizeX;
size[1]=sizeY;
som->SetMapSize(size);
SOMType::SizeType radius;
radius[0] = neighInitX;
radius[1] = neighInitY;
som->SetNeighborhoodSizeInit(radius);
som->SetNumberOfIterations(nbIterations);
som->SetBetaInit(betaInit);
som->SetBetaEnd(betaEnd);
som->SetMaxWeight(initValue);
som->SetRandomInit(false);
// Instantiation
SOMType::Pointer som = SOMType::New();
som->SetListSample(listSample);
SOMType::SizeType size;
size[0]=sizeX;
size[1]=sizeY;
som->SetMapSize(size);
SOMType::SizeType radius;
radius[0] = neighInitX;
radius[1] = neighInitY;
som->SetNeighborhoodSizeInit(radius);
som->SetNumberOfIterations(nbIterations);
som->SetBetaInit(betaInit);
som->SetBetaEnd(betaEnd);
som->SetMaxWeight(initValue);
som->SetRandomInit(false);
WriterType::Pointer writer = WriterType::New();
writer->SetFileName(outputFileName);
writer->SetInput(som->GetOutput());
writer->Update();
}
catch( itk::ExceptionObject & err )
{
std::cout << "Exception itk::ExceptionObject thrown !" << std::endl;
std::cout << err << std::endl;
return EXIT_FAILURE;
}
catch( ... )
{
std::cout << "Unknown exception thrown !" << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
WriterType::Pointer writer = WriterType::New();
writer->SetFileName(outputFileName);
writer->SetInput(som->GetOutput());
writer->Update();
return EXIT_SUCCESS;
}
......@@ -24,30 +24,18 @@
int otbPeriodicSOMNew(int argc, char* argv[])
{
try
{
const unsigned int Dimension = 2;
typedef float ComponentType;
typedef itk::VariableLengthVector<ComponentType> PixelType;
typedef itk::Statistics::EuclideanDistance<PixelType> DistanceType;
typedef otb::SOMMap<PixelType,DistanceType,Dimension> SOMMapType;
// typedef itk::Statistics::ImageToListAdaptor<SOMMapType> AdaptorType;
typedef itk::Statistics::ListSample<PixelType> ListSampleType;
typedef otb::PeriodicSOM<ListSampleType,SOMMapType> SOMType;
// Instantiation
SOMType::Pointer som = SOMType::New();
}
catch( itk::ExceptionObject & err )
{
std::cout << "Exception itk::ExceptionObject thrown !" << std::endl;
std::cout << err << std::endl;
return EXIT_FAILURE;
}
catch( ... )
{
std::cout << "Unknown exception thrown !" << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
const unsigned int Dimension = 2;
typedef float ComponentType;
typedef itk::VariableLengthVector<ComponentType> PixelType;
typedef itk::Statistics::EuclideanDistance<PixelType> DistanceType;
typedef otb::SOMMap<PixelType,DistanceType,Dimension> SOMMapType;
// typedef itk::Statistics::ImageToListAdaptor<SOMMapType> AdaptorType;
typedef itk::Statistics::ListSample<PixelType> ListSampleType;
typedef otb::PeriodicSOM<ListSampleType,SOMMapType> SOMType;
// Instantiation
SOMType::Pointer som = SOMType::New();
return EXIT_SUCCESS;
}
......@@ -33,37 +33,19 @@
int otbSEMClassifierNew( int argc, char* argv[] )
{
try
{
typedef double PixelType;
typedef otb::VectorImage< PixelType, 2 > ImageType;
typedef itk::Image< unsigned char, 2 > OutputImageType;
typedef otb::SEMClassifier< ImageType, OutputImageType > ClassifType;
typedef itk::Statistics::ListSample< ImageType::PixelType > SampleType;
typedef itk::Statistics::Subsample< SampleType > ClassSampleType;
typedef double PixelType;
typedef otb::VectorImage< PixelType, 2 > ImageType;
typedef itk::Image< unsigned char, 2 > OutputImageType;
typedef otb::SEMClassifier< ImageType, OutputImageType > ClassifType;
typedef itk::Statistics::ListSample< ImageType::PixelType > SampleType;
typedef itk::Statistics::Subsample< SampleType > ClassSampleType;
typedef otb::Statistics::ModelComponentBase< ClassSampleType > ComponentType ;
typedef otb::Statistics::ModelComponentBase< ClassSampleType > ComponentType ;
ClassifType::Pointer classifier = ClassifType::New();
ComponentType::Pointer component = ComponentType::New();
}
catch( itk::ExceptionObject & err )
{
std::cout << "Exception itk::ExceptionObject levee !" << std::endl;
std::cout << err << std::endl;
return EXIT_FAILURE;
}
catch( ... )
{
std::cout << "Unknown exception !" << std::endl;
return EXIT_FAILURE;
}
// Software Guide : EndCodeSnippet
//#endif
ClassifType::Pointer classifier = ClassifType::New();
ComponentType::Pointer component = ComponentType::New();
return EXIT_SUCCESS;
}
......
......@@ -28,82 +28,70 @@
int otbSOM(int argc, char* argv[])
{
try
{
const unsigned int Dimension = 2;
char * inputFileName = argv[1];
char * outputFileName = argv[2];
unsigned int sizeX = atoi(argv[3]);
unsigned int sizeY = atoi(argv[4]);
unsigned int neighInitX = atoi(argv[5]);
unsigned int neighInitY= atoi(argv[6]);
unsigned int nbIterations= atoi(argv[7]);
double betaInit = atof(argv[8]);
double betaEnd= atof(argv[9]);
double initValue = atof(argv[10]);
const unsigned int Dimension = 2;
char * inputFileName = argv[1];
char * outputFileName = argv[2];
unsigned int sizeX = atoi(argv[3]);
unsigned int sizeY = atoi(argv[4]);
unsigned int neighInitX = atoi(argv[5]);
unsigned int neighInitY= atoi(argv[6]);
unsigned int nbIterations= atoi(argv[7]);
double betaInit = atof(argv[8]);
double betaEnd= atof(argv[9]);
double initValue = atof(argv[10]);
typedef double ComponentType;
typedef itk::VariableLengthVector<ComponentType> PixelType;
typedef itk::Statistics::EuclideanDistance<PixelType> DistanceType;
typedef otb::SOMMap<PixelType,DistanceType,Dimension> MapType;
typedef otb::VectorImage<ComponentType,Dimension> ImageType;
typedef otb::ImageFileReader<ImageType> ReaderType;
typedef itk::Statistics::ListSample<PixelType> ListSampleType;
typedef double ComponentType;
typedef itk::VariableLengthVector<ComponentType> PixelType;
typedef itk::Statistics::EuclideanDistance<PixelType> DistanceType;
typedef otb::SOMMap<PixelType,DistanceType,Dimension> MapType;
typedef otb::VectorImage<ComponentType,Dimension> ImageType;
typedef otb::ImageFileReader<ImageType> ReaderType;
typedef itk::Statistics::ListSample<PixelType> ListSampleType;
typedef otb::SOM<ListSampleType,MapType> SOMType;
typedef otb::ImageFileWriter<MapType> WriterType;
typedef otb::SOM<ListSampleType,MapType> SOMType;
typedef otb::ImageFileWriter<MapType> WriterType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(inputFileName);
reader->Update();
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(inputFileName);
reader->Update();
ListSampleType::Pointer listSample = ListSampleType::New();
ListSampleType::Pointer listSample = ListSampleType::New();
itk::ImageRegionIterator<ImageType> it(reader->GetOutput(),reader->GetOutput()->GetLargestPossibleRegion());
itk::ImageRegionIterator<ImageType> it(reader->GetOutput(),reader->GetOutput()->GetLargestPossibleRegion());
it.GoToBegin();
it.GoToBegin();
while(!it.IsAtEnd())
{
listSample->PushBack(it.Get());
++it;
}
while(!it.IsAtEnd())
{
listSample->PushBack(it.Get());
++it;
}
std::cout<<"LIST SAMPLE SIZE: "<<listSample->GetMeasurementVectorSize()<<std::endl;
std::cout<<"LIST SAMPLE SIZE: "<<listSample->GetMeasurementVectorSize()<<std::endl;
// Instantiation
SOMType::Pointer som = SOMType::New();
som->SetListSample(listSample);
SOMType::SizeType size;
size[0]=sizeX;
size[1]=sizeY;
som->SetMapSize(size);
SOMType::SizeType radius;
radius[0] = neighInitX;
radius[1] = neighInitY;
som->SetNeighborhoodSizeInit(radius);
som->SetNumberOfIterations(nbIterations);
som->SetBetaInit(betaInit);
som->SetBetaEnd(betaEnd);
som->SetMaxWeight(initValue);
som->SetRandomInit(false);
// Instantiation
SOMType::Pointer som = SOMType::New();
som->SetListSample(listSample);
SOMType::SizeType size;
size[0]=sizeX;
size[1]=sizeY;
som->SetMapSize(size);
SOMType::SizeType radius;
radius[0] = neighInitX;
radius[1] = neighInitY;
som->SetNeighborhoodSizeInit(radius);
som->SetNumberOfIterations(nbIterations);
som->SetBetaInit(betaInit);
som->SetBetaEnd(betaEnd);
som->SetMaxWeight(initValue);
som->SetRandomInit(false);
WriterType::Pointer writer = WriterType::New();
writer->SetFileName(outputFileName);
writer->SetInput(som->GetOutput());
writer->Update();
}
catch( itk::ExceptionObject & err )
{
std::cout << "Exception itk::ExceptionObject thrown !" << std::endl;
std::cout << err << std::endl;
return EXIT_FAILURE;
}
catch( ... )
{
std::cout << "Unknown exception thrown !" << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
WriterType::Pointer writer = WriterType::New();
writer->SetFileName(outputFileName);
writer->SetInput(som->GetOutput());
writer->Update();
return EXIT_SUCCESS;
}
......@@ -29,68 +29,56 @@
int otbSOMActivationBuilder(int argc, char* argv[])
{
try
{
const unsigned int Dimension = 2;
char * vectorSetFileName = argv[1];
char * mapFileName = argv[2];
char * outputFileName = argv[3];
const unsigned int Dimension = 2;
char * vectorSetFileName = argv[1];
char * mapFileName = argv[2];
char * outputFileName = argv[3];
typedef float ComponentType;
typedef unsigned char OutputPixelType;
typedef itk::VariableLengthVector<ComponentType> PixelType;
typedef itk::Statistics::EuclideanDistance<PixelType> DistanceType;
typedef float ComponentType;
typedef unsigned char OutputPixelType;
typedef itk::VariableLengthVector<ComponentType> PixelType;
typedef itk::Statistics::EuclideanDistance<PixelType> DistanceType;
typedef otb::SOMMap<PixelType,DistanceType,Dimension> MapType;
typedef otb::ImageFileReader<MapType> MapReaderType;
typedef otb::SOMMap<PixelType,DistanceType,Dimension> MapType;
typedef otb::ImageFileReader<MapType> MapReaderType;
typedef otb::VectorImage<ComponentType,Dimension> InputImageType;
typedef otb::ImageFileReader<InputImageType> ReaderType;
typedef itk::Statistics::ListSample<PixelType> ListSampleType;
typedef otb::VectorImage<ComponentType,Dimension> InputImageType;
typedef otb::ImageFileReader<InputImageType> ReaderType;
typedef itk::Statistics::ListSample<PixelType> ListSampleType;
typedef otb::Image<OutputPixelType,Dimension> OutputImageType;
typedef otb::ImageFileWriter<OutputImageType> WriterType;
typedef otb::Image<OutputPixelType,Dimension> OutputImageType;
typedef otb::ImageFileWriter<OutputImageType> WriterType;
typedef otb::SOMActivationBuilder<ListSampleType,MapType,OutputImageType> SOMActivationBuilderType;
typedef otb::SOMActivationBuilder<ListSampleType,MapType,OutputImageType> SOMActivationBuilderType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(vectorSetFileName);
reader->Update();
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(vectorSetFileName);
reader->Update();
ListSampleType::Pointer listSample = ListSampleType::New();
ListSampleType::Pointer listSample = ListSampleType::New();
itk::ImageRegionIterator<InputImageType> it(reader->GetOutput(),reader->GetOutput()->GetLargestPossibleRegion());
itk::ImageRegionIterator<InputImageType> it(reader->GetOutput(),reader->GetOutput()->GetLargestPossibleRegion());
it.GoToBegin();
it.GoToBegin();
while(!it.IsAtEnd())
{
listSample->PushBack(it.Get());
++it;
}
while(!it.IsAtEnd())
{
listSample->PushBack(it.Get());
++it;
}
MapReaderType::Pointer mapReader = MapReaderType::New();
mapReader->SetFileName(mapFileName);
SOMActivationBuilderType::Pointer somAct = SOMActivationBuilderType::New();
somAct->SetInput(mapReader->GetOutput());
somAct->SetListSample(listSample);
WriterType::Pointer writer = WriterType::New();
writer->SetFileName(outputFileName);
writer->SetInput(somAct->GetOutput());
writer->Update();
}
catch( itk::ExceptionObject & err )
{
std::cout << "Exception itk::ExceptionObject thrown !" << std::endl;
std::cout << err << std::endl;
return EXIT_FAILURE;
}
catch( ... )
{
std::cout << "Unknown exception thrown !" << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
MapReaderType::Pointer mapReader = MapReaderType::New();
mapReader->SetFileName(mapFileName);
SOMActivationBuilderType::Pointer somAct = SOMActivationBuilderType::New();
somAct->SetInput(mapReader->GetOutput());
somAct->SetListSample(listSample);
WriterType::Pointer writer = WriterType::New();
writer->SetFileName(outputFileName);
writer->SetInput(somAct->GetOutput());
writer->Update();
return EXIT_SUCCESS;
}
......@@ -27,33 +27,21 @@
int otbSOMActivationBuilderNew(int argc, char* argv[])
{
try
{
const unsigned int Dimension =2;
typedef float ComponentType;
typedef unsigned char OutputPixelType;
typedef itk::VariableLengthVector<ComponentType> PixelType;
typedef itk::Statistics::EuclideanDistance<PixelType> DistanceType;
typedef otb::SOMMap<PixelType,DistanceType,Dimension> MapType;
typedef otb::VectorImage<ComponentType,Dimension> InputImageType;
typedef itk::Statistics::ListSample<PixelType> ListSampleType;
typedef otb::Image<OutputPixelType,Dimension> OutputImageType;
typedef otb::SOMActivationBuilder<ListSampleType,MapType,OutputImageType> SOMActivationBuilderType;
// Instantiation
SOMActivationBuilderType::Pointer somAct = SOMActivationBuilderType::New();
}
catch( itk::ExceptionObject & err )
{
std::cout << "Exception itk::ExceptionObject thrown !" << std::endl;
std::cout << err << std::endl;
return EXIT_FAILURE;
}
catch( ... )
{
std::cout << "Unknown exception thrown !" << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
const unsigned int Dimension =2;
typedef float ComponentType;
typedef unsigned char OutputPixelType;
typedef itk::VariableLengthVector<ComponentType> PixelType;
typedef itk::Statistics::EuclideanDistance<PixelType> DistanceType;
typedef otb::SOMMap<PixelType,DistanceType,Dimension> MapType;
typedef otb::VectorImage<ComponentType,Dimension> InputImageType;
typedef itk::Statistics::ListSample<PixelType> ListSampleType;
typedef otb::Image<OutputPixelType,Dimension> OutputImageType;
typedef otb::SOMActivationBuilder<ListSampleType,MapType,OutputImageType> SOMActivationBuilderType;
// Instantiation
SOMActivationBuilderType::Pointer somAct = SOMActivationBuilderType::New();
return EXIT_SUCCESS;
}
......@@ -32,96 +32,83 @@
int otbSOMClassifier(int argc, char* argv[] )
{
try
{
if (argc != 4)
{
if (argc != 4)
{
std::cout << "Usage : " << argv[0] << " inputImage modelFile outputImage"
<< std::endl ;
return EXIT_FAILURE;
}
}
const char * imageFilename = argv[1];
const char * mapFilename = argv[2];
const char * outputFilename = argv[3];
const char * imageFilename = argv[1];
const char * mapFilename = argv[2];
const char * outputFilename = argv[3];
typedef double InputPixelType;
typedef int LabelPixelType;
const unsigned int Dimension = 2;
typedef itk::VariableLengthVector<InputPixelType> PixelType;
typedef itk::Statistics::EuclideanDistance<PixelType> DistanceType;
typedef otb::SOMMap<PixelType,DistanceType,Dimension> SOMMapType;
typedef otb::VectorImage<InputPixelType,Dimension> InputImageType;
typedef otb::ImageFileReader< InputImageType > ReaderType;
typedef otb::ImageFileReader<SOMMapType> SOMReaderType;
typedef itk::Statistics::ListSample< PixelType > SampleType;
typedef otb::SOMClassifier<SampleType,SOMMapType,LabelPixelType> ClassifierType;
typedef otb::Image<LabelPixelType, Dimension > OutputImageType;
typedef itk::ImageRegionIterator< OutputImageType> OutputIteratorType;
typedef otb::ImageFileWriter<OutputImageType> WriterType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName( imageFilename );
reader->Update();
std::cout << "Image read" << std::endl;
SOMReaderType::Pointer somreader = SOMReaderType::New();
somreader->SetFileName(mapFilename);
somreader->Update();
std::cout<<"SOM map read"<<std::endl;
SampleType::Pointer listSample = SampleType::New();
itk::ImageRegionIterator<InputImageType> it(reader->GetOutput(),reader->GetOutput()->GetLargestPossibleRegion());
typedef double InputPixelType;
typedef int LabelPixelType;
const unsigned int Dimension = 2;
typedef itk::VariableLengthVector<InputPixelType> PixelType;
typedef itk::Statistics::EuclideanDistance<PixelType> DistanceType;
typedef otb::SOMMap<PixelType,DistanceType,Dimension> SOMMapType;
typedef otb::VectorImage<InputPixelType,Dimension> InputImageType;
typedef otb::ImageFileReader< InputImageType > ReaderType;
typedef otb::ImageFileReader<SOMMapType> SOMReaderType;
typedef itk::Statistics::ListSample< PixelType > SampleType;
typedef otb::SOMClassifier<SampleType,SOMMapType,LabelPixelType> ClassifierType;
typedef otb::Image<LabelPixelType, Dimension > OutputImageType;
typedef itk::ImageRegionIterator< OutputImageType> OutputIteratorType;
typedef otb::ImageFileWriter<OutputImageType> WriterType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName( imageFilename );
reader->Update();
std::cout << "Image read" << std::endl;
SOMReaderType::Pointer somreader = SOMReaderType::New();
somreader->SetFileName(mapFilename);
somreader->Update();
std::cout<<"SOM map read"<<std::endl;
SampleType::Pointer listSample = SampleType::New();
itk::ImageRegionIterator<InputImageType> it(reader->GetOutput(),reader->GetOutput()->GetLargestPossibleRegion());
it.GoToBegin();
it.GoToBegin();
while(!it.IsAtEnd())
{
listSample->PushBack(it.Get());
++it;
}
while(!it.IsAtEnd())
{
listSample->PushBack(it.Get());
++it;
}
ClassifierType::Pointer classifier = ClassifierType::New() ;
classifier->SetSample(listSample.GetPointer());
classifier->SetMap(somreader->GetOutput());
classifier->Update() ;
ClassifierType::Pointer classifier = ClassifierType::New() ;
classifier->SetSample(listSample.GetPointer());
classifier->SetMap(somreader->GetOutput());
classifier->Update() ;
OutputImageType::Pointer outputImage = OutputImageType::New();
outputImage->SetRegions( reader->GetOutput()->GetLargestPossibleRegion());
outputImage->Allocate();
OutputImageType::Pointer outputImage = OutputImageType::New();
outputImage->SetRegions( reader->GetOutput()->GetLargestPossibleRegion());
outputImage->Allocate();
ClassifierType::OutputType* membershipSample = classifier->GetOutput();
ClassifierType::OutputType::ConstIterator m_iter = membershipSample->Begin();
ClassifierType::OutputType::ConstIterator m_last = membershipSample->End();
ClassifierType::OutputType* membershipSample = classifier->GetOutput();
ClassifierType::OutputType::ConstIterator m_iter = membershipSample->Begin();
ClassifierType::OutputType::ConstIterator m_last = membershipSample->End();
OutputIteratorType outIt(outputImage,outputImage->GetLargestPossibleRegion());
outIt.GoToBegin();
OutputIteratorType outIt(outputImage,outputImage->GetLargestPossibleRegion());
outIt.GoToBegin();
while (m_iter != m_last && !outIt.IsAtEnd())
while (m_iter != m_last && !outIt.IsAtEnd())
{
outIt.Set(m_iter.GetClassLabel());
++m_iter ;
++outIt;
outIt.Set(m_iter.GetClassLabel());
++m_iter ;
++outIt;
}
WriterType::Pointer writer = WriterType::New();