OTB  9.0.0
Orfeo Toolbox
otbLabelizeNeighborhoodConnectedImageFilter.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 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:
112  LabelizeNeighborhoodConnectedImageFilter(const Self&) = delete;
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
otb::LabelizeNeighborhoodConnectedImageFilter::IndexType
TInputImage::IndexType IndexType
Definition: otbLabelizeNeighborhoodConnectedImageFilter.h:59
otbLabelizeNeighborhoodConnectedImageFilter.hxx
otb::LabelizeNeighborhoodConnectedImageFilter::m_ReplaceValue
OutputPixelType m_ReplaceValue
Definition: otbLabelizeNeighborhoodConnectedImageFilter.h:122
otb::LabelizeNeighborhoodConnectedImageFilter::GetRadius
const InputSizeType & GetRadius() const
Definition: otbLabelizeNeighborhoodConnectedImageFilter.h:88
otb::LabelizeNeighborhoodConnectedImageFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbLabelizeNeighborhoodConnectedImageFilter.h:51
otb::LabelizeNeighborhoodConnectedImageFilter
Labels pixels that are connected to a seed and lie within a neighborhood.
Definition: otbLabelizeNeighborhoodConnectedImageFilter.h:43
otb::LabelizeNeighborhoodConnectedImageFilter::Self
LabelizeNeighborhoodConnectedImageFilter Self
Definition: otbLabelizeNeighborhoodConnectedImageFilter.h:48
otb::LabelizeNeighborhoodConnectedImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbLabelizeNeighborhoodConnectedImageFilter.h:50
otb::LabelizeNeighborhoodConnectedImageFilter::Superclass
otb::LabelizeImageFilterBase< TInputImage, TOutputImage, itk::NeighborhoodConnectedImageFilter< TInputImage, TOutputImage > > Superclass
Definition: otbLabelizeNeighborhoodConnectedImageFilter.h:49
otb::LabelizeNeighborhoodConnectedImageFilter::m_LowerThresholdDelta
InputPixelType m_LowerThresholdDelta
Definition: otbLabelizeNeighborhoodConnectedImageFilter.h:119
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::LabelizeNeighborhoodConnectedImageFilter::m_UpperThresholdDelta
InputPixelType m_UpperThresholdDelta
Definition: otbLabelizeNeighborhoodConnectedImageFilter.h:116
otb::LabelizeNeighborhoodConnectedImageFilter::~LabelizeNeighborhoodConnectedImageFilter
~LabelizeNeighborhoodConnectedImageFilter() override
Definition: otbLabelizeNeighborhoodConnectedImageFilter.h:103
otbLabelizeImageFilterBase.h
otb::LabelizeNeighborhoodConnectedImageFilter::OutputImageType
TOutputImage OutputImageType
Definition: otbLabelizeNeighborhoodConnectedImageFilter.h:55
otb::LabelizeNeighborhoodConnectedImageFilter::InputImageType
TInputImage InputImageType
Definition: otbLabelizeNeighborhoodConnectedImageFilter.h:54
otb::LabelizeNeighborhoodConnectedImageFilter::InputSizeType
TInputImage::SizeType InputSizeType
Definition: otbLabelizeNeighborhoodConnectedImageFilter.h:58
otb::LabelizeNeighborhoodConnectedImageFilter::InputPixelType
TInputImage::PixelType InputPixelType
Definition: otbLabelizeNeighborhoodConnectedImageFilter.h:57
otb::LabelizeNeighborhoodConnectedImageFilter::SetRadius
void SetRadius(const InputSizeType radius)
Definition: otbLabelizeNeighborhoodConnectedImageFilter.h:94
otb::LabelizeImageFilterBase
Base class for filter labelizing image region based on segmentation.
Definition: otbLabelizeImageFilterBase.h:39
otb::LabelizeNeighborhoodConnectedImageFilter::OutputPixelType
TOutputImage::PixelType OutputPixelType
Definition: otbLabelizeNeighborhoodConnectedImageFilter.h:61