ITK  6.0.0
Insight Toolkit
itkContourDirectedMeanDistanceImageFilter.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 itkContourDirectedMeanDistanceImageFilter_h
19#define itkContourDirectedMeanDistanceImageFilter_h
20
22#include "itkNumericTraits.h"
23#include "itkArray.h"
24#include "itkImage.h"
25
26namespace itk
27{
63template <typename TInputImage1, typename TInputImage2>
64class ITK_TEMPLATE_EXPORT ContourDirectedMeanDistanceImageFilter : public ImageToImageFilter<TInputImage1, TInputImage1>
65{
66public:
67 ITK_DISALLOW_COPY_AND_MOVE(ContourDirectedMeanDistanceImageFilter);
68
74
76 itkNewMacro(Self);
77
79 itkOverrideGetNameOfClassMacro(ContourDirectedMeanDistanceImageFilter);
80
82 using InputImage1Type = TInputImage1;
83 using InputImage2Type = TInputImage2;
88
92
93 using InputImage1PixelType = typename TInputImage1::PixelType;
94 using InputImage2PixelType = typename TInputImage2::PixelType;
95
97 static constexpr unsigned int ImageDimension = TInputImage1::ImageDimension;
98
101
103 void
105
107 void
109
111 const InputImage1Type *
113
115 const InputImage2Type *
117
119 itkGetConstMacro(ContourDirectedMeanDistance, RealType);
120
122 itkSetMacro(UseImageSpacing, bool);
123 itkGetConstMacro(UseImageSpacing, bool);
124 itkBooleanMacro(UseImageSpacing);
127#ifdef ITK_USE_CONCEPT_CHECKING
128 // Begin concept checking
130 // End concept checking
131#endif
132
133protected:
136 void
137 PrintSelf(std::ostream & os, Indent indent) const override;
138
141 void
142 AllocateOutputs() override;
143
145 void
147
150 void
152
154 void
155 ThreadedGenerateData(const RegionType & outputRegionForThread, ThreadIdType threadId) override;
156
157 void
159 {
160 itkExceptionMacro("This class requires threadId so it must use classic multi-threading model");
161 }
162
163 // Override since the filter needs all the data for the algorithm
164 void
166
167 // Override since the filter produces all of its output
168 void
170
171private:
173
174 typename DistanceMapType::Pointer m_DistanceMap{};
175
176 Array<RealType> m_MeanDistance{};
178 RealType m_ContourDirectedMeanDistance{};
179 bool m_UseImageSpacing{ true };
180};
181} // end namespace itk
182
183#ifndef ITK_MANUAL_INSTANTIATION
184# include "itkContourDirectedMeanDistanceImageFilter.hxx"
185#endif
186
187#endif
Computes the directed Mean distance between the boundaries of non-zero pixel regions of two images.
void ThreadedGenerateData(const RegionType &outputRegionForThread, ThreadIdType threadId) override
void EnlargeOutputRequestedRegion(DataObject *data) override
void SetInput1(const InputImage1Type *image)
~ContourDirectedMeanDistanceImageFilter() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
typename NumericTraits< InputImage1PixelType >::RealType RealType
void SetInput2(const InputImage2Type *image)
Base class for all data objects in ITK.
Base class for filters that take an image as input and produce an image as output.
Templated n-dimensional image class.
Definition: itkImage.h:89
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Define additional traits for native types such as int or float.
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