ITK  6.0.0
Insight Toolkit
itkBinaryContourImageFilter.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 itkBinaryContourImageFilter_h
19#define itkBinaryContourImageFilter_h
20
23#include <vector>
24
25namespace itk
26{
52template <typename TInputImage, typename TOutputImage>
53class ITK_TEMPLATE_EXPORT BinaryContourImageFilter
54 : public InPlaceImageFilter<TInputImage, TOutputImage>
55 , protected ScanlineFilterCommon<TInputImage, TOutputImage>
56{
57public:
58 ITK_DISALLOW_COPY_AND_MOVE(BinaryContourImageFilter);
59
67 using Superclass::Register;
68 using Superclass::UnRegister;
69
73 itkOverrideGetNameOfClassMacro(BinaryContourImageFilter);
74
78 itkNewMacro(Self);
79
83 using InputImageType = TInputImage;
88 using OffsetType = typename InputImageType::OffsetType;
89 using InputImagePixelType = typename InputImageType::PixelType;
90 using InputInternalPixelType = typename InputImageType::InternalPixelType;
92 using OutputImageType = TOutputImage;
97 using OutputOffsetType = typename OutputImageType::OffsetType;
98 using OutputImagePixelType = typename OutputImageType::PixelType;
99 using OutputInternalPixelType = typename OutputImageType::InternalPixelType;
100
101 static constexpr unsigned int ImageDimension = OutputImageType::ImageDimension;
108 itkSetMacro(FullyConnected, bool);
109 itkGetConstReferenceMacro(FullyConnected, bool);
110 itkBooleanMacro(FullyConnected);
117 itkSetMacro(BackgroundValue, OutputImagePixelType);
118 itkGetConstMacro(BackgroundValue, OutputImagePixelType);
125 itkSetMacro(ForegroundValue, InputImagePixelType);
126 itkGetConstMacro(ForegroundValue, InputImagePixelType);
129protected:
131 ~BinaryContourImageFilter() override = default;
133 void
134 PrintSelf(std::ostream & os, Indent indent) const override;
136 void
137 GenerateData() override;
139 void
140 BeforeThreadedGenerateData() override;
142 void
143 AfterThreadedGenerateData() override;
145 void
146 DynamicThreadedGenerateData(const RegionType & outputRegionForThread) override;
148 void
149 ThreadedIntegrateData(const RegionType & outputRegionForThread);
150
154 void
155 GenerateInputRequestedRegion() override;
156
161 void
162 EnlargeOutputRequestedRegion(DataObject * itkNotUsed(output)) override;
163
178private:
179 LineMapType m_ForegroundLineMap{};
180 LineMapType m_BackgroundLineMap{};
182 InputImagePixelType m_ForegroundValue{};
183 OutputImagePixelType m_BackgroundValue{};
184};
185} // end namespace itk
186
187#ifndef ITK_MANUAL_INSTANTIATION
188# include "itkBinaryContourImageFilter.hxx"
189#endif
190
191#endif
Labels the pixels on the border of the objects in a binary image.
typename OutputImageType::SizeType OutputSizeType
typename ScanlineFunctions::LineEncodingType LineEncodingType
typename InputImageType::SizeType SizeType
typename ScanlineFunctions::LineEncodingConstIterator LineEncodingConstIterator
typename ScanlineFunctions::ConsecutiveVectorType ConsecutiveVectorType
typename OutputImageType::RegionType RegionType
typename ScanlineFunctions::LineMapType LineMapType
typename ScanlineFunctions::UnionFindType UnionFindType
typename InputImageType::OffsetType OffsetType
typename OutputImageType::InternalPixelType OutputInternalPixelType
typename InputImageType::IndexType IndexType
typename ScanlineFunctions::OutSizeType OutSizeType
typename InputImageType::InternalPixelType InputInternalPixelType
typename ScanlineFunctions::LineEncodingIterator LineEncodingIterator
typename OutputImageType::IndexType OutputIndexType
typename OutputImageType::OffsetType OutputOffsetType
typename ScanlineFunctions::RunLength RunLength
typename ScanlineFunctions::OffsetVectorType OffsetVectorType
typename ScanlineFunctions::OffsetVectorConstIterator OffsetVectorConstIterator
typename ScanlineFunctions::InternalLabelType InternalLabelType
Base class for all data objects in ITK.
Base class for all process objects that output image data.
typename OutputImageType::PixelType OutputImagePixelType
TOutputImage OutputImageType
typename OutputImageType::Pointer OutputImagePointer
typename InputImageType::ConstPointer InputImageConstPointer
typename InputImageType::Pointer InputImagePointer
typename InputImageType::PixelType InputImagePixelType
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...
Helper class for a group of filters which operate on scan-lines.
typename OffsetVectorType::const_iterator OffsetVectorConstIterator
typename TOutputImage::RegionType::SizeType OutSizeType
typename LineEncodingType::const_iterator LineEncodingConstIterator
typename LineEncodingType::iterator LineEncodingIterator
std::vector< LineEncodingType > LineMapType
std::vector< RunLength > LineEncodingType
std::vector< OffsetValueType > OffsetVectorType
std::vector< InternalLabelType > UnionFindType
std::vector< OutputPixelType > ConsecutiveVectorType
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....