OTB  10.0.0
Orfeo Toolbox
otbMorphologicalProfilesSegmentationFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 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 
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:
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
A generic functor filter templated by its functor.
itk::SmartPointer< Self > Pointer
Creation of an "otb" image which contains metadata.
Definition: otbImage.h:92
This filter compute the morphological closing profile.
This filter compute the morphological opening profile.
This class implements segmentation by morphological profiles.
MultiScaleCharacteristicsFilterType::Pointer m_OpeningCharacteristicsFilter
MultiScaleClassificationFilterType::Pointer m_ClassificationFilter
otb::ProfileDerivativeToMultiScaleCharacteristicsFilter< InternalImageType, InternalImageType, OutputImageType > MultiScaleCharacteristicsFilterType
itk::ScalarConnectedComponentImageFilter< OutputImageType, OutputImageType > ConnectedComponentsFilterType
otb::ProfileToProfileDerivativeFilter< InternalImageType, InternalImageType > DerivativeFilterType
otb::MorphologicalOpeningProfileFilter< InputImageType, InternalImageType, StructuringElementType > OpeningProfileFilterType
itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
MultiScaleCharacteristicsFilterType::Pointer m_ClosingCharacteristicsFilter
otb::MorphologicalClosingProfileFilter< InputImageType, InternalImageType, StructuringElementType > ClosingProfileFilterType
otb::MultiScaleConvexOrConcaveClassificationFilter< InternalImageType, OutputImageType > MultiScaleClassificationFilterType
This filter extracts the maximum derivative value of the input profile.
This filter computes the derivative of a given profile.
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.