OTB  9.0.0
Orfeo Toolbox
otbGeodesicMorphologyDecompositionImageFilter.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 otbGeodesicMorphologyDecompositionImageFilter_h
22 #define otbGeodesicMorphologyDecompositionImageFilter_h
23 
25 #include "itkSubtractImageFilter.h"
26 #include "itkOpeningByReconstructionImageFilter.h"
27 #include "itkClosingByReconstructionImageFilter.h"
28 #include "otbMacro.h"
29 
30 namespace otb
31 {
84 template <class TInputImage, class TOutputImage, class TStructuringElement>
85 class ITK_EXPORT GeodesicMorphologyDecompositionImageFilter : public itk::ImageToImageFilter<TInputImage, TOutputImage>
86 {
87 public:
90  typedef itk::ImageToImageFilter<TInputImage, TOutputImage> Superclass;
91  typedef itk::SmartPointer<Self> Pointer;
92  typedef itk::SmartPointer<const Self> ConstPointer;
93 
95  itkNewMacro(Self);
96 
98  itkTypeMacro(GeodesicMorphologyDecompositionImageFilter, ImageToImageFilter);
99 
101  typedef TInputImage InputImageType;
102  typedef TOutputImage OutputImageType;
103 
104  typedef TStructuringElement StructuringElementType;
105  typedef typename StructuringElementType::RadiusType RadiusType;
106  typedef itk::OpeningByReconstructionImageFilter<InputImageType, InputImageType, StructuringElementType> OpeningFilterType;
107  typedef itk::ClosingByReconstructionImageFilter<InputImageType, InputImageType, StructuringElementType> ClosingFilterType;
108  typedef itk::SubtractImageFilter<InputImageType, InputImageType, OutputImageType> ConvexFilterType;
109  typedef itk::SubtractImageFilter<OutputImageType, InputImageType, OutputImageType> ConcaveFilterType;
111 
113  typedef typename OpeningFilterType::Pointer OpeningFilterPointerType;
114  typedef typename ClosingFilterType::Pointer ClosingFilterPointerType;
116  typedef typename ConvexFilterType::Pointer ConvexFilterPointerType;
117  typedef typename ConcaveFilterType::Pointer ConcaveFilterPointerType;
118 
120  itkSetMacro(Radius, RadiusType);
121  itkGetConstReferenceMacro(Radius, RadiusType);
123 
128  OutputImageType* GetConvexMap(void);
129 
134  OutputImageType* GetConcaveMap(void);
135 
137  itkSetMacro(FullyConnected, bool);
138  itkGetMacro(FullyConnected, bool);
139 
141  itkSetMacro(PreserveIntensities, bool);
142  itkGetMacro(PreserveIntensities, bool);
144 
145 protected:
147  void GenerateData(void) override;
148 
151 
154  {
155  }
156 
158  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
159 
160 private:
161  GeodesicMorphologyDecompositionImageFilter(const Self&) = delete;
162  void operator=(const Self&) = delete;
163 
166 
169 
172 
175 
178 
181 
184 
187 
189  itk::ProgressAccumulator::Pointer m_Progress;
190 };
191 } // End namespace otb
192 #ifndef OTB_MANUAL_INSTANTIATION
194 #endif
195 
196 #endif
otb::GeodesicMorphologyDecompositionImageFilter::OpeningFilterPointerType
OpeningFilterType::Pointer OpeningFilterPointerType
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:113
otb::GeodesicMorphologyDecompositionImageFilter::m_ClosingFilter
ClosingFilterPointerType m_ClosingFilter
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:171
otb::GeodesicMorphologyDecompositionImageFilter::m_ConcaveFilter
ConcaveFilterPointerType m_ConcaveFilter
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:177
otb::GeodesicMorphologyDecompositionImageFilter::ConcaveFilterType
itk::SubtractImageFilter< OutputImageType, InputImageType, OutputImageType > ConcaveFilterType
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:109
otb::GeodesicMorphologyDecompositionImageFilter::ClosingFilterPointerType
ClosingFilterType::Pointer ClosingFilterPointerType
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:114
otb::GeodesicMorphologyDecompositionImageFilter::m_Progress
itk::ProgressAccumulator::Pointer m_Progress
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:189
otb::GeodesicMorphologyDecompositionImageFilter::ClosingFilterType
itk::ClosingByReconstructionImageFilter< InputImageType, InputImageType, StructuringElementType > ClosingFilterType
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:107
otb::FunctorImageFilter
A generic functor filter templated by its functor.
Definition: otbFunctorImageFilter.h:322
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::GeodesicMorphologyDecompositionImageFilter::m_PreserveIntensities
bool m_PreserveIntensities
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:183
otb::FunctorImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbFunctorImageFilter.h:329
otb::GeodesicMorphologyDecompositionImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:91
otb::GeodesicMorphologyDecompositionImageFilter::InputImageType
TInputImage InputImageType
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:98
otb::GeodesicMorphologyDecompositionImageFilter::StructuringElementType
TStructuringElement StructuringElementType
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:104
otbMacro.h
otb::GeodesicMorphologyDecompositionImageFilter::m_LevelingFilter
LevelingFilterPointerType m_LevelingFilter
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:180
otb::GeodesicMorphologyDecompositionImageFilter::ConvexFilterPointerType
ConvexFilterType::Pointer ConvexFilterPointerType
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:116
otb::GeodesicMorphologyDecompositionImageFilter::LevelingFilterType
otb::GeodesicMorphologyLevelingFilter< InputImageType, OutputImageType, OutputImageType > LevelingFilterType
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:110
otb::GeodesicMorphologyDecompositionImageFilter::~GeodesicMorphologyDecompositionImageFilter
~GeodesicMorphologyDecompositionImageFilter() override
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:153
otb::GeodesicMorphologyDecompositionImageFilter::Superclass
itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:90
otb::GeodesicMorphologyDecompositionImageFilter::LevelingFilterPointerType
LevelingFilterType::Pointer LevelingFilterPointerType
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:115
otb::GeodesicMorphologyDecompositionImageFilter::Self
GeodesicMorphologyDecompositionImageFilter Self
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:89
otb::GeodesicMorphologyDecompositionImageFilter::m_OpeningFilter
OpeningFilterPointerType m_OpeningFilter
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:168
otb::GeodesicMorphologyDecompositionImageFilter::ConvexFilterType
itk::SubtractImageFilter< InputImageType, InputImageType, OutputImageType > ConvexFilterType
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:108
otb::GeodesicMorphologyDecompositionImageFilter::OpeningFilterType
itk::OpeningByReconstructionImageFilter< InputImageType, InputImageType, StructuringElementType > OpeningFilterType
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:106
otbGeodesicMorphologyLevelingFilter.h
otb::GeodesicMorphologyDecompositionImageFilter::RadiusType
StructuringElementType::RadiusType RadiusType
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:105
otbGeodesicMorphologyDecompositionImageFilter.hxx
otb::GeodesicMorphologyDecompositionImageFilter::OutputImageType
TOutputImage OutputImageType
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:102
otb::GeodesicMorphologyDecompositionImageFilter::m_Radius
RadiusType m_Radius
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:165
otb::GeodesicMorphologyDecompositionImageFilter::ConcaveFilterPointerType
ConcaveFilterType::Pointer ConcaveFilterPointerType
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:117
otb::GeodesicMorphologyDecompositionImageFilter::m_ConvexFilter
ConvexFilterPointerType m_ConvexFilter
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:174
otb::GeodesicMorphologyDecompositionImageFilter::m_FullyConnected
bool m_FullyConnected
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:186
otb::GeodesicMorphologyDecompositionImageFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:92
otb::GeodesicMorphologyDecompositionImageFilter
This class implements a geodesic morphology based image analysis algorithm.
Definition: otbGeodesicMorphologyDecompositionImageFilter.h:85