ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkConnectedThresholdImageFilter.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkConnectedThresholdImageFilter_h
19#define itkConnectedThresholdImageFilter_h
20
23#include "ITKRegionGrowingExport.h"
24
25namespace itk
26{
33{
34public:
43 enum class Connectivity : uint8_t
44 {
47 };
48};
49
50// Define how to print enumeration
51extern ITKRegionGrowing_EXPORT std::ostream &
67template <typename TInputImage, typename TOutputImage>
68class ITK_TEMPLATE_EXPORT ConnectedThresholdImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
69{
70public:
71 ITK_DISALLOW_COPY_AND_MOVE(ConnectedThresholdImageFilter);
72
78
80 itkNewMacro(Self);
81
83 itkOverrideGetNameOfClassMacro(ConnectedThresholdImageFilter);
84
85 using InputImageType = TInputImage;
86 using InputImagePointer = typename InputImageType::Pointer;
87 using InputImageConstPointer = typename InputImageType::ConstPointer;
88 using InputImageRegionType = typename InputImageType::RegionType;
89 using InputImagePixelType = typename InputImageType::PixelType;
90 using IndexType = typename InputImageType::IndexType;
91 using SeedContainerType = typename std::vector<IndexType>;
92 using SizeType = typename InputImageType::SizeType;
93
94 using OutputImageType = TOutputImage;
95 using OutputImagePointer = typename OutputImageType::Pointer;
96 using OutputImageRegionType = typename OutputImageType::RegionType;
97 using OutputImagePixelType = typename OutputImageType::PixelType;
98
99 void
100 PrintSelf(std::ostream & os, Indent indent) const override;
101
103 void
104 SetSeed(const IndexType & seed);
105
106 void
107 AddSeed(const IndexType & seed);
108
110 void
112
114 virtual const SeedContainerType &
115 GetSeeds() const;
116
120 itkSetMacro(ReplaceValue, OutputImagePixelType);
121 itkGetConstMacro(ReplaceValue, OutputImagePixelType);
123
126
131
133 virtual void
135 virtual void
138
140 virtual InputImagePixelType
141 GetUpper() const;
142 virtual InputImagePixelType
143 GetLower() const;
145
147 virtual InputPixelObjectType *
149 virtual InputPixelObjectType *
152
154 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
155 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
156
163
165#if !defined(ITK_LEGACY_REMOVE)
166 using ConnectivityEnumType = ConnectedThresholdImageFilterEnums::Connectivity;
168 static constexpr ConnectedThresholdImageFilterEnums::Connectivity FaceConnectivity =
170 static constexpr ConnectedThresholdImageFilterEnums::Connectivity FullConnectivity =
172#endif
173
179
180protected:
182 ~ConnectedThresholdImageFilter() override = default;
183
184 // Override since the filter needs all the data for the algorithm.
185 void
187
188 // Override since the filter produces the entire dataset.
189 void
191
192 void
193 GenerateData() override;
194
195private:
197
199
201};
202} // end namespace itk
203
204#ifndef ITK_MANUAL_INSTANTIATION
205# include "itkConnectedThresholdImageFilter.hxx"
206#endif
207
208#endif
Contains all the enum classes used by the ConnectedThresholdImageFilter class.
ConnectedThresholdImageFilterEnums::Connectivity m_Connectivity
ConnectedThresholdImageFilterEnums::Connectivity ConnectivityEnum
typename OutputImageType::Pointer OutputImagePointer
typename InputImageType::RegionType InputImageRegionType
typename InputImageType::Pointer InputImagePointer
virtual void SetLower(InputImagePixelType)
typename OutputImageType::RegionType OutputImageRegionType
virtual void SetLowerInput(const InputPixelObjectType *)
virtual void SetUpper(InputImagePixelType)
void AddSeed(const IndexType &seed)
void SetSeed(const IndexType &seed)
void GenerateInputRequestedRegion() override
typename std::vector< IndexType > SeedContainerType
virtual const SeedContainerType & GetSeeds() const
virtual InputPixelObjectType * GetUpperInput()
SimpleDataObjectDecorator< InputImagePixelType > InputPixelObjectType
typename InputImageType::IndexType IndexType
~ConnectedThresholdImageFilter() override=default
virtual void SetUpperInput(const InputPixelObjectType *)
virtual InputImagePixelType GetLower() const
typename OutputImageType::PixelType OutputImagePixelType
virtual InputImagePixelType GetUpper() const
void PrintSelf(std::ostream &os, Indent indent) const override
ImageToImageFilter< TInputImage, TOutputImage > Superclass
typename InputImageType::PixelType InputImagePixelType
virtual InputPixelObjectType * GetLowerInput()
typename InputImageType::ConstPointer InputImageConstPointer
void EnlargeOutputRequestedRegion(DataObject *output) override
Base class for all data objects in ITK.
Control indentation during Print() invocation.
Definition itkIndent.h:50
Decorates any "simple" data type (data types without smart pointers) with a DataObject API.
Implements transparent reference counting.
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)