diff --git a/Testing/Code/Common/otbExtractROI_VectorToRGB.cxx b/Testing/Code/Common/otbExtractROI_VectorToRGB.cxx deleted file mode 100755 index c55e08f32e2cb9be1239ca36795b11d8ed9cfa7b..0000000000000000000000000000000000000000 --- a/Testing/Code/Common/otbExtractROI_VectorToRGB.cxx +++ /dev/null @@ -1,94 +0,0 @@ -/*========================================================================= - - Programme : OTB (ORFEO ToolBox) - Auteurs : CS - T.Feuvrier - Language : C++ - Date : 11 janvier 2005 - Version : - Role : Test l'extraction d'une ROI dans une image mono canal, dont les valeurs sont codées en "unsigned char" - $Id$ - -=========================================================================*/ - -#include "itkExceptionObject.h" -#include "itkImageFileReader.h" -#include "itkImageFileWriter.h" -#include "itkImage.h" -#include "itkRGBPixel.h" - -#include "otbExtractROI.h" -#include "otbVectorToRGBImageFilter.h" - -int otbExtractROI_VectorToRGB ( int argc, char ** argv ) -{ - try - { - const char * inputFilename = argv[1]; - const char * outputFilename = argv[2]; - - unsigned int startX((unsigned int)::atoi(argv[3])); - unsigned int startY((unsigned int)::atoi(argv[4])); - unsigned int sizeX((unsigned int)::atoi(argv[5])); - unsigned int sizeY((unsigned int)::atoi(argv[6])); - - unsigned int channelRed((unsigned int)::atoi(argv[7])); - unsigned int channelGreen((unsigned int)::atoi(argv[8])); - unsigned int channelBlue((unsigned int)::atoi(argv[9])); - - - typedef unsigned char InputPixelType; - typedef itk::RGBPixel<unsigned char> InputRGBPixelType; - typedef unsigned char OutputPixelType; - const unsigned int Dimension = 2; - - - typedef otb::VectorToRGBImageFilter< InputPixelType, - OutputPixelType > ExtractChannelFilterType; - typedef otb::ExtractROI< InputRGBPixelType, - InputRGBPixelType > ExtractROIFilterType; - - typedef itk::ImageFileReader< ExtractChannelFilterType::InputImageType, itk::DefaultConvertPixelTraits< InputPixelType > > ReaderType; - typedef itk::ImageFileWriter< ExtractROIFilterType::OutputImageType > WriterType; - - ExtractChannelFilterType::Pointer extractChannelFilter = ExtractChannelFilterType::New(); - ExtractROIFilterType::Pointer extractROIFilter = ExtractROIFilterType::New(); - - extractROIFilter->SetStartX( startX ); - extractROIFilter->SetStartY( startY ); - extractROIFilter->SetSizeX( sizeX ); - extractROIFilter->SetSizeY( sizeY ); - - extractChannelFilter->SetRedChannel(channelRed); - extractChannelFilter->SetGreenChannel(channelGreen); - extractChannelFilter->SetBlueChannel(channelBlue); - - - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); - - reader->SetFileName( inputFilename ); - writer->SetFileName( outputFilename ); - - extractChannelFilter->SetInput( reader->GetOutput() ); - extractROIFilter->SetInput( extractChannelFilter->GetOutput() ); - writer->SetInput( extractROIFilter->GetOutput() ); - writer->Update(); - } - - catch( itk::ExceptionObject & err ) - { - std::cout << "Exception itk::ExceptionObject levee !" << std::endl; - std::cout << err << std::endl; - return EXIT_FAILURE; - } - catch( ... ) - { - std::cout << "Exception levee inconnue !" << std::endl; - return EXIT_FAILURE; - } - - - return EXIT_SUCCESS; -} - - diff --git a/Testing/Code/Common/otbExtractROI_VectorToScalar.cxx b/Testing/Code/Common/otbExtractROI_VectorToScalar.cxx deleted file mode 100644 index 42a9b933a9deda68506cf78051cdb29b4da93ba7..0000000000000000000000000000000000000000 --- a/Testing/Code/Common/otbExtractROI_VectorToScalar.cxx +++ /dev/null @@ -1,86 +0,0 @@ -/*========================================================================= - - Programme : OTB (ORFEO ToolBox) - Auteurs : CS - T.Feuvrier - Language : C++ - Date : 11 janvier 2005 - Version : - Role : Test l'extraction d'une ROI dans une image mono canal, dont les valeurs sont codées en "unsigned char" - $Id$ - -=========================================================================*/ - -#include "itkExceptionObject.h" -#include "itkImageFileReader.h" -#include "itkImageFileWriter.h" -#include "itkImage.h" - -#include "otbExtractROI.h" -#include "otbVectorToScalarImageFilter.h" - -int otbExtractROI_VectorToScalar ( int argc, char ** argv ) -{ - try - { - const char * inputFilename = argv[1]; - const char * outputFilename = argv[2]; - - unsigned int startX((unsigned int)::atoi(argv[3])); - unsigned int startY((unsigned int)::atoi(argv[4])); - unsigned int sizeX((unsigned int)::atoi(argv[5])); - unsigned int sizeY((unsigned int)::atoi(argv[6])); - - unsigned int channel((unsigned int)::atoi(argv[7])); - - typedef unsigned char InputPixelType; - typedef unsigned char OutputPixelType; - const unsigned int Dimension = 2; - - - typedef otb::VectorToScalarImageFilter< InputPixelType, - OutputPixelType > ExtractChannelFilterType; - typedef otb::ExtractROI< InputPixelType, - OutputPixelType > ExtractROIFilterType; - - typedef itk::ImageFileReader< ExtractChannelFilterType::InputImageType, itk::DefaultConvertPixelTraits< InputPixelType > > ReaderType; - typedef itk::ImageFileWriter< ExtractROIFilterType::OutputImageType > WriterType; - - ExtractChannelFilterType::Pointer extractChannelFilter = ExtractChannelFilterType::New(); - ExtractROIFilterType::Pointer extractROIFilter = ExtractROIFilterType::New(); - - extractROIFilter->SetStartX( startX ); - extractROIFilter->SetStartY( startY ); - extractROIFilter->SetSizeX( sizeX ); - extractROIFilter->SetSizeY( sizeY ); - - extractChannelFilter->SetChannel(channel); - - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); - - reader->SetFileName( inputFilename ); - writer->SetFileName( outputFilename ); - - extractChannelFilter->SetInput( reader->GetOutput() ); - extractROIFilter->SetInput( extractChannelFilter->GetOutput() ); - writer->SetInput( extractROIFilter->GetOutput() ); - writer->Update(); - } - - catch( itk::ExceptionObject & err ) - { - std::cout << "Exception itk::ExceptionObject levee !" << std::endl; - std::cout << err << std::endl; - return EXIT_FAILURE; - } - catch( ... ) - { - std::cout << "Exception levee inconnue !" << std::endl; - return EXIT_FAILURE; - } - - - return EXIT_SUCCESS; -} - - diff --git a/Testing/Code/Common/otbVectorToRGBImageFilter.cxx b/Testing/Code/Common/otbVectorToRGBImageFilter.cxx deleted file mode 100644 index d4b580aab73b99e563e862f17a3704e14226e54e..0000000000000000000000000000000000000000 --- a/Testing/Code/Common/otbVectorToRGBImageFilter.cxx +++ /dev/null @@ -1,69 +0,0 @@ -#include <iostream> -#include "itkVectorImage.h" -#include "itkImage.h" -#include "otbImageFileReader.h" -#include "itkImageFileWriter.h" -#include "itkRGBPixel.h" - -#include "otbVectorToRGBImageFilter.h" - - -int otbVectorToRGBImageFilter(int argc, char * argv []) -{ - try - { - unsigned int channelRed((unsigned int)::atoi(argv[3])); - unsigned int channelGreen((unsigned int)::atoi(argv[4])); - unsigned int channelBlue((unsigned int)::atoi(argv[5])); - - const unsigned int Dimension = 2; - - typedef unsigned char PixelType; - - typedef itk::RGBPixel< PixelType > RGBPixelType; - typedef itk::VectorImage < PixelType, Dimension> ImageType; - - typedef itk::Image<RGBPixelType, Dimension> RGBImageType; - - //typedef itk::ImageFileReader< ImageType, itk::DefaultConvertPixelTraits< PixelType > > ReaderType; - typedef otb::ImageFileReader< ImageType, itk::DefaultConvertPixelTraits< PixelType > > ReaderType; - typedef itk::ImageFileWriter< RGBImageType > WriterType; - - - typedef otb::VectorToRGBImageFilter< PixelType , PixelType > VectorToRGBFilterType; - - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); - VectorToRGBFilterType::Pointer v2rgb = VectorToRGBFilterType::New(); - - reader->SetFileName(argv[1]); - writer->SetFileName(argv[2]); - - reader->Update(); - v2rgb->SetInput( reader->GetOutput() ); - - v2rgb->SetRedChannel(channelRed); - v2rgb->SetGreenChannel(channelGreen); - v2rgb->SetBlueChannel(channelBlue); - - writer->SetInput( v2rgb->GetOutput() ); - writer->Update(); - - } - catch( itk::ExceptionObject & err ) - { - std::cout << "Exception itk::ExceptionObject levee !" << std::endl; - std::cout << err << std::endl; - return EXIT_FAILURE; - } - catch( ... ) - { - std::cout << "Exception levee inconnue !" << std::endl; - return EXIT_FAILURE; - } - // Software Guide : EndCodeSnippet - - return EXIT_SUCCESS; - -} - diff --git a/Testing/Code/Common/otbVectorToScalarImageFilter.cxx b/Testing/Code/Common/otbVectorToScalarImageFilter.cxx deleted file mode 100644 index 5e270fff7ace853314e3c7df4589ef151c17e6a9..0000000000000000000000000000000000000000 --- a/Testing/Code/Common/otbVectorToScalarImageFilter.cxx +++ /dev/null @@ -1,64 +0,0 @@ -#include <iostream> -#include "itkVector.h" -#include "itkVectorImage.h" -#include "itkImage.h" -#include "itkImageFileReader.h" -#include "itkImageFileWriter.h" -#include "itkExtractImageFilter.h" -#include "itkVariableLengthVector.h" -#include "itkImageAdaptor.h" - -#include "otbVectorToScalarImageFilter.h" - - -int otbVectorToScalarImageFilter(int argc, char * argv []) -{ - try - { - unsigned int channel((unsigned int)::atoi(argv[3])); - - const unsigned int Dimension = 2; - - typedef unsigned char PixelType; - - typedef itk::VectorImage < PixelType, Dimension> InImageType; - typedef itk::Image<PixelType, Dimension> OutImageType; - - typedef itk::ImageFileReader< InImageType, itk::DefaultConvertPixelTraits< PixelType > > ReaderType; - typedef itk::ImageFileWriter< OutImageType > WriterType; - - typedef otb::VectorToScalarImageFilter< PixelType , PixelType > VectorToScalarFilterType; - - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); - VectorToScalarFilterType::Pointer v2scalar = VectorToScalarFilterType::New(); - - reader->SetFileName(argv[1]); - writer->SetFileName(argv[2]); - - reader->Update(); - v2scalar->SetInput( reader->GetOutput() ); - - v2scalar->SetChannel(channel); - - writer->SetInput( v2scalar->GetOutput() ); - writer->Update(); - - } - catch( itk::ExceptionObject & err ) - { - std::cout << "Exception itk::ExceptionObject levee !" << std::endl; - std::cout << err << std::endl; - return EXIT_FAILURE; - } - catch( ... ) - { - std::cout << "Exception levee inconnue !" << std::endl; - return EXIT_FAILURE; - } - // Software Guide : EndCodeSnippet - - return EXIT_SUCCESS; - -} -