ITK  6.0.0
Insight Toolkit
itkBinaryFillholeImageFilter.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 itkBinaryFillholeImageFilter_h
19#define itkBinaryFillholeImageFilter_h
20
22
23namespace itk
24{
25
45template <typename TInputImage>
46class ITK_TEMPLATE_EXPORT BinaryFillholeImageFilter : public ImageToImageFilter<TInputImage, TInputImage>
47{
48public:
49 ITK_DISALLOW_COPY_AND_MOVE(BinaryFillholeImageFilter);
50
56
58 using InputImageType = TInputImage;
59 using OutputImageType = TInputImage;
63 using InputImagePixelType = typename InputImageType::PixelType;
67 using OutputImagePixelType = typename OutputImageType::PixelType;
68
70 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
71 static constexpr unsigned int OutputImageDimension = OutputImageType::ImageDimension;
72
74 itkNewMacro(Self);
75
77 itkOverrideGetNameOfClassMacro(BinaryFillholeImageFilter);
78
85 itkSetMacro(FullyConnected, bool);
86 itkGetConstReferenceMacro(FullyConnected, bool);
87 itkBooleanMacro(FullyConnected);
90#ifdef ITK_USE_CONCEPT_CHECKING
91 // Begin concept checking
93 // End concept checking
94#endif
95
98 itkSetMacro(ForegroundValue, InputImagePixelType);
99
102 itkGetMacro(ForegroundValue, InputImagePixelType);
103
104protected:
106 ~BinaryFillholeImageFilter() override = default;
107 void
108 PrintSelf(std::ostream & os, Indent indent) const override;
109
113 void
115
117 void
118 EnlargeOutputRequestedRegion(DataObject * itkNotUsed(output)) override;
119
122 void
123 GenerateData() override;
124
125private:
126 InputImagePixelType m_ForegroundValue{};
127
128 bool m_FullyConnected{};
129
130}; // end of class
131
132} // end namespace itk
133
134#ifndef ITK_MANUAL_INSTANTIATION
135# include "itkBinaryFillholeImageFilter.hxx"
136#endif
137
138#endif
Remove holes not connected to the boundary of the image.
typename OutputImageType::Pointer OutputImagePointer
void EnlargeOutputRequestedRegion(DataObject *) override
typename InputImageType::Pointer InputImagePointer
typename OutputImageType::RegionType OutputImageRegionType
typename OutputImageType::ConstPointer OutputImageConstPointer
typename InputImageType::RegionType InputImageRegionType
typename InputImageType::ConstPointer InputImageConstPointer
typename OutputImageType::PixelType OutputImagePixelType
typename InputImageType::PixelType InputImagePixelType
~BinaryFillholeImageFilter() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
void GenerateInputRequestedRegion() override
Base class for all data objects in ITK.
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....