ITK  6.0.0
Insight Toolkit
itkSignedMaurerDistanceMapImageFilter.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 itkSignedMaurerDistanceMapImageFilter_h
19#define itkSignedMaurerDistanceMapImageFilter_h
20
22
23namespace itk
24{
66template <typename TInputImage, typename TOutputImage>
67class ITK_TEMPLATE_EXPORT SignedMaurerDistanceMapImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
68{
69public:
70 ITK_DISALLOW_COPY_AND_MOVE(SignedMaurerDistanceMapImageFilter);
71
73 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
74 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
75 static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
76
78 using InputImageType = TInputImage;
80
81 using OutputImageType = TOutputImage;
83
87
90
92 itkNewMacro(Self);
93
95 itkOverrideGetNameOfClassMacro(SignedMaurerDistanceMapImageFilter);
96
99
101 using InputPixelType = typename InputImageType::PixelType;
102 using OutputPixelType = typename OutputImageType::PixelType;
103
108
113
114 using InputSpacingType = typename InputImageType::SpacingType;
115 using OutputSpacingType = typename OutputImageType::SpacingType;
117
119 itkSetMacro(SquaredDistance, bool);
120
122 itkGetConstReferenceMacro(SquaredDistance, bool);
123
125 itkBooleanMacro(SquaredDistance);
126
129 itkSetMacro(InsideIsPositive, bool);
130
133 itkGetConstReferenceMacro(InsideIsPositive, bool);
134
138 itkBooleanMacro(InsideIsPositive);
139
141 itkSetMacro(UseImageSpacing, bool);
142
144 itkGetConstReferenceMacro(UseImageSpacing, bool);
145
147 itkBooleanMacro(UseImageSpacing);
148
153 itkSetMacro(BackgroundValue, InputPixelType);
154 itkGetConstReferenceMacro(BackgroundValue, InputPixelType);
157#ifdef ITK_USE_CONCEPT_CHECKING
158 // Begin concept checking
159 itkConceptMacro(IntConvertibleToInputCheck, (Concept::Convertible<int, InputPixelType>));
160 itkConceptMacro(InputHasNumericTraitsCheck, (Concept::HasNumericTraits<InputPixelType>));
161 itkConceptMacro(OutputImagePixelTypeIsFloatingPointCheck, (Concept::IsFloatingPoint<OutputPixelType>));
162 // End concept checking
163#endif
164
165protected:
168
169 void
170 PrintSelf(std::ostream & os, Indent indent) const override;
171
172 void
173 GenerateData() override;
174
175 unsigned int
176 SplitRequestedRegion(unsigned int i, unsigned int num, OutputImageRegionType & splitRegion) override;
177
178 void
180
181 void
183 {
184 itkExceptionMacro("This class requires threadId so it must use classic multi-threading model");
185 }
186
187private:
188 void
189 Voronoi(unsigned int, OutputIndexType idx, OutputImageType * output);
191
192 InputPixelType m_BackgroundValue{};
193 InputSpacingType m_Spacing{};
194
195 unsigned int m_CurrentDimension{ 0 };
196
197 bool m_InsideIsPositive{ false };
198 bool m_UseImageSpacing{ true };
199 bool m_SquaredDistance{ false };
200
201 const InputImageType * m_InputCache{};
202};
203} // end namespace itk
204
205#ifndef ITK_MANUAL_INSTANTIATION
206# include "itkSignedMaurerDistanceMapImageFilter.hxx"
207#endif
208
209#endif
Base class for all process objects that output image data.
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
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...
This filter calculates the Euclidean distance transform of a binary image in linear time for arbitrar...
typename OutputImageType::SizeValueType OutputSizeValueType
void Voronoi(unsigned int, OutputIndexType idx, OutputImageType *output)
bool Remove(OutputPixelType, OutputPixelType, OutputPixelType, OutputPixelType, OutputPixelType, OutputPixelType)
~SignedMaurerDistanceMapImageFilter() override=default
unsigned int SplitRequestedRegion(unsigned int i, unsigned int num, OutputImageRegionType &splitRegion) override
typename InputImageType::IndexValueType InputIndexValueType
typename InputImageType::SizeValueType InputSizeValueType
void DynamicThreadedGenerateData(const OutputImageRegionType &) override
void PrintSelf(std::ostream &os, Indent indent) const override
typename OutputImageType::IndexValueType OutputIndexValueType
void ThreadedGenerateData(const OutputImageRegionType &, ThreadIdType) override
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned int ThreadIdType
Definition: itkIntTypes.h:102
long IndexValueType
Definition: itkIntTypes.h:93
unsigned long SizeValueType
Definition: itkIntTypes.h:86