diff --git a/Examples/OBIA/RadiometricAttributesLabelMapFilterExample.cxx b/Examples/OBIA/RadiometricAttributesLabelMapFilterExample.cxx index 32bd5654d1c8e8a1075a74507b6ae47ca945b469..14f1f20d4f6c7bcea4dc8ed895cb6c23fe766e2f 100644 --- a/Examples/OBIA/RadiometricAttributesLabelMapFilterExample.cxx +++ b/Examples/OBIA/RadiometricAttributesLabelMapFilterExample.cxx @@ -56,7 +56,8 @@ #include "otbMultiChannelExtractROI.h" #include "otbAttributesMapOpeningLabelMapFilter.h" #include "otbVectorRescaleIntensityImageFilter.h" -#include "otbMultiChannelRAndNIRIndexImageFilter.h" +#include "otbVegetationIndicesFunctor.h" +#include "itkUnaryFunctorImageFilter.h" #include "otbImageToVectorImageCastFilter.h" int main(int argc, char* argv[]) @@ -106,8 +107,8 @@ int main(int argc, char* argv[]) typedef otb::BandsStatisticsAttributesLabelMapFilter<LabelMapType, VectorImageType> RadiometricLabelMapFilterType; typedef otb::AttributesMapOpeningLabelMapFilter<LabelMapType> OpeningLabelMapFilterType; typedef itk::LabelMapToBinaryImageFilter<LabelMapType, MaskImageType> LabelMapToBinaryImageFilterType; - typedef otb::MultiChannelRAndNIRIndexImageFilter<VectorImageType, ImageType> NDVIImageFilterType; - typedef otb::ImageToVectorImageCastFilter<ImageType, VectorImageType> ImageToVectorImageCastFilterType; + typedef itk::UnaryFunctorImageFilter<VectorImageType, ImageType,otb::Functor::NDVI<PixelType,PixelType,PixelType> > NDVIImageFilterType; + typedef otb::ImageToVectorImageCastFilter<ImageType, VectorImageType> ImageToVectorImageCastFilterType; ReaderType::Pointer reader = ReaderType::New(); reader->SetFileName(reffname); @@ -165,8 +166,8 @@ int main(int argc, char* argv[]) // In our case, statistics are computed on the NDVI coefficient on each label object. NDVIImageFilterType::Pointer ndviImageFilter = NDVIImageFilterType::New(); - ndviImageFilter->SetRedIndex(3); - ndviImageFilter->SetNIRIndex(4); + ndviImageFilter->GetFunctor().SetRedIndex(3); + ndviImageFilter->GetFunctor().SetNIRIndex(4); ndviImageFilter->SetInput(vreader->GetOutput()); ImageToVectorImageCastFilterType::Pointer ndviVectorImageFilter = ImageToVectorImageCastFilterType::New(); diff --git a/Examples/Radiometry/ARVIMultiChannelRAndBAndNIRVegetationIndexImageFilter.cxx b/Examples/Radiometry/ARVIMultiChannelRAndBAndNIRVegetationIndexImageFilter.cxx index 26d2bf45be16036466ed806a8ca7f434776a51cb..f9770ff6166ec37f52c26901ca2980fc45cd8c43 100644 --- a/Examples/Radiometry/ARVIMultiChannelRAndBAndNIRVegetationIndexImageFilter.cxx +++ b/Examples/Radiometry/ARVIMultiChannelRAndBAndNIRVegetationIndexImageFilter.cxx @@ -31,8 +31,6 @@ */ -// \index{otb::MultiChannelRAndBAndNIRIndexImageFilter} -// \index{otb::MultiChannelRAndBAndNIRIndexImageFilter!header} // \index{otb::VegetationIndices} // \index{otb::VegetationIndices!header} // @@ -84,7 +82,8 @@ // defining the \doxygen{otb}{MultiChannelRAndBAndNIRIndexImageFilter} // class must be included. -#include "otbMultiChannelRAndBAndNIRIndexImageFilter.h" +#include "itkUnaryFunctorImageFilter.h" +#include "otbVegetationIndicesFunctor.h" #include "otbImage.h" #include "otbImageFileReader.h" @@ -130,9 +129,9 @@ int main(int argc, char* argv[]) // type is defined using the image types and the ARVI functor as // template parameters. We then instantiate the filter itself. - typedef otb::MultiChannelRAndBAndNIRIndexImageFilter<InputImageType, OutputImageType, FunctorType> MultiChannelRAndBAndNIRIndexImageFilterType; + typedef itk::UnaryFunctorImageFilter<InputImageType, OutputImageType, FunctorType> ArviImageFilterType; - MultiChannelRAndBAndNIRIndexImageFilterType::Pointer filter = MultiChannelRAndBAndNIRIndexImageFilterType::New(); + ArviImageFilterType::Pointer filter = ArviImageFilterType::New(); ReaderType::Pointer reader = ReaderType::New(); WriterType::Pointer writer = WriterType::New(); @@ -144,9 +143,9 @@ int main(int argc, char* argv[]) // The three used index bands (red, blue and NIR) are declared. - filter->SetRedIndex(::atoi(argv[5])); - filter->SetBlueIndex(::atoi(argv[6])); - filter->SetNIRIndex(::atoi(argv[7])); + filter->GetFunctor().SetRedIndex(::atoi(argv[5])); + filter->GetFunctor().SetBlueIndex(::atoi(argv[6])); + filter->GetFunctor().SetNIRIndex(::atoi(argv[7])); // The $\gamma$ parameter is set. The // \doxygen{otb}{MultiChannelRAndBAndNIRIndexImageFilter} diff --git a/Examples/Radiometry/AVIMultiChannelRAndGAndNIRVegetationIndexImageFilter.cxx b/Examples/Radiometry/AVIMultiChannelRAndGAndNIRVegetationIndexImageFilter.cxx index ebaaf182df290622a6dc4adf20fe150d215d86dc..65f541e27bc298fde201f7d9047fcaa5c170cae5 100644 --- a/Examples/Radiometry/AVIMultiChannelRAndGAndNIRVegetationIndexImageFilter.cxx +++ b/Examples/Radiometry/AVIMultiChannelRAndGAndNIRVegetationIndexImageFilter.cxx @@ -33,8 +33,6 @@ */ -// \index{otb::MultiChannelRAndGAndNIRIndexImageFilter} -// \index{otb::MultiChannelRAndGAndNIRIndexImageFilter!header} // \index{otb::VegetationIndex} // \index{otb::VegetationIndex!header} // @@ -71,7 +69,8 @@ // \doxygen{otb}{MultiChannelRAndGAndNIRIndexImageFilter} // class must be included. -#include "otbMultiChannelRAndGAndNIRIndexImageFilter.h" +#include "otbVegetationIndicesFunctor.h" +#include "itkUnaryFunctorImageFilter.h" #include "otbImage.h" #include "otbImageFileReader.h" @@ -112,13 +111,13 @@ int main(int argc, char* argv[]) typedef otb::Functor::AVI<InputPixelType, InputPixelType, InputPixelType, OutputPixelType> FunctorType; // The - // \doxygen{otb}{MultiChannelRAndGAndNIRIndexImageFilter} + // \doxygen{itk}{UnaryFunctorImageFilter} // type is defined using the image types and the AVI functor as // template parameters. We then instantiate the filter itself. - typedef otb::MultiChannelRAndGAndNIRIndexImageFilter<InputImageType, OutputImageType, FunctorType> MultiChannelRAndGAndNIRIndexImageFilterType; + typedef itk::UnaryFunctorImageFilter<InputImageType, OutputImageType, FunctorType> AVIImageFilterTypeType; - MultiChannelRAndGAndNIRIndexImageFilterType::Pointer filter = MultiChannelRAndGAndNIRIndexImageFilterType::New(); + AVIImageFilterTypeType::Pointer filter = AVIImageFilterTypeType::New(); ReaderType::Pointer reader = ReaderType::New(); WriterType::Pointer writer = WriterType::New(); @@ -130,12 +129,12 @@ int main(int argc, char* argv[]) // The three used index bands (red, green and NIR) are declared. - filter->SetRedIndex(::atoi(argv[5])); - filter->SetGreenIndex(::atoi(argv[6])); - filter->SetNIRIndex(::atoi(argv[7])); + filter->GetFunctor().SetRedIndex(::atoi(argv[5])); + filter->GetFunctor().SetGreenIndex(::atoi(argv[6])); + filter->GetFunctor().SetNIRIndex(::atoi(argv[7])); // The $\lambda$ R, G and NIR parameters are set. The - // \doxygen{otb}{MultiChannelRAndGAndNIRIndexImageFilter} + // \doxygen{otb::Functor}{AVI} // class sets the default values of $\lambda$ to $660$, $560$ and // $830$. diff --git a/Examples/Radiometry/NDVIRAndNIRVegetationIndexImageFilter.cxx b/Examples/Radiometry/NDVIRAndNIRVegetationIndexImageFilter.cxx index a559e2a50275cc652a48438bbeffee61cc99f9b5..1fb540144c0dc8e067e3c5f559c9ace29e8f1817 100644 --- a/Examples/Radiometry/NDVIRAndNIRVegetationIndexImageFilter.cxx +++ b/Examples/Radiometry/NDVIRAndNIRVegetationIndexImageFilter.cxx @@ -64,13 +64,12 @@ // defining the \doxygen{otb}{RAndNIRIndexImageFilter} // class must be included. -#include "otbRAndNIRIndexImageFilter.h" - #include "itkMacro.h" #include "otbImage.h" #include "otbImageFileReader.h" #include "otbImageFileWriter.h" -#include "itkUnaryFunctorImageFilter.h" +#include "itkBinaryFunctorImageFilter.h" +#include "otbVegetationIndicesFunctor.h" #include "itkRescaleIntensityImageFilter.h" int main(int argc, char* argv[]) @@ -105,13 +104,13 @@ int main(int argc, char* argv[]) typedef otb::Functor::NDVI<InputPixelType, InputPixelType, OutputPixelType> FunctorType; - // The \doxygen{otb}{RAndNIRIndexImageFilter} type is instantiated using the images + // The \doxygen{itk}{BinaryFunctorImageFilter} type is instantiated using the images // types and the NDVI functor as template parameters. - typedef otb::RAndNIRIndexImageFilter<InputRImageType, InputNIRImageType, OutputImageType, FunctorType> RAndNIRIndexImageFilterType; + typedef itk::BinaryFunctorImageFilter<InputRImageType, InputNIRImageType, OutputImageType, FunctorType> NDVIImageFilterType; // Instantiating object - RAndNIRIndexImageFilterType::Pointer filter = RAndNIRIndexImageFilterType::New(); + NDVIImageFilterType::Pointer filter = NDVIImageFilterType::New(); RReaderType::Pointer readerR = RReaderType::New(); NIRReaderType::Pointer readerNIR = NIRReaderType::New(); WriterType::Pointer writer = WriterType::New(); @@ -126,8 +125,8 @@ int main(int argc, char* argv[]) // the reader output and the filter output is linked to the writer // input. - filter->SetInputR(readerR->GetOutput()); - filter->SetInputNIR(readerNIR->GetOutput()); + filter->SetInput1(readerR->GetOutput()); + filter->SetInput2(readerNIR->GetOutput()); writer->SetInput(filter->GetOutput()); diff --git a/Examples/Simulation/LAIAndPROSAILToSensorResponse.cxx b/Examples/Simulation/LAIAndPROSAILToSensorResponse.cxx index 720646d12d92a0ebd88ee29fa982da7001e80d6d..71f4cc673fcadef9a386f6c52fca0ca9a07219d2 100644 --- a/Examples/Simulation/LAIAndPROSAILToSensorResponse.cxx +++ b/Examples/Simulation/LAIAndPROSAILToSensorResponse.cxx @@ -53,7 +53,7 @@ #include "otbSpatialisationFilter.h" #include "otbAttributesMapLabelObject.h" #include "itkTernaryFunctorImageFilter.h" -#include "otbRAndNIRIndexImageFilter.h" +#include "itkUnaryFunctorImageFilter.h" #include "otbVectorDataToLabelMapWithAttributesFilter.h" namespace otb