ITK  6.0.0
Insight Toolkit
itkSignedDanielssonDistanceMapImageFilter.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 itkSignedDanielssonDistanceMapImageFilter_h
19#define itkSignedDanielssonDistanceMapImageFilter_h
20
23
24// Simple functor to invert an image for Outside Danielsson distance map
25namespace itk
26{
27namespace Functor
28{
29template <typename InputPixelType>
30class ITK_TEMPLATE_EXPORT InvertIntensityFunctor{ public: InputPixelType operator()(InputPixelType input)
31 const { if (input){ return InputPixelType {};
32}
33else
34{
36}
37} // namespace itk
38}
39;
40} // namespace Functor
41} // namespace itk
42
43namespace itk
44{
87template <typename TInputImage, typename TOutputImage, typename TVoronoiImage = TInputImage>
88class ITK_TEMPLATE_EXPORT SignedDanielssonDistanceMapImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
89{
90public:
91 ITK_DISALLOW_COPY_AND_MOVE(SignedDanielssonDistanceMapImageFilter);
92
98
100 itkNewMacro(Self);
101
103 itkOverrideGetNameOfClassMacro(SignedDanielssonDistanceMapImageFilter);
104
106 using InputImageType = TInputImage;
107
110 using OutputImageType = TOutputImage;
111
114
117
119 using OffsetType = typename InputImageType::OffsetType;
120
122 using PixelType = typename InputImageType::PixelType;
123
126
128 static constexpr unsigned int InputImageDimension = InputImageType::ImageDimension;
129
132
135
138
141
142 using VoronoiImageType = TVoronoiImage;
144 using VoronoiPixelType = typename VoronoiImageType::PixelType;
145
147 using typename Superclass::DataObjectPointer;
148
150 itkSetMacro(SquaredDistance, bool);
151
153 itkGetConstReferenceMacro(SquaredDistance, bool);
154
156 itkBooleanMacro(SquaredDistance);
157
159 itkSetMacro(UseImageSpacing, bool);
160
162 itkGetConstReferenceMacro(UseImageSpacing, bool);
163
165 itkBooleanMacro(UseImageSpacing);
166
169 itkSetMacro(InsideIsPositive, bool);
170
173 itkGetConstReferenceMacro(InsideIsPositive, bool);
174
178 itkBooleanMacro(InsideIsPositive);
179
187
198
202
205 using Superclass::MakeOutput;
208
209#ifdef ITK_USE_CONCEPT_CHECKING
210 // Begin concept checking
211 itkConceptMacro(IntConvertibleToInputCheck, (Concept::Convertible<int, PixelType>));
212 itkConceptMacro(InputHasNumericTraitsCheck, (Concept::HasNumericTraits<PixelType>));
213 itkConceptMacro(OutputImagePixelTypeIsFloatingPointCheck,
215 // End concept checking
216#endif
217
218protected:
221 void
222 PrintSelf(std::ostream & os, Indent indent) const override;
223
225 void
226 GenerateData() override;
227
228private:
229 bool m_SquaredDistance{};
230 bool m_UseImageSpacing{ true };
231 bool m_InsideIsPositive{}; // ON is treated as inside pixels
232}; // end of SignedDanielssonDistanceMapImageFilter
233 // class
234} // end namespace itk
235
236#ifndef ITK_MANUAL_INSTANTIATION
237# include "itkSignedDanielssonDistanceMapImageFilter.hxx"
238#endif
239
240#endif
InputPixelType operator()(InputPixelType input) const
Base class for all process objects that output image data.
TOutputImage OutputImageType
typename OutputImageType::Pointer OutputImagePointer
Superclass::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
Base class for filters that take an image as input and produce an image as output.
typename InputImageType::Pointer InputImagePointer
Templated n-dimensional image class.
Definition: itkImage.h:89
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...
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
This filter computes the signed distance map of the input image as an approximation with pixel accura...
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override
~SignedDanielssonDistanceMapImageFilter() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....