Skip to content
Snippets Groups Projects
Commit 84f5319c authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

Test for VectorImageToIntensityImageFilter

parent f219063a
No related branches found
No related tags found
No related merge requests found
...@@ -732,6 +732,22 @@ ADD_TEST(bfTvRationalQuotientResampleImageFilter ${BASICFILTERS_TESTS7} ...@@ -732,6 +732,22 @@ ADD_TEST(bfTvRationalQuotientResampleImageFilter ${BASICFILTERS_TESTS7}
2 3 2 3
) )
# ------- otb::VectorImageToIntensityImageFilter ----------------------------
ADD_TEST(bfTuVectorImageToIntensityImageFilterNew ${BASICFILTERS_TESTS7}
otbVectorImageToIntensityImageFilterNew)
ADD_TEST(bfTvVectorImageToIntensityImageFilter ${BASICFILTERS_TESTS7}
--compare-image ${EPSILON}
${BASELINE}/bfTvVectorImageToIntensityImageOutput.tif
${TEMP}/bfTvVectorImageToIntensityImageOutput.tif
otbVectorImageToIntensityImageFilter
${INPUTDATA}/QB_Toulouse_Ortho_XS.tif
${TEMP}/bfTvVectorImageToIntensityImageOutput.tif
)
# A enrichir # A enrichir
SET(BasicFilters_SRCS1 SET(BasicFilters_SRCS1
otbLeeFilter.cxx otbLeeFilter.cxx
...@@ -832,6 +848,8 @@ otbVectorImageToAmplitudeImageFilterNew.cxx ...@@ -832,6 +848,8 @@ otbVectorImageToAmplitudeImageFilterNew.cxx
otbVectorImageToAmplitudeImageFilter.cxx otbVectorImageToAmplitudeImageFilter.cxx
otbRationalQuotientResampleImageFilterNew.cxx otbRationalQuotientResampleImageFilterNew.cxx
otbRationalQuotientResampleImageFilter.cxx otbRationalQuotientResampleImageFilter.cxx
otbVectorImageToIntensityImageFilterNew.cxx
otbVectorImageToIntensityImageFilter.cxx
) )
......
...@@ -40,5 +40,7 @@ REGISTER_TEST(otbVectorImageToAmplitudeImageFilterNew); ...@@ -40,5 +40,7 @@ REGISTER_TEST(otbVectorImageToAmplitudeImageFilterNew);
REGISTER_TEST(otbVectorImageToAmplitudeImageFilter); REGISTER_TEST(otbVectorImageToAmplitudeImageFilter);
REGISTER_TEST(otbRationalQuotientResampleImageFilterNew); REGISTER_TEST(otbRationalQuotientResampleImageFilterNew);
REGISTER_TEST(otbRationalQuotientResampleImageFilter); REGISTER_TEST(otbRationalQuotientResampleImageFilter);
REGISTER_TEST(otbVectorImageToIntensityImageFilterNew);
REGISTER_TEST(otbVectorImageToIntensityImageFilter);
} }
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
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.
=========================================================================*/
#include "itkExceptionObject.h"
#include "otbImage.h"
#include "otbVectorImage.h"
#include "otbImageFileReader.h"
#include "otbImageFileWriter.h"
#include "otbVectorImageToIntensityImageFilter.h"
int otbVectorImageToIntensityImageFilter(int argc, char * argv[])
{
try
{
const unsigned int Dimension = 2;
typedef double PixelType;
typedef otb::VectorImage<PixelType,Dimension> InputImageType;
typedef otb::Image<PixelType,Dimension> OutputImageType;
typedef otb::ImageFileReader<InputImageType> ReaderType;
typedef otb::ImageFileWriter<OutputImageType> WriterType;
typedef otb::VectorImageToIntensityImageFilter<InputImageType,OutputImageType> FilterType;
// Instantiating object
FilterType::Pointer filter = FilterType::New();
ReaderType::Pointer reader = ReaderType::New();
WriterType::Pointer writer = WriterType::New();
reader->SetFileName(argv[1]);
writer->SetFileName(argv[2]);
InputImageType::PixelType refPixel;
filter->SetInput(reader->GetOutput());
writer->SetInput(filter->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;
}
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
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.
=========================================================================*/
#include "itkExceptionObject.h"
#include "otbImage.h"
#include "otbVectorImage.h"
#include "otbVectorImageToIntensityImageFilter.h"
int otbVectorImageToIntensityImageFilterNew(int argc, char * argv[])
{
try
{
const unsigned int Dimension = 2;
typedef double PixelType;
typedef otb::VectorImage<PixelType,Dimension> InputImageType;
typedef otb::Image<PixelType,Dimension> OutputImageType;
typedef otb::VectorImageToIntensityImageFilter<InputImageType,OutputImageType> FilterType;
// Instantiating object
FilterType::Pointer object = FilterType::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;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment