OTB  9.0.0
Orfeo Toolbox
otbLabelizeImageFilterBase.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 otbLabelizeImageFilterBase_h
22 #define otbLabelizeImageFilterBase_h
23 
24 #include "itkImageToImageFilter.h"
25 #include "itkAddImageFilter.h"
26 
29 
30 namespace otb
31 {
38 template <class TInputImage, class TOutputImage, class TFilter>
39 class ITK_EXPORT LabelizeImageFilterBase : public itk::ImageToImageFilter<TInputImage, TOutputImage>
40 {
41 public:
44  typedef itk::ImageToImageFilter<TInputImage, TOutputImage> Superclass;
45  typedef itk::SmartPointer<Self> Pointer;
46  typedef itk::SmartPointer<const Self> ConstPointer;
47 
49  typedef TInputImage InputImageType;
50  typedef TOutputImage OutputImageType;
51 
52  typedef typename TInputImage::PixelType InputPixelType;
53  typedef typename TOutputImage::PixelType OutputPixelType;
54 
55  typedef typename TInputImage::IndexType IndexType;
56 
57  typedef itk::PointSet<InputPixelType, 2> PointSetType;
58  typedef typename PointSetType::Pointer PointSetPointerType;
59 
60  typedef TFilter RegionGrowingFilterType;
61  typedef typename TFilter::Pointer RegionGrowingFilterPointerType;
62 
64  itkNewMacro(Self);
65 
67  itkTypeMacro(LabelizeImageFilterBase, ImageToImageFilter);
68 
70  itkGetMacro(LowerThreshold, InputPixelType);
71 
73  itkSetMacro(LowerThreshold, InputPixelType);
74 
76  itkGetMacro(UpperThreshold, InputPixelType);
77 
79  itkSetMacro(UpperThreshold, InputPixelType);
80 
82  // only set after completion
83  // itkGetConstReferenceMacro(ObjectCount, unsigned long);
84  itkGetMacro(ObjectCount, unsigned long);
86 
90 
93 
94  typedef itk::AddImageFilter<OutputImageType, OutputImageType, OutputImageType> AddImageFilterType;
95  typedef typename AddImageFilterType::Pointer AddImageFilterPointerType;
96 
97 protected:
100  {
101  }
102  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
103 
105  void GenerateData() override;
106 
108  virtual void RegionGrowing(const IndexType itkNotUsed(indexSeed))
109  {
110  }
111 
114 
117 
120 
123 
126 
129 
131  unsigned long m_ObjectCount;
132 
133 private:
134  LabelizeImageFilterBase(const Self&) = delete;
135  void operator=(const Self&) = delete;
136 
137 }; // end class LabelizeImageFilterBase
138 
139 } // end namespace otb
140 
141 #ifndef OTB_MANUAL_INSTANTIATION
143 #endif
144 
145 #endif
otbMultiplyByScalarImageFilter.h
otb::LabelizeImageFilterBase::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbLabelizeImageFilterBase.h:46
otb::LabelizeImageFilterBase::InputImageType
TInputImage InputImageType
Definition: otbLabelizeImageFilterBase.h:49
otb::LabelizeImageFilterBase::m_RegionGrowingFilter
RegionGrowingFilterPointerType m_RegionGrowingFilter
Definition: otbLabelizeImageFilterBase.h:113
otb::LabelizeImageFilterBase::MultiplyFilterPointerType
MultiplyFilterType::Pointer MultiplyFilterPointerType
Definition: otbLabelizeImageFilterBase.h:92
otb::LabelizeImageFilterBase::m_ThresholdPointSetFilter
ThresholdFilterPointerType m_ThresholdPointSetFilter
Definition: otbLabelizeImageFilterBase.h:128
otb::LabelizeImageFilterBase::AddImageFilterPointerType
AddImageFilterType::Pointer AddImageFilterPointerType
Definition: otbLabelizeImageFilterBase.h:95
otb::LabelizeImageFilterBase::ThresholdFilterPointerType
ThresholdFilterType::Pointer ThresholdFilterPointerType
Definition: otbLabelizeImageFilterBase.h:89
otb::LabelizeImageFilterBase::m_LowerThreshold
InputPixelType m_LowerThreshold
Definition: otbLabelizeImageFilterBase.h:116
otb::LabelizeImageFilterBase::PointSetPointerType
PointSetType::Pointer PointSetPointerType
Definition: otbLabelizeImageFilterBase.h:58
otb::LabelizeImageFilterBase::Self
LabelizeImageFilterBase Self
Definition: otbLabelizeImageFilterBase.h:43
otb::LabelizeImageFilterBase::OutputPixelType
TOutputImage::PixelType OutputPixelType
Definition: otbLabelizeImageFilterBase.h:53
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::LabelizeImageFilterBase::m_ObjectCount
unsigned long m_ObjectCount
Definition: otbLabelizeImageFilterBase.h:131
otb::LabelizeImageFilterBase::MultiplyFilterType
otb::MultiplyByScalarImageFilter< InputImageType, OutputImageType > MultiplyFilterType
Definition: otbLabelizeImageFilterBase.h:91
otb::LabelizeImageFilterBase::m_UpperThreshold
InputPixelType m_UpperThreshold
Definition: otbLabelizeImageFilterBase.h:119
otb::LabelizeImageFilterBase::ThresholdFilterType
otb::ThresholdImageToPointSetFilter< InputImageType, PointSetType > ThresholdFilterType
Definition: otbLabelizeImageFilterBase.h:84
otb::MultiplyByScalarImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbMultiplyByScalarImageFilter.h:83
otb::LabelizeImageFilterBase::AddImageFilterType
itk::AddImageFilter< OutputImageType, OutputImageType, OutputImageType > AddImageFilterType
Definition: otbLabelizeImageFilterBase.h:94
otb::ThresholdImageToPointSetFilter
Produce a PointSet according to filtering conditions.
Definition: otbThresholdImageToPointSetFilter.h:39
otb::ThresholdImageToPointSetFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbThresholdImageToPointSetFilter.h:49
otb::LabelizeImageFilterBase::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbLabelizeImageFilterBase.h:45
otb::LabelizeImageFilterBase::IndexType
TInputImage::IndexType IndexType
Definition: otbLabelizeImageFilterBase.h:55
otb::MultiplyByScalarImageFilter
TODO.
Definition: otbMultiplyByScalarImageFilter.h:73
otb::LabelizeImageFilterBase::Superclass
itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
Definition: otbLabelizeImageFilterBase.h:44
otb::LabelizeImageFilterBase::RegionGrowingFilterPointerType
TFilter::Pointer RegionGrowingFilterPointerType
Definition: otbLabelizeImageFilterBase.h:61
otb::LabelizeImageFilterBase::m_MultiplyFilter
MultiplyFilterPointerType m_MultiplyFilter
Definition: otbLabelizeImageFilterBase.h:125
otb::LabelizeImageFilterBase::RegionGrowingFilterType
TFilter RegionGrowingFilterType
Definition: otbLabelizeImageFilterBase.h:60
otb::LabelizeImageFilterBase::InputPixelType
TInputImage::PixelType InputPixelType
Definition: otbLabelizeImageFilterBase.h:52
otb::LabelizeImageFilterBase::m_PointSet
PointSetPointerType m_PointSet
Definition: otbLabelizeImageFilterBase.h:122
otb::LabelizeImageFilterBase::PointSetType
itk::PointSet< InputPixelType, 2 > PointSetType
Definition: otbLabelizeImageFilterBase.h:57
otb::LabelizeImageFilterBase::RegionGrowing
virtual void RegionGrowing(const IndexType)
Definition: otbLabelizeImageFilterBase.h:108
otb::LabelizeImageFilterBase
Base class for filter labelizing image region based on segmentation.
Definition: otbLabelizeImageFilterBase.h:39
otbLabelizeImageFilterBase.hxx
otbThresholdImageToPointSetFilter.h
otb::LabelizeImageFilterBase::~LabelizeImageFilterBase
~LabelizeImageFilterBase() override
Definition: otbLabelizeImageFilterBase.h:99
otb::LabelizeImageFilterBase::OutputImageType
TOutputImage OutputImageType
Definition: otbLabelizeImageFilterBase.h:50