Commit e833b03c authored by Cédric Traizet's avatar Cédric Traizet

Merge branch 'develop' into train_images_regression

parents 20650afc 51e15d69
......@@ -61,8 +61,8 @@ fast-build:
when: on_failure
expire_in: 24 hrs
paths:
- log/*.txt
- build/*/*.log
- build/*/*.log #CMake log
- log/*.txt # Others
debian-build:
extends: .common-build
......@@ -94,9 +94,8 @@ ubuntu-llvm:
expire_in: 24 hrs
when: always
paths:
- sb_branch.txt
# This recovers logs from superbuild build
- build/*/*/*/*.log
- sb_branch.txt # Needed to checkout correct branch in build step
- build/*/*/*/*.log # Superbuild log
## Ubuntu superbuild
ubuntu-superbuild-prepare:
......@@ -114,7 +113,7 @@ ubuntu-superbuild-build:
dependencies:
- ubuntu-superbuild-prepare
## Centos superbuild
## CentOS superbuild
centos-superbuild-prepare:
extends: .common-prepare
image: $BUILD_IMAGE_REGISTRY/otb-centos-superbuild-base:6.6
......@@ -129,3 +128,28 @@ centos-superbuild-build:
- xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -VV -S CI/main_packages.cmake -DIMAGE_NAME:string=otb-centos-superbuild-base
dependencies:
- centos-superbuild-prepare
## MacOS superbuild
macos-superbuild-prepare:
tags:
- macos
extends: .common-prepare
before_script:
# No need to install lfs as this machine is persistent
# No need to do git config
# Checkout the expected branch
- export GIT_LFS_SKIP_SMUDGE=1
- git checkout -f -q $CI_COMMIT_SHA
- export GIT_LFS_SKIP_SMUDGE=0
script:
- ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-macos-superbuild
macos-superbuild-build:
tags:
- macos
extends: .common-build
script:
- ctest -V -S CI/main_superbuild.cmake -DIMAGE_NAME:string=otb-macos-superbuild
- ctest -VV -S CI/main_packages.cmake -DIMAGE_NAME:string=otb-macos-superbuild
dependencies:
- macos-superbuild-prepare
......@@ -70,6 +70,12 @@ endif()
if (clone_res)
message( SEND_ERROR "Problem in retreiving the archive")
message( "Command : COMMAND ${GIT} clone ${REMOTE} --branch ${BRANCH_NAME} \
--depth 1 superbuild-artifact")
message( "Result :")
message( "clone_res = ${clone_res}" )
message( "clone_out = ${clone_out}" )
message( "clone_err = ${clone_err}" )
return()
endif()
......
#
# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
# https://www.orfeo-toolbox.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Configuration options for macOS
set(site_option
"OTB_USE_GLUT=OFF
OTB_USE_GLFW=OFF")
\ No newline at end of file
......@@ -286,4 +286,4 @@ if ( DEBUG )
message( "push_res = ${push_res}" )
message( "push_out = ${push_out}" )
message( "push_err = ${push_err}" )
endif()
endif()
\ No newline at end of file
This diff is collapsed.
......@@ -42,10 +42,10 @@ public:
// Class declaration is followed by \code{ITK} public types for the class, the superclass and
// smart pointers.
typedef ApplicationExample Self;
typedef Application Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
using Self = ApplicationExample;
using Superclass = Application;
using Pointer = itk::SmartPointer<Self>;
using ConstPointer = itk::SmartPointer<const Self>;
// Following macros are necessary to respect ITK object factory mechanisms. Please report
// to \ref{sec:FilterConventions} for additional information.
......
......@@ -53,16 +53,16 @@ int main(int argc, char* argv[])
// writing the images. The BandMathImageFilter class
// works with Image as input, so we need to define additional
// filters to extract each layer of the multispectral image.
typedef double PixelType;
typedef otb::VectorImage<PixelType, 2> InputImageType;
typedef otb::Image<PixelType, 2> OutputImageType;
typedef otb::ImageList<OutputImageType> ImageListType;
typedef otb::VectorImageToImageListFilter<InputImageType, ImageListType> VectorImageToImageListType;
typedef otb::ImageFileReader<InputImageType> ReaderType;
typedef otb::ImageFileWriter<OutputImageType> WriterType;
using PixelType = double;
using InputImageType = otb::VectorImage<PixelType, 2>;
using OutputImageType = otb::Image<PixelType, 2>;
using ImageListType = otb::ImageList<OutputImageType>;
using VectorImageToImageListType = otb::VectorImageToImageListFilter<InputImageType, ImageListType>;
using ReaderType = otb::ImageFileReader<InputImageType>;
using WriterType = otb::ImageFileWriter<OutputImageType>;
// We can now define the type for the filter
typedef otb::BandMathImageFilter<OutputImageType> FilterType;
using FilterType = otb::BandMathImageFilter<OutputImageType>;
// We instantiate the filter, the reader, and the writer
ReaderType::Pointer reader = ReaderType::New();
......@@ -107,11 +107,12 @@ int main(int argc, char* argv[])
writer->Update();
// The muParser library also provides the possibility to extend existing built-in functions. For example,
// you can use the OTB expression "ndvi(b3, b4)" with the filter. In this instance, the mathematical expression would be "if(ndvi(b3, b4)>0.4, 255, 0)", which would return the same result.
// you can use the OTB expression "ndvi(b3, b4)" with the filter. In this instance, the mathematical expression would be "if(ndvi(b3, b4)>0.4, 255, 0)", which
// would return the same result.
typedef otb::Image<unsigned char, 2> OutputPrettyImageType;
typedef otb::ImageFileWriter<OutputPrettyImageType> PrettyImageFileWriterType;
typedef itk::CastImageFilter<OutputImageType, OutputPrettyImageType> CastImageFilterType;
using OutputPrettyImageType = otb::Image<unsigned char, 2>;
using PrettyImageFileWriterType = otb::ImageFileWriter<OutputPrettyImageType>;
using CastImageFilterType = itk::CastImageFilter<OutputImageType, OutputPrettyImageType>;
PrettyImageFileWriterType::Pointer prettyWriter = PrettyImageFileWriterType::New();
CastImageFilterType::Pointer caster = CastImageFilterType::New();
......
......@@ -67,15 +67,15 @@ int main(int argc, char* argv[])
// writing the images. The \doxygen{otb}{BandMathXImageFilter} class
// works with \doxygen{otb}{VectorImage}.
typedef double PixelType;
typedef otb::VectorImage<PixelType, 2> ImageType;
typedef otb::ImageFileReader<ImageType> ReaderType;
typedef otb::ImageFileWriter<ImageType> WriterType;
using PixelType = double;
using ImageType = otb::VectorImage<PixelType, 2>;
using ReaderType = otb::ImageFileReader<ImageType>;
using WriterType = otb::ImageFileWriter<ImageType>;
// We can now define the type for the filter:
typedef otb::BandMathXImageFilter<ImageType> FilterType;
using FilterType = otb::BandMathXImageFilter<ImageType>;
// We instantiate the filter, the reader, and the writer:
......
......@@ -52,23 +52,23 @@ int main(int argc, char* argv[])
return EXIT_FAILURE;
}
typedef double PixelType;
typedef unsigned char UCharPixelType;
typedef itk::RGBPixel<UCharPixelType> RGBPixelType;
typedef otb::Image<PixelType, 2> ImageType;
typedef otb::Image<RGBPixelType, 2> RGBImageType;
typedef otb::ImageFileWriter<RGBImageType> WriterType;
using PixelType = double;
using UCharPixelType = unsigned char;
using RGBPixelType = itk::RGBPixel<UCharPixelType>;
using ImageType = otb::Image<PixelType, 2>;
using RGBImageType = otb::Image<RGBPixelType, 2>;
using WriterType = otb::ImageFileWriter<RGBImageType>;
WriterType::Pointer writer = WriterType::New();
writer->SetFileName(argv[1]);
typedef otb::DEMToImageGenerator<ImageType> DEMToImageGeneratorType;
using DEMToImageGeneratorType = otb::DEMToImageGenerator<ImageType>;
DEMToImageGeneratorType::Pointer demToImage = DEMToImageGeneratorType::New();
typedef DEMToImageGeneratorType::SizeType SizeType;
typedef DEMToImageGeneratorType::SpacingType SpacingType;
typedef DEMToImageGeneratorType::PointType PointType;
using SizeType = DEMToImageGeneratorType::SizeType;
using SpacingType = DEMToImageGeneratorType::SpacingType;
using PointType = DEMToImageGeneratorType::PointType;
otb::DEMHandler::Instance()->OpenDEMDirectory(argv[8]);
......@@ -94,14 +94,14 @@ int main(int argc, char* argv[])
// the filter in charge of calling the functor we specify to do the work for
// each pixel. Here it is the ScalarToRainbowRGBPixelFunctor.
typedef itk::ScalarToRGBColormapImageFilter<ImageType, RGBImageType> ColorMapFilterType;
ColorMapFilterType::Pointer colormapper = ColorMapFilterType::New();
using ColorMapFilterType = itk::ScalarToRGBColormapImageFilter<ImageType, RGBImageType>;
ColorMapFilterType::Pointer colormapper = ColorMapFilterType::New();
colormapper->UseInputImageExtremaForScalingOff();
if (argc == 9)
{
typedef otb::Functor::ScalarToRainbowRGBPixelFunctor<PixelType, RGBPixelType> ColorMapFunctorType;
ColorMapFunctorType::Pointer colormap = ColorMapFunctorType::New();
using ColorMapFunctorType = otb::Functor::ScalarToRainbowRGBPixelFunctor<PixelType, RGBPixelType>;
ColorMapFunctorType::Pointer colormap = ColorMapFunctorType::New();
colormap->SetMinimumInputValue(0);
colormap->SetMaximumInputValue(4000);
colormapper->SetColormap(colormap);
......@@ -111,16 +111,16 @@ int main(int argc, char* argv[])
{
if (strcmp(argv[9], "hot") == 0)
{
typedef itk::Function::HotColormapFunction<PixelType, RGBPixelType> ColorMapFunctorType;
ColorMapFunctorType::Pointer colormap = ColorMapFunctorType::New();
using ColorMapFunctorType = itk::Function::HotColormapFunction<PixelType, RGBPixelType>;
ColorMapFunctorType::Pointer colormap = ColorMapFunctorType::New();
colormap->SetMinimumInputValue(0);
colormap->SetMaximumInputValue(4000);
colormapper->SetColormap(colormap);
}
else
{
typedef otb::Functor::ReliefColormapFunctor<PixelType, RGBPixelType> ColorMapFunctorType;
ColorMapFunctorType::Pointer colormap = ColorMapFunctorType::New();
using ColorMapFunctorType = otb::Functor::ReliefColormapFunctor<PixelType, RGBPixelType>;
ColorMapFunctorType::Pointer colormap = ColorMapFunctorType::New();
colormap->SetMinimumInputValue(0);
colormap->SetMaximumInputValue(4000);
colormapper->SetColormap(colormap);
......
......@@ -39,14 +39,14 @@ int main(int argc, char* argv[])
return EXIT_FAILURE;
}
typedef unsigned char PixelType;
typedef otb::Image<PixelType, 2> InputImageType;
typedef otb::Image<PixelType, 2> OutputImageType;
using PixelType = unsigned char;
using InputImageType = otb::Image<PixelType, 2>;
using OutputImageType = otb::Image<PixelType, 2>;
// The filter can be instantiated using the image types defined previously.
typedef otb::FrostImageFilter<InputImageType, OutputImageType> FilterType;
typedef otb::ImageFileReader<InputImageType> ReaderType;
typedef otb::ImageFileWriter<OutputImageType> WriterType;
using FilterType = otb::FrostImageFilter<InputImageType, OutputImageType>;
using ReaderType = otb::ImageFileReader<InputImageType>;
using WriterType = otb::ImageFileWriter<OutputImageType>;
ReaderType::Pointer reader = ReaderType::New();
FilterType::Pointer filter = FilterType::New();
......
......@@ -48,14 +48,14 @@ int main(int argc, char* argv[])
return EXIT_FAILURE;
}
typedef double PixelType;
typedef unsigned char UCharPixelType;
typedef itk::RGBPixel<UCharPixelType> RGBPixelType;
typedef otb::Image<PixelType, 2> ImageType;
typedef otb::Image<RGBPixelType, 2> RGBImageType;
typedef otb::Image<UCharPixelType, 2> ScalarImageType;
typedef otb::ImageFileWriter<RGBImageType> WriterType;
typedef otb::ImageFileWriter<ScalarImageType> ScalarWriterType;
using PixelType = double;
using UCharPixelType = unsigned char;
using RGBPixelType = itk::RGBPixel<UCharPixelType>;
using ImageType = otb::Image<PixelType, 2>;
using RGBImageType = otb::Image<RGBPixelType, 2>;
using ScalarImageType = otb::Image<UCharPixelType, 2>;
using WriterType = otb::ImageFileWriter<RGBImageType>;
using ScalarWriterType = otb::ImageFileWriter<ScalarImageType>;
ScalarWriterType::Pointer writer = ScalarWriterType::New();
writer->SetFileName(argv[1]);
......@@ -63,13 +63,13 @@ int main(int argc, char* argv[])
WriterType::Pointer writer2 = WriterType::New();
writer2->SetFileName(argv[2]);
typedef otb::DEMToImageGenerator<ImageType> DEMToImageGeneratorType;
using DEMToImageGeneratorType = otb::DEMToImageGenerator<ImageType>;
DEMToImageGeneratorType::Pointer demToImage = DEMToImageGeneratorType::New();
typedef DEMToImageGeneratorType::SizeType SizeType;
typedef DEMToImageGeneratorType::SpacingType SpacingType;
typedef DEMToImageGeneratorType::PointType PointType;
using SizeType = DEMToImageGeneratorType::SizeType;
using SpacingType = DEMToImageGeneratorType::SpacingType;
using PointType = DEMToImageGeneratorType::PointType;
otb::DEMHandler::Instance()->OpenDEMDirectory(argv[9]);
......@@ -113,35 +113,35 @@ int main(int argc, char* argv[])
// operations in its neighborhood. A convenient filter called \doxygen{otb}{HillShadingFilter}
// is defined around this mechanism.
typedef otb::HillShadingFilter<ImageType, ImageType> HillShadingFilterType;
HillShadingFilterType::Pointer hillShading = HillShadingFilterType::New();
using HillShadingFilterType = otb::HillShadingFilter<ImageType, ImageType>;
HillShadingFilterType::Pointer hillShading = HillShadingFilterType::New();
hillShading->SetRadius(1);
hillShading->SetInput(demToImage->GetOutput());
hillShading->GetFunctor().SetXRes(res);
hillShading->GetFunctor().SetYRes(res);
typedef itk::ShiftScaleImageFilter<ImageType, ScalarImageType> RescalerType;
RescalerType::Pointer rescaler = RescalerType::New();
using RescalerType = itk::ShiftScaleImageFilter<ImageType, ScalarImageType>;
RescalerType::Pointer rescaler = RescalerType::New();
rescaler->SetScale(255.0);
rescaler->SetInput(hillShading->GetOutput());
writer->SetInput(rescaler->GetOutput());
typedef itk::ScalarToRGBColormapImageFilter<ImageType, RGBImageType> ColorMapFilterType;
ColorMapFilterType::Pointer colormapper = ColorMapFilterType::New();
using ColorMapFilterType = itk::ScalarToRGBColormapImageFilter<ImageType, RGBImageType>;
ColorMapFilterType::Pointer colormapper = ColorMapFilterType::New();
colormapper->UseInputImageExtremaForScalingOff();
typedef otb::Functor::ReliefColormapFunctor<PixelType, RGBPixelType> ColorMapFunctorType;
ColorMapFunctorType::Pointer colormap = ColorMapFunctorType::New();
using ColorMapFunctorType = otb::Functor::ReliefColormapFunctor<PixelType, RGBPixelType>;
ColorMapFunctorType::Pointer colormap = ColorMapFunctorType::New();
colormap->SetMinimumInputValue(0);
colormap->SetMaximumInputValue(4000);
colormapper->SetColormap(colormap);
colormapper->SetInput(demToImage->GetOutput());
typedef itk::BinaryFunctorImageFilter<RGBImageType, ImageType, RGBImageType, otb::Functor::HillShadeModulationFunctor<RGBPixelType, PixelType, RGBPixelType>>
MultiplyFilterType;
using MultiplyFilterType =
itk::BinaryFunctorImageFilter<RGBImageType, ImageType, RGBImageType, otb::Functor::HillShadeModulationFunctor<RGBPixelType, PixelType, RGBPixelType>>;
MultiplyFilterType::Pointer multiply = MultiplyFilterType::New();
multiply->SetInput1(colormapper->GetOutput());
......
......@@ -43,37 +43,37 @@ int main(int argc, char* argv[])
const char* outputRGBFilename = argv[2];
const char* outputScaledFilename = argv[3];
typedef otb::Image<unsigned long, 2> ImageType;
typedef otb::Image<itk::RGBPixel<unsigned char>, 2> RGBImageType;
using ImageType = otb::Image<unsigned long, 2>;
using RGBImageType = otb::Image<itk::RGBPixel<unsigned char>, 2>;
typedef otb::ImageFileReader<ImageType> ReaderType;
ReaderType::Pointer reader = ReaderType::New();
using ReaderType = otb::ImageFileReader<ImageType>;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(inputFilename);
// The UnaryFunctorImageFilter is the filter in charge of calling the functor
// we specify to do the work for each pixel. Here it is the ScalarToRGBPixelFunctor
typedef itk::Functor::ScalarToRGBPixelFunctor<unsigned long> ColorMapFunctorType;
typedef itk::UnaryFunctorImageFilter<ImageType, RGBImageType, ColorMapFunctorType> ColorMapFilterType;
ColorMapFilterType::Pointer colormapper = ColorMapFilterType::New();
using ColorMapFunctorType = itk::Functor::ScalarToRGBPixelFunctor<unsigned long>;
using ColorMapFilterType = itk::UnaryFunctorImageFilter<ImageType, RGBImageType, ColorMapFunctorType>;
ColorMapFilterType::Pointer colormapper = ColorMapFilterType::New();
colormapper->SetInput(reader->GetOutput());
typedef otb::ImageFileWriter<RGBImageType> WriterType;
WriterType::Pointer writer = WriterType::New();
using WriterType = otb::ImageFileWriter<RGBImageType>;
WriterType::Pointer writer = WriterType::New();
writer->SetFileName(outputRGBFilename);
writer->SetInput(colormapper->GetOutput());
writer->Update();
// The following is just to produce the input image for the software guide
typedef otb::Image<unsigned char, 2> OutputImageType;
typedef itk::RescaleIntensityImageFilter<ImageType, OutputImageType> RescalerType;
RescalerType::Pointer rescaler = RescalerType::New();
using OutputImageType = otb::Image<unsigned char, 2>;
using RescalerType = itk::RescaleIntensityImageFilter<ImageType, OutputImageType>;
RescalerType::Pointer rescaler = RescalerType::New();
rescaler->SetInput(reader->GetOutput());
typedef otb::ImageFileWriter<OutputImageType> UCharWriterType;
UCharWriterType::Pointer writer2 = UCharWriterType::New();
using UCharWriterType = otb::ImageFileWriter<OutputImageType>;
UCharWriterType::Pointer writer2 = UCharWriterType::New();
writer2->SetFileName(outputScaledFilename);
writer2->SetInput(rescaler->GetOutput());
writer2->Update();
......
......@@ -38,22 +38,22 @@ int main(int argc, char* argv[])
return EXIT_FAILURE;
}
typedef unsigned char PixelType;
using PixelType = unsigned char;
// The images are defined using the pixel type and the dimension.
typedef otb::Image<PixelType, 2> InputImageType;
typedef otb::Image<PixelType, 2> OutputImageType;
using InputImageType = otb::Image<PixelType, 2>;
using OutputImageType = otb::Image<PixelType, 2>;
// The filter can be instantiated using the image types defined above.
typedef otb::LeeImageFilter<InputImageType, OutputImageType> FilterType;
using FilterType = otb::LeeImageFilter<InputImageType, OutputImageType>;
// An ImageFileReader class is also instantiated in order to read
// image data from a file.
typedef otb::ImageFileReader<InputImageType> ReaderType;
using ReaderType = otb::ImageFileReader<InputImageType>;
// An ImageFileWriter is instantiated in order to write the
// output image to a file.
typedef otb::ImageFileWriter<OutputImageType> WriterType;
using WriterType = otb::ImageFileWriter<OutputImageType>;
// Both the filter and the reader are created by invoking their New()
// methods and assigning the result to SmartPointers.
......
......@@ -63,19 +63,19 @@ int main(int argc, char* argv[])
const unsigned int Dimension = 2;
typedef float PixelType;
typedef unsigned int LabelPixelType;
typedef itk::RGBPixel<unsigned char> ColorPixelType;
using PixelType = float;
using LabelPixelType = unsigned int;
using ColorPixelType = itk::RGBPixel<unsigned char>;
typedef otb::VectorImage<PixelType, Dimension> ImageType;
typedef otb::Image<LabelPixelType, Dimension> LabelImageType;
typedef otb::Image<ColorPixelType, Dimension> RGBImageType;
using ImageType = otb::VectorImage<PixelType, Dimension>;
using LabelImageType = otb::Image<LabelPixelType, Dimension>;
using RGBImageType = otb::Image<ColorPixelType, Dimension>;
typedef otb::ImageFileReader<ImageType> ReaderType;
typedef otb::ImageFileWriter<ImageType> WriterType;
typedef otb::ImageFileWriter<LabelImageType> LabelWriterType;
using ReaderType = otb::ImageFileReader<ImageType>;
using WriterType = otb::ImageFileWriter<ImageType>;
using LabelWriterType = otb::ImageFileWriter<LabelImageType>;
typedef otb::MeanShiftSegmentationFilter<ImageType, LabelImageType, ImageType> FilterType;
using FilterType = otb::MeanShiftSegmentationFilter<ImageType, LabelImageType, ImageType>;
// We instantiate the filter, the reader, and 2 writers (for the
// labeled and clustered images).
......@@ -118,15 +118,15 @@ int main(int argc, char* argv[])
writer1->Update();
writer2->Update();
typedef otb::PrintableImageFilter<ImageType> PrintableFilterType;
PrintableFilterType::Pointer printableImageFilter = PrintableFilterType::New();
using PrintableFilterType = otb::PrintableImageFilter<ImageType>;
PrintableFilterType::Pointer printableImageFilter = PrintableFilterType::New();
printableImageFilter->SetChannel(1);
printableImageFilter->SetChannel(2);
printableImageFilter->SetChannel(3);
typedef PrintableFilterType::OutputImageType OutputImageType;
typedef otb::ImageFileWriter<OutputImageType> PrettyWriterType;
using OutputImageType = PrintableFilterType::OutputImageType;
using PrettyWriterType = otb::ImageFileWriter<OutputImageType>;
PrettyWriterType::Pointer prettyWriter = PrettyWriterType::New();
......@@ -135,14 +135,14 @@ int main(int argc, char* argv[])
prettyWriter->SetInput(printableImageFilter->GetOutput());
prettyWriter->Update();
typedef otb::ImageFileWriter<RGBImageType> LabelRGBWriterType;
using LabelRGBWriterType = otb::ImageFileWriter<RGBImageType>;
LabelRGBWriterType::Pointer labelRGBWriter = LabelRGBWriterType::New();
// Label to RGB image
typedef itk::Functor::ScalarToRGBPixelFunctor<LabelPixelType> FunctorType;
typedef itk::UnaryFunctorImageFilter<LabelImageType, RGBImageType, FunctorType> ColorLabelFilterType;
ColorLabelFilterType::Pointer labelToRGB = ColorLabelFilterType::New();
using FunctorType = itk::Functor::ScalarToRGBPixelFunctor<LabelPixelType>;
using ColorLabelFilterType = itk::UnaryFunctorImageFilter<LabelImageType, RGBImageType, FunctorType>;
ColorLabelFilterType::Pointer labelToRGB = ColorLabelFilterType::New();
labelToRGB->SetInput(filter->GetLabelOutput());
......
......@@ -50,20 +50,20 @@ int main(int argc, char* argv[])
int greenChannelNumber = atoi(argv[4]);
int blueChannelNumber = atoi(argv[5]);
typedef double InputPixelType;
using InputPixelType = double;
const unsigned int Dimension = 2;
typedef otb::VectorImage<InputPixelType, Dimension> InputImageType;
using InputImageType = otb::VectorImage<InputPixelType, Dimension>;
typedef otb::ImageFileReader<InputImageType> ReaderType;
using ReaderType = otb::ImageFileReader<InputImageType>;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(inputFilename);
// To easily convert the image to a printable format, i.e. 3 bands
// unsigned char value, you can use the PrintableImageFilter.
typedef otb::PrintableImageFilter<InputImageType> PrintableFilterType;
PrintableFilterType::Pointer printableImageFilter = PrintableFilterType::New();
using PrintableFilterType = otb::PrintableImageFilter<InputImageType>;
PrintableFilterType::Pointer printableImageFilter = PrintableFilterType::New();
printableImageFilter->SetInput(reader->GetOutput());
printableImageFilter->SetChannel(redChannelNumber);
......@@ -72,8 +72,8 @@ int main(int argc, char* argv[])
// When you create the writer to plug at the output of the printableImageFilter
// you may want to use the direct type definition as it is a good way to avoid mismatch:
typedef PrintableFilterType::OutputImageType OutputImageType;
typedef otb::ImageFileWriter<OutputImageType> WriterType;
using OutputImageType = PrintableFilterType::OutputImageType;
using WriterType = otb::ImageFileWriter<OutputImageType>;
WriterType::Pointer writer = WriterType::New();
writer->SetFileName(outputFilename);
......
......@@ -40,28 +40,28 @@ int main(int argc, char* argv[])
return EXIT_FAILURE;
}
typedef unsigned short InputPixelType;
typedef unsigned char OutputPixelType;
typedef otb::Image<InputPixelType, 2> InputImageType;
typedef otb::Image<OutputPixelType, 2> OutputImageType;
using InputPixelType = unsigned short;
using OutputPixelType = unsigned char;
using InputImageType = otb::Image<InputPixelType, 2>;
using OutputImageType = otb::Image<OutputPixelType, 2>;