ITK  6.0.0
Insight Toolkit
itkNeighborhoodConnectedImageFilter.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 itkNeighborhoodConnectedImageFilter_h
19#define itkNeighborhoodConnectedImageFilter_h
20
22
23namespace itk
24{
36template <typename TInputImage, typename TOutputImage>
37class ITK_TEMPLATE_EXPORT NeighborhoodConnectedImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
38{
39public:
40 ITK_DISALLOW_COPY_AND_MOVE(NeighborhoodConnectedImageFilter);
41
47
49 itkNewMacro(Self);
50
52 itkOverrideGetNameOfClassMacro(NeighborhoodConnectedImageFilter);
53
54 using InputImageType = TInputImage;
57 using InputImagePixelType = typename InputImageType::PixelType;
60
61 using OutputImageType = TOutputImage;
64 using OutputImagePixelType = typename OutputImageType::PixelType;
65
66 void
67 PrintSelf(std::ostream & os, Indent indent) const override;
68
70 void
72
74 void
75 SetSeed(const IndexType & seed);
76
78 void
79 AddSeed(const IndexType & seed);
80
82 itkSetMacro(Lower, InputImagePixelType);
83 itkGetConstMacro(Lower, InputImagePixelType);
88 itkSetMacro(Upper, InputImagePixelType);
89 itkGetConstMacro(Upper, InputImagePixelType);
95 itkSetMacro(ReplaceValue, OutputImagePixelType);
96 itkGetConstMacro(ReplaceValue, OutputImagePixelType);
100 itkSetMacro(Radius, InputImageSizeType);
101
103 itkGetConstReferenceMacro(Radius, InputImageSizeType);
104
106 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
107 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
108
109#ifdef ITK_USE_CONCEPT_CHECKING
110 // Begin concept checking
116 // End concept checking
117#endif
118
119protected:
122 std::vector<IndexType> m_Seeds{};
123
126
127 OutputImagePixelType m_ReplaceValue{};
128
130
131 // Override since the filter needs all the data for the algorithm
132 void
134
135 // Override since the filter produces the entire dataset
136 void
138
139 void
140 GenerateData() override;
141};
142} // end namespace itk
143
144#ifndef ITK_MANUAL_INSTANTIATION
145# include "itkNeighborhoodConnectedImageFilter.hxx"
146#endif
147
148#endif
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::Pointer InputImagePointer
typename InputImageType::PixelType InputImagePixelType
typename InputImageType::RegionType InputImageRegionType
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Label pixels that are connected to a seed and lie within a neighborhood.
~NeighborhoodConnectedImageFilter() override=default
void SetSeed(const IndexType &seed)
void PrintSelf(std::ostream &os, Indent indent) const override
void EnlargeOutputRequestedRegion(DataObject *output) override
void AddSeed(const IndexType &seed)
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
SmartPointer< Self > Pointer
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....