OTB  9.0.0
Orfeo Toolbox
otbMorphologicalProfilesSegmentationFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbMorphologicalProfilesSegmentationFilter_h
22 #define otbMorphologicalProfilesSegmentationFilter_h
23 
29 #include "otbImage.h"
30 #include "itkScalarConnectedComponentImageFilter.h"
31 #include "itkBinaryBallStructuringElement.h"
32 
33 namespace otb
34 {
60 template <class TInputImage, class TOutputImage, class TInternalPrecision = float,
61  class TStructuringElement = itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
62 class ITK_EXPORT MorphologicalProfilesSegmentationFilter : public itk::ImageToImageFilter<TInputImage, TOutputImage>
63 {
64 public:
67  typedef itk::ImageToImageFilter<TInputImage, TOutputImage> Superclass;
68 
69  typedef itk::SmartPointer<Self> Pointer;
70  typedef itk::SmartPointer<const Self> ConstPointer;
71 
73  typedef TInputImage InputImageType;
74  typedef typename InputImageType::PixelType InputPixelType;
75  typedef TOutputImage OutputImageType;
77 
78  typedef TStructuringElement StructuringElementType;
79 
84  typedef otb::MultiScaleConvexOrConcaveClassificationFilter<InternalImageType, OutputImageType> MultiScaleClassificationFilterType;
85  typedef itk::ScalarConnectedComponentImageFilter<OutputImageType, OutputImageType> ConnectedComponentsFilterType;
86 
88  itkNewMacro(Self);
89 
91  itkTypeMacro(MorphologicalProfilesSegmentationFilter, itk::ImageToImageFilter);
92 
93  itkSetMacro(ProfileSize, unsigned int);
94  itkGetConstReferenceMacro(ProfileSize, unsigned int);
95  itkSetMacro(ProfileStart, unsigned int);
96  itkGetConstReferenceMacro(ProfileStart, unsigned int);
97  itkSetMacro(ProfileStep, unsigned int);
98  itkGetConstReferenceMacro(ProfileStep, unsigned int);
99  itkSetMacro(Sigma, double);
100  itkGetConstReferenceMacro(Sigma, double);
101 
102 protected:
104 
106 
107  void GenerateData() override;
108 
109 private:
116  typename MultiScaleClassificationFilterType::Pointer m_ClassificationFilter;
117  typename ConnectedComponentsFilterType::Pointer m_ConnectedComponentsFilter;
118 
119  unsigned int m_ProfileSize;
120  unsigned int m_ProfileStart;
121  unsigned int m_ProfileStep;
122  double m_Sigma;
123 };
124 
125 
126 } // end namespace otb
127 
128 #ifndef OTB_MANUAL_INSTANTIATION
130 #endif
131 
132 #endif
otbProfileToProfileDerivativeFilter.h
otb::ProfileToProfileDerivativeFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbProfileToProfileDerivativeFilter.h:53
otb::MorphologicalProfilesSegmentationFilter::ClosingProfileFilterType
otb::MorphologicalClosingProfileFilter< InputImageType, InternalImageType, StructuringElementType > ClosingProfileFilterType
Definition: otbMorphologicalProfilesSegmentationFilter.h:81
otb::MorphologicalProfilesSegmentationFilter::m_ConnectedComponentsFilter
ConnectedComponentsFilterType::Pointer m_ConnectedComponentsFilter
Definition: otbMorphologicalProfilesSegmentationFilter.h:117
otb::MorphologicalProfilesSegmentationFilter::m_OpeningProfile
OpeningProfileFilterType::Pointer m_OpeningProfile
Definition: otbMorphologicalProfilesSegmentationFilter.h:110
otb::MorphologicalProfilesSegmentationFilter::InternalImageType
otb::Image< TInternalPrecision > InternalImageType
Definition: otbMorphologicalProfilesSegmentationFilter.h:76
otbMorphologicalOpeningProfileFilter.h
otb::MorphologicalProfilesSegmentationFilter::InputImageType
TInputImage InputImageType
Definition: otbMorphologicalProfilesSegmentationFilter.h:73
otbImage.h
otbProfileDerivativeToMultiScaleCharacteristicsFilter.h
otb::MorphologicalProfilesSegmentationFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbMorphologicalProfilesSegmentationFilter.h:69
otb::MorphologicalProfilesSegmentationFilter::m_ProfileSize
unsigned int m_ProfileSize
Definition: otbMorphologicalProfilesSegmentationFilter.h:119
otb::MorphologicalProfilesSegmentationFilter::StructuringElementType
TStructuringElement StructuringElementType
Definition: otbMorphologicalProfilesSegmentationFilter.h:78
otb::MorphologicalOpeningProfileFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbMorphologicalOpeningProfileFilter.h:61
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::Image
Creation of an "otb" image which contains metadata.
Definition: otbImage.h:89
otb::ProfileToProfileDerivativeFilter
This filter computes the derivative of a given profile.
Definition: otbProfileToProfileDerivativeFilter.h:47
otb::MorphologicalClosingProfileFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbMorphologicalClosingProfileFilter.h:61
otb::MorphologicalProfilesSegmentationFilter::m_ProfileStep
unsigned int m_ProfileStep
Definition: otbMorphologicalProfilesSegmentationFilter.h:121
otb::ProfileDerivativeToMultiScaleCharacteristicsFilter
This filter extracts the maximum derivative value of the input profile.
Definition: otbProfileDerivativeToMultiScaleCharacteristicsFilter.h:45
otb::MorphologicalOpeningProfileFilter
This filter compute the morphological opening profile.
Definition: otbMorphologicalOpeningProfileFilter.h:52
otb::MorphologicalProfilesSegmentationFilter::OutputImageType
TOutputImage OutputImageType
Definition: otbMorphologicalProfilesSegmentationFilter.h:75
otb::MorphologicalProfilesSegmentationFilter::OpeningProfileFilterType
otb::MorphologicalOpeningProfileFilter< InputImageType, InternalImageType, StructuringElementType > OpeningProfileFilterType
Definition: otbMorphologicalProfilesSegmentationFilter.h:80
otb::MorphologicalProfilesSegmentationFilter::MultiScaleCharacteristicsFilterType
otb::ProfileDerivativeToMultiScaleCharacteristicsFilter< InternalImageType, InternalImageType, OutputImageType > MultiScaleCharacteristicsFilterType
Definition: otbMorphologicalProfilesSegmentationFilter.h:83
otb::ProfileDerivativeToMultiScaleCharacteristicsFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbProfileDerivativeToMultiScaleCharacteristicsFilter.h:51
otb::MorphologicalProfilesSegmentationFilter::m_Sigma
double m_Sigma
Definition: otbMorphologicalProfilesSegmentationFilter.h:122
otb::MorphologicalProfilesSegmentationFilter::m_OpeningDerivativeProfile
DerivativeFilterType::Pointer m_OpeningDerivativeProfile
Definition: otbMorphologicalProfilesSegmentationFilter.h:112
otb::MorphologicalProfilesSegmentationFilter::m_OpeningCharacteristicsFilter
MultiScaleCharacteristicsFilterType::Pointer m_OpeningCharacteristicsFilter
Definition: otbMorphologicalProfilesSegmentationFilter.h:114
otb::MorphologicalProfilesSegmentationFilter
This class implements segmentation by morphological profiles.
Definition: otbMorphologicalProfilesSegmentationFilter.h:62
otb::MorphologicalProfilesSegmentationFilter::m_ClosingCharacteristicsFilter
MultiScaleCharacteristicsFilterType::Pointer m_ClosingCharacteristicsFilter
Definition: otbMorphologicalProfilesSegmentationFilter.h:115
otbMultiScaleConvexOrConcaveClassificationFilter.h
otb::MorphologicalProfilesSegmentationFilter::Self
MorphologicalProfilesSegmentationFilter Self
Definition: otbMorphologicalProfilesSegmentationFilter.h:66
otb::MorphologicalProfilesSegmentationFilter::InputPixelType
InputImageType::PixelType InputPixelType
Definition: otbMorphologicalProfilesSegmentationFilter.h:74
otb::MorphologicalProfilesSegmentationFilter::Superclass
itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
Definition: otbMorphologicalProfilesSegmentationFilter.h:67
otb::MorphologicalProfilesSegmentationFilter::m_ClassificationFilter
MultiScaleClassificationFilterType::Pointer m_ClassificationFilter
Definition: otbMorphologicalProfilesSegmentationFilter.h:116
otb::MorphologicalProfilesSegmentationFilter::m_ClosingDerivativeProfile
DerivativeFilterType::Pointer m_ClosingDerivativeProfile
Definition: otbMorphologicalProfilesSegmentationFilter.h:113
otb::MorphologicalProfilesSegmentationFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbMorphologicalProfilesSegmentationFilter.h:70
otb::MorphologicalProfilesSegmentationFilter::m_ProfileStart
unsigned int m_ProfileStart
Definition: otbMorphologicalProfilesSegmentationFilter.h:120
otb::MorphologicalProfilesSegmentationFilter::DerivativeFilterType
otb::ProfileToProfileDerivativeFilter< InternalImageType, InternalImageType > DerivativeFilterType
Definition: otbMorphologicalProfilesSegmentationFilter.h:82
otbMorphologicalProfilesSegmentationFilter.hxx
otb::MorphologicalProfilesSegmentationFilter::ConnectedComponentsFilterType
itk::ScalarConnectedComponentImageFilter< OutputImageType, OutputImageType > ConnectedComponentsFilterType
Definition: otbMorphologicalProfilesSegmentationFilter.h:85
otb::MorphologicalProfilesSegmentationFilter::MultiScaleClassificationFilterType
otb::MultiScaleConvexOrConcaveClassificationFilter< InternalImageType, OutputImageType > MultiScaleClassificationFilterType
Definition: otbMorphologicalProfilesSegmentationFilter.h:84
otb::MorphologicalProfilesSegmentationFilter::m_ClosingProfile
ClosingProfileFilterType::Pointer m_ClosingProfile
Definition: otbMorphologicalProfilesSegmentationFilter.h:111
otb::MorphologicalClosingProfileFilter
This filter compute the morphological closing profile.
Definition: otbMorphologicalClosingProfileFilter.h:52
otbMorphologicalClosingProfileFilter.h