ITK  6.0.0
Insight Toolkit
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 {
45 FaceConnectivity,
46 FullConnectivity
47 };
48};
49
50// Define how to print enumeration
51extern ITKRegionGrowing_EXPORT std::ostream &
52 operator<<(std::ostream & out, const ConnectedThresholdImageFilterEnums::Connectivity value);
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;
89 using InputImagePixelType = typename InputImageType::PixelType;
91 using SeedContainerType = typename std::vector<IndexType>;
93
94 using OutputImageType = TOutputImage;
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);
126
133 virtual void
135 virtual void
140 virtual InputImagePixelType
141 GetUpper() const;
142 virtual InputImagePixelType
143 GetLower() const;
147 virtual InputPixelObjectType *
149 virtual InputPixelObjectType *
154 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
155 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
156
157#ifdef ITK_USE_CONCEPT_CHECKING
158 // Begin concept checking
165 // End concept checking
166#endif
167
169#if !defined(ITK_LEGACY_REMOVE)
170 using ConnectivityEnumType = ConnectedThresholdImageFilterEnums::Connectivity;
172 static constexpr ConnectedThresholdImageFilterEnums::Connectivity FaceConnectivity =
174 static constexpr ConnectedThresholdImageFilterEnums::Connectivity FullConnectivity =
176#endif
177
184protected:
186 ~ConnectedThresholdImageFilter() override = default;
187
188 // Override since the filter needs all the data for the algorithm.
189 void
191
192 // Override since the filter produces the entire dataset.
193 void
195
196 void
197 GenerateData() override;
198
199private:
201
202 OutputImagePixelType m_ReplaceValue{};
203
204 ConnectedThresholdImageFilterEnums::Connectivity m_Connectivity{ ConnectivityEnum::FaceConnectivity };
205};
206} // end namespace itk
207
208#ifndef ITK_MANUAL_INSTANTIATION
209# include "itkConnectedThresholdImageFilter.hxx"
210#endif
211
212#endif
Contains all the enum classes used by the ConnectedThresholdImageFilter class.
Label pixels that are connected to a seed and lie within a range of values.
virtual void SetLower(InputImagePixelType)
virtual void SetLowerInput(const InputPixelObjectType *)
typename InputImageType::SizeType SizeType
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()
typename InputImageType::IndexType IndexType
~ConnectedThresholdImageFilter() override=default
virtual void SetUpperInput(const InputPixelObjectType *)
virtual InputImagePixelType GetLower() const
virtual InputImagePixelType GetUpper() const
void PrintSelf(std::ostream &os, Indent indent) const override
virtual InputPixelObjectType * GetLowerInput()
void EnlargeOutputRequestedRegion(DataObject *output) override
Base class for all data objects in ITK.
Base class for all process objects that output image data.
typename OutputImageType::PixelType OutputImagePixelType
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
typename OutputImageType::Pointer OutputImagePointer
Base class for filters that take an image as input and produce an image as output.
typename InputImageType::ConstPointer InputImageConstPointer
typename InputImageType::Pointer InputImagePointer
typename InputImageType::PixelType InputImagePixelType
typename InputImageType::RegionType InputImageRegionType
Control indentation during Print() invocation.
Definition: itkIndent.h:50
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Decorates any "simple" data type (data types without smart pointers) with a DataObject API.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
#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)