ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
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{
62template <typename TInputImage, typename TOutputImage>
63class ITK_TEMPLATE_EXPORT SignedMaurerDistanceMapImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
64{
65public:
66 ITK_DISALLOW_COPY_AND_MOVE(SignedMaurerDistanceMapImageFilter);
67
69 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
70 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
71 static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
72
74 using InputImageType = TInputImage;
75 using InputImageConstPointer = typename InputImageType::ConstPointer;
76
77 using OutputImageType = TOutputImage;
78 using OutputImagePointer = typename OutputImageType::Pointer;
79
83
86
88 itkNewMacro(Self);
89
91 itkOverrideGetNameOfClassMacro(SignedMaurerDistanceMapImageFilter);
92
93 using InputRegionType = typename InputImageType::RegionType;
94 using OutputRegionType = typename OutputImageType::RegionType;
95
97 using InputPixelType = typename InputImageType::PixelType;
98 using OutputPixelType = typename OutputImageType::PixelType;
99
100 using InputSizeType = typename InputImageType::SizeType;
101 using InputSizeValueType = typename InputImageType::SizeValueType;
102 using OutputSizeType = typename OutputImageType::SizeType;
103 using OutputSizeValueType = typename OutputImageType::SizeValueType;
104
105 using InputIndexType = typename InputImageType::IndexType;
106 using InputIndexValueType = typename InputImageType::IndexValueType;
107 using OutputIndexType = typename OutputImageType::IndexType;
108 using OutputIndexValueType = typename OutputImageType::IndexValueType;
109
110 using InputSpacingType = typename InputImageType::SpacingType;
111 using OutputSpacingType = typename OutputImageType::SpacingType;
112 using OutputImageRegionType = typename OutputImageType::RegionType;
113
115 itkSetMacro(SquaredDistance, bool);
116
118 itkGetConstReferenceMacro(SquaredDistance, bool);
119
121 itkBooleanMacro(SquaredDistance);
122
125 itkSetMacro(InsideIsPositive, bool);
126
129 itkGetConstReferenceMacro(InsideIsPositive, bool);
130
134 itkBooleanMacro(InsideIsPositive);
135
137 itkSetMacro(UseImageSpacing, bool);
138
140 itkGetConstReferenceMacro(UseImageSpacing, bool);
141
143 itkBooleanMacro(UseImageSpacing);
144
149 itkSetMacro(BackgroundValue, InputPixelType);
150 itkGetConstReferenceMacro(BackgroundValue, InputPixelType);
152
153 itkConceptMacro(IntConvertibleToInputCheck, (Concept::Convertible<int, InputPixelType>));
154 itkConceptMacro(InputHasNumericTraitsCheck, (Concept::HasNumericTraits<InputPixelType>));
155 itkConceptMacro(OutputImagePixelTypeIsFloatingPointCheck, (Concept::IsFloatingPoint<OutputPixelType>));
156
157protected:
160
161 void
162 PrintSelf(std::ostream & os, Indent indent) const override;
163
164 void
165 GenerateData() override;
166
167 unsigned int
168 SplitRequestedRegion(unsigned int i, unsigned int num, OutputImageRegionType & splitRegion) override;
169
170 void
172
173 void
175 {
176 itkExceptionMacro("This class requires threadId so it must use classic multi-threading model");
177 }
178
179private:
180 void
181 Voronoi(unsigned int, OutputIndexType idx, OutputImageType * output);
183
186
187 unsigned int m_CurrentDimension{ 0 };
188
189 bool m_InsideIsPositive{ false };
190 bool m_UseImageSpacing{ true };
191 bool m_SquaredDistance{ false };
192
194};
195} // end namespace itk
196
197#ifndef ITK_MANUAL_INSTANTIATION
198# include "itkSignedMaurerDistanceMapImageFilter.hxx"
199#endif
200
201#endif
Control indentation during Print() invocation.
Definition itkIndent.h:50
typename InputImageType::ConstPointer InputImageConstPointer
typename OutputImageType::SizeValueType OutputSizeValueType
void Voronoi(unsigned int, OutputIndexType idx, OutputImageType *output)
ImageToImageFilter< InputImageType, OutputImageType > Superclass
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
Implements transparent reference counting.
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned int ThreadIdType