Commit b6a1d3fb authored by Julien Michel's avatar Julien Michel

COMP: Fix examples following filters removal

parent be7d3eba
......@@ -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();
......
......@@ -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}
......
......@@ -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$.
......
......@@ -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());
......
......@@ -53,7 +53,7 @@
#include "otbSpatialisationFilter.h"
#include "otbAttributesMapLabelObject.h"
#include "itkTernaryFunctorImageFilter.h"
#include "otbRAndNIRIndexImageFilter.h"
#include "itkUnaryFunctorImageFilter.h"
#include "otbVectorDataToLabelMapWithAttributesFilter.h"
namespace otb
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment