OTB  10.0.0
Orfeo Toolbox
otbLabelizeNeighborhoodConnectedImageFilter.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 otbLabelizeNeighborhoodConnectedImageFilter_h
22 #define otbLabelizeNeighborhoodConnectedImageFilter_h
23 
24 #include "itkNeighborhoodConnectedImageFilter.h"
26 
27 namespace otb
28 {
29 
42 template <class TInputImage, class TOutputImage>
44  : public otb::LabelizeImageFilterBase<TInputImage, TOutputImage, itk::NeighborhoodConnectedImageFilter<TInputImage, TOutputImage>>
45 {
46 public:
50  typedef itk::SmartPointer<Self> Pointer;
51  typedef itk::SmartPointer<const Self> ConstPointer;
52 
54  typedef TInputImage InputImageType;
55  typedef TOutputImage OutputImageType;
56 
57  typedef typename TInputImage::PixelType InputPixelType;
58  typedef typename TInputImage::SizeType InputSizeType;
59  typedef typename TInputImage::IndexType IndexType;
60 
61  typedef typename TOutputImage::PixelType OutputPixelType;
62 
64  itkNewMacro(Self);
65 
68 
70  itkGetMacro(LowerThresholdDelta, InputPixelType);
71 
73  itkSetMacro(LowerThresholdDelta, InputPixelType);
74 
76  itkGetMacro(UpperThresholdDelta, InputPixelType);
77 
79  itkSetMacro(UpperThresholdDelta, InputPixelType);
80 
82  itkGetMacro(ReplaceValue, OutputPixelType);
83 
85  itkSetMacro(ReplaceValue, OutputPixelType);
86 
88  const InputSizeType& GetRadius() const
89  {
90  return this->m_RegionGrowingFilter->GetRadius();
91  }
92 
94  void SetRadius(const InputSizeType radius)
95  {
96  this->m_RegionGrowingFilter->SetRadius(radius);
97  this->Modified();
98  }
100 
101 protected:
104  {
105  }
106  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
107 
109  void RegionGrowing(const IndexType indexSeed) override;
110 
111 private:
113  void operator=(const Self&) = delete;
114 
117 
120 
123 
124 }; // end class LabelizeconnectedThresholdImageFilter
125 
126 } // end namespace otb
127 
128 #ifndef OTB_MANUAL_INSTANTIATION
130 #endif
131 
132 #endif
Base class for filter labelizing image region based on segmentation.
Labels pixels that are connected to a seed and lie within a neighborhood.
otb::LabelizeImageFilterBase< TInputImage, TOutputImage, itk::NeighborhoodConnectedImageFilter< TInputImage, TOutputImage > > Superclass
LabelizeNeighborhoodConnectedImageFilter(const Self &)=delete
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.