Skip to content
Snippets Groups Projects
Commit 6de9c5fe authored by Julien Michel's avatar Julien Michel
Browse files

ENH: Correcting Vegetation Index tests.

parent f487df0c
No related branches found
No related tags found
No related merge requests found
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include "otbVegetationIndex.h" #include "otbVegetationIndex.h"
template<class TInputImage, class TOutputImage, class TFunction> template<class TInputImage, class TOutputImage, class TFunction>
int generic_SetASetBMultiChannelRAndNIRVegetationIndexImageFilter(int argc, char * argv[]) void generic_SetASetBMultiChannelRAndNIRVegetationIndexImageFilter(int argc, char * argv[])
{ {
typedef otb::ImageFileReader<TInputImage> ReaderType; typedef otb::ImageFileReader<TInputImage> ReaderType;
typedef otb::ImageFileWriter<TOutputImage> WriterType; typedef otb::ImageFileWriter<TOutputImage> WriterType;
...@@ -65,17 +65,15 @@ int otbSetASetBMultiChannelRAndNIRVegetationIndexImageFilter(int argc, char * ar ...@@ -65,17 +65,15 @@ int otbSetASetBMultiChannelRAndNIRVegetationIndexImageFilter(int argc, char * ar
std::string strArgv(argv[1]); std::string strArgv(argv[1]);
argc--; argc--;
argv++; argv++;
if ( strArgv == "PVI" ) return( generic_SetASetBMultiChannelRAndNIRVegetationIndexImageFilter<InputImageType, OutputImageType, if ( strArgv == "PVI" ) generic_SetASetBMultiChannelRAndNIRVegetationIndexImageFilter<InputImageType, OutputImageType,
otb::Functor::PVI< InputImageType::InternalPixelType, otb::Functor::PVI< InputImageType::InternalPixelType,
InputImageType::InternalPixelType, InputImageType::InternalPixelType,
OutputImageType::PixelType> > OutputImageType::PixelType> >
(argc,argv) ); (argc,argv);
else if ( strArgv == "TSAVI" ) return( generic_SetASetBMultiChannelRAndNIRVegetationIndexImageFilter<InputImageType, OutputImageType, else if ( strArgv == "TSAVI" ) generic_SetASetBMultiChannelRAndNIRVegetationIndexImageFilter<InputImageType, OutputImageType,
otb::Functor::TSAVI< InputImageType::InternalPixelType, otb::Functor::TSAVI< InputImageType::InternalPixelType,
InputImageType::InternalPixelType, InputImageType::InternalPixelType,
OutputImageType::PixelType> > OutputImageType::PixelType> >
(argc,argv) ); (argc,argv);
else
return EXIT_FAILURE;
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "otbVegetationIndex.h" #include "otbVegetationIndex.h"
template<class TInputRImage, class TInputNIRImage, class TOutputImage, class TFunction> template<class TInputRImage, class TInputNIRImage, class TOutputImage, class TFunction>
int generic_SetASetBRAndNIRVegetationIndexImageFilter(int argc, char * argv[]) void generic_SetASetBRAndNIRVegetationIndexImageFilter(int argc, char * argv[])
{ {
typedef otb::ImageFileReader<TInputRImage> RReaderType; typedef otb::ImageFileReader<TInputRImage> RReaderType;
typedef otb::ImageFileReader<TInputNIRImage> NIRReaderType; typedef otb::ImageFileReader<TInputNIRImage> NIRReaderType;
...@@ -53,9 +53,6 @@ int generic_SetASetBRAndNIRVegetationIndexImageFilter(int argc, char * argv[]) ...@@ -53,9 +53,6 @@ int generic_SetASetBRAndNIRVegetationIndexImageFilter(int argc, char * argv[])
filter->GetFunctor().SetB(b); filter->GetFunctor().SetB(b);
writer->SetInput( filter->GetOutput() ); writer->SetInput( filter->GetOutput() );
writer->Update(); writer->Update();
return EXIT_SUCCESS;
} }
...@@ -71,17 +68,15 @@ int otbSetASetBRAndNIRVegetationIndexImageFilter(int argc, char * argv[]) ...@@ -71,17 +68,15 @@ int otbSetASetBRAndNIRVegetationIndexImageFilter(int argc, char * argv[])
std::string strArgv(argv[1]); std::string strArgv(argv[1]);
argc--; argc--;
argv++; argv++;
if ( strArgv == "PVI" ) return( generic_SetASetBRAndNIRVegetationIndexImageFilter<InputRImageType, InputNIRImageType, OutputImageType, if ( strArgv == "PVI" ) generic_SetASetBRAndNIRVegetationIndexImageFilter<InputRImageType, InputNIRImageType, OutputImageType,
otb::Functor::PVI< InputRImageType::PixelType, otb::Functor::PVI< InputRImageType::PixelType,
InputNIRImageType::PixelType, InputNIRImageType::PixelType,
OutputImageType::PixelType> > OutputImageType::PixelType> >
(argc,argv) ); (argc,argv);
else if ( strArgv == "TSAVI" ) return( generic_SetASetBRAndNIRVegetationIndexImageFilter<InputRImageType, InputNIRImageType, OutputImageType, else if ( strArgv == "TSAVI" ) generic_SetASetBRAndNIRVegetationIndexImageFilter<InputRImageType, InputNIRImageType, OutputImageType,
otb::Functor::TSAVI< InputRImageType::PixelType, otb::Functor::TSAVI< InputRImageType::PixelType,
InputNIRImageType::PixelType, InputNIRImageType::PixelType,
OutputImageType::PixelType> > OutputImageType::PixelType> >
(argc,argv) ); (argc,argv);
else
return EXIT_FAILURE;
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment