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
25
26namespace itk::Functor
27{
28template <typename InputPixelType>
29class ITK_TEMPLATE_EXPORT InvertIntensityFunctor{ public: InputPixelType operator()(InputPixelType input)
30 const { if (input){ return InputPixelType {};
31}
32
34} // namespace itk
35}
36;
37} // namespace itk::Functor
38
39namespace itk
40{
82
83template <typename TInputImage, typename TOutputImage, typename TVoronoiImage = TInputImage>
84class ITK_TEMPLATE_EXPORT SignedDanielssonDistanceMapImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
85{
86public:
87 ITK_DISALLOW_COPY_AND_MOVE(SignedDanielssonDistanceMapImageFilter);
88
94
96 itkNewMacro(Self);
97
99 itkOverrideGetNameOfClassMacro(SignedDanielssonDistanceMapImageFilter);
100
102 using InputImageType = TInputImage;
103
106 using OutputImageType = TOutputImage;
107
109 using RegionType = typename InputImageType::RegionType;
110
112 using IndexType = typename RegionType::IndexType;
113
115 using OffsetType = typename InputImageType::OffsetType;
116
118 using PixelType = typename InputImageType::PixelType;
119
121 using SizeType = typename RegionType::SizeType;
122
124 static constexpr unsigned int InputImageDimension = InputImageType::ImageDimension;
125
128
130 using InputImagePointer = typename InputImageType::ConstPointer;
131
133 using OutputImagePointer = typename OutputImageType::Pointer;
134
137
138 using VoronoiImageType = TVoronoiImage;
139 using VoronoiImagePointer = typename VoronoiImageType::Pointer;
140 using VoronoiPixelType = typename VoronoiImageType::PixelType;
141
143 using typename Superclass::DataObjectPointer;
144
146 itkSetMacro(SquaredDistance, bool);
147
149 itkGetConstReferenceMacro(SquaredDistance, bool);
150
152 itkBooleanMacro(SquaredDistance);
153
155 itkSetMacro(UseImageSpacing, bool);
156
158 itkGetConstReferenceMacro(UseImageSpacing, bool);
159
161 itkBooleanMacro(UseImageSpacing);
162
165 itkSetMacro(InsideIsPositive, bool);
166
169 itkGetConstReferenceMacro(InsideIsPositive, bool);
170
174 itkBooleanMacro(InsideIsPositive);
175
183
194
198
204
205 itkConceptMacro(IntConvertibleToInputCheck, (Concept::Convertible<int, PixelType>));
206 itkConceptMacro(InputHasNumericTraitsCheck, (Concept::HasNumericTraits<PixelType>));
207 itkConceptMacro(OutputImagePixelTypeIsFloatingPointCheck,
209
210protected:
213 void
214 PrintSelf(std::ostream & os, Indent indent) const override;
215
217 void
218 GenerateData() override;
219
220private:
222 bool m_UseImageSpacing{ true };
223 bool m_InsideIsPositive{}; // ON is treated as inside pixels
224}; // end of SignedDanielssonDistanceMapImageFilter
225 // class
226} // end namespace itk
227
228#ifndef ITK_MANUAL_INSTANTIATION
229# include "itkSignedDanielssonDistanceMapImageFilter.hxx"
230#endif
231
232#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....