ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
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}
33
35} // namespace itk
36}
37;
38} // namespace Functor
39} // namespace itk
40
41namespace itk
42{
84
85template <typename TInputImage, typename TOutputImage, typename TVoronoiImage = TInputImage>
86class ITK_TEMPLATE_EXPORT SignedDanielssonDistanceMapImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
87{
88public:
89 ITK_DISALLOW_COPY_AND_MOVE(SignedDanielssonDistanceMapImageFilter);
90
96
98 itkNewMacro(Self);
99
101 itkOverrideGetNameOfClassMacro(SignedDanielssonDistanceMapImageFilter);
102
104 using InputImageType = TInputImage;
105
108 using OutputImageType = TOutputImage;
109
111 using RegionType = typename InputImageType::RegionType;
112
114 using IndexType = typename RegionType::IndexType;
115
117 using OffsetType = typename InputImageType::OffsetType;
118
120 using PixelType = typename InputImageType::PixelType;
121
123 using SizeType = typename RegionType::SizeType;
124
126 static constexpr unsigned int InputImageDimension = InputImageType::ImageDimension;
127
130
132 using InputImagePointer = typename InputImageType::ConstPointer;
133
135 using OutputImagePointer = typename OutputImageType::Pointer;
136
139
140 using VoronoiImageType = TVoronoiImage;
141 using VoronoiImagePointer = typename VoronoiImageType::Pointer;
142 using VoronoiPixelType = typename VoronoiImageType::PixelType;
143
145 using typename Superclass::DataObjectPointer;
146
148 itkSetMacro(SquaredDistance, bool);
149
151 itkGetConstReferenceMacro(SquaredDistance, bool);
152
154 itkBooleanMacro(SquaredDistance);
155
157 itkSetMacro(UseImageSpacing, bool);
158
160 itkGetConstReferenceMacro(UseImageSpacing, bool);
161
163 itkBooleanMacro(UseImageSpacing);
164
167 itkSetMacro(InsideIsPositive, bool);
168
171 itkGetConstReferenceMacro(InsideIsPositive, bool);
172
176 itkBooleanMacro(InsideIsPositive);
177
185
196
200
206
207 itkConceptMacro(IntConvertibleToInputCheck, (Concept::Convertible<int, PixelType>));
208 itkConceptMacro(InputHasNumericTraitsCheck, (Concept::HasNumericTraits<PixelType>));
209 itkConceptMacro(OutputImagePixelTypeIsFloatingPointCheck,
211
212protected:
215 void
216 PrintSelf(std::ostream & os, Indent indent) const override;
217
219 void
220 GenerateData() override;
221
222private:
224 bool m_UseImageSpacing{ true };
225 bool m_InsideIsPositive{}; // ON is treated as inside pixels
226}; // end of SignedDanielssonDistanceMapImageFilter
227 // class
228} // end namespace itk
229
230#ifndef ITK_MANUAL_INSTANTIATION
231# include "itkSignedDanielssonDistanceMapImageFilter.hxx"
232#endif
233
234#endif
InputPixelType operator()(InputPixelType input) const
ProcessObject::DataObjectPointer MakeOutput(ProcessObject::DataObjectPointerArraySizeType idx) override
DataObject::Pointer DataObjectPointer
Templated n-dimensional image class.
Definition itkImage.h:89
Control indentation during Print() invocation.
Definition itkIndent.h:50
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
ImageToImageFilter< TInputImage, TOutputImage > Superclass
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override
Image< OffsetType, Self::InputImageDimension > VectorImageType
ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
~SignedDanielssonDistanceMapImageFilter() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
Implements transparent reference counting.
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....