OTB  10.0.0
Orfeo Toolbox
otbGeodesicMorphologyDecompositionImageFilter.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 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 
129 
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:
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
A generic functor filter templated by its functor.
itk::SmartPointer< Self > Pointer
This class implements a geodesic morphology based image analysis algorithm.
itk::SubtractImageFilter< OutputImageType, InputImageType, OutputImageType > ConcaveFilterType
itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
itk::OpeningByReconstructionImageFilter< InputImageType, InputImageType, StructuringElementType > OpeningFilterType
itk::SubtractImageFilter< InputImageType, InputImageType, OutputImageType > ConvexFilterType
itk::ClosingByReconstructionImageFilter< InputImageType, InputImageType, StructuringElementType > ClosingFilterType
void PrintSelf(std::ostream &os, itk::Indent indent) const override
otb::GeodesicMorphologyLevelingFilter< InputImageType, OutputImageType, OutputImageType > LevelingFilterType
GeodesicMorphologyDecompositionImageFilter(const Self &)=delete
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.