ITK  5.4.0
Insight Toolkit
itkContourMeanDistanceImageFilter.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 itkContourMeanDistanceImageFilter_h
19#define itkContourMeanDistanceImageFilter_h
20
22#include "itkNumericTraits.h"
23
24namespace itk
25{
69template <typename TInputImage1, typename TInputImage2>
70class ITK_TEMPLATE_EXPORT ContourMeanDistanceImageFilter : public ImageToImageFilter<TInputImage1, TInputImage1>
71{
72public:
73 ITK_DISALLOW_COPY_AND_MOVE(ContourMeanDistanceImageFilter);
81
83 itkNewMacro(Self);
84
86 itkOverrideGetNameOfClassMacro(ContourMeanDistanceImageFilter);
87
89 using InputImage1Type = TInputImage1;
90 using InputImage2Type = TInputImage2;
98 using IndexType = typename TInputImage1::IndexType;
100 using InputImage1PixelType = typename TInputImage1::PixelType;
101 using InputImage2PixelType = typename TInputImage2::PixelType;
102
104 static constexpr unsigned int ImageDimension = TInputImage1::ImageDimension;
105
108
110 void
111 SetInput1(const InputImage1Type * image);
112
114 void
115 SetInput2(const InputImage2Type * image);
116
119 GetInput1();
120
123 GetInput2();
124
126 itkGetConstMacro(MeanDistance, RealType);
127
129 itkSetMacro(UseImageSpacing, bool);
130 itkGetConstMacro(UseImageSpacing, bool);
131 itkBooleanMacro(UseImageSpacing);
134#ifdef ITK_USE_CONCEPT_CHECKING
135 // Begin concept checking
137 // End concept checking
138#endif
139
140protected:
142 ~ContourMeanDistanceImageFilter() override = default;
143 void
144 PrintSelf(std::ostream & os, Indent indent) const override;
145
147 void
148 GenerateData() override;
149
150 // Override since the filter needs all the data for the algorithm
151 void
152 GenerateInputRequestedRegion() override;
153
154 // Override since the filter produces all of its output
155 void
156 EnlargeOutputRequestedRegion(DataObject * data) override;
157
158private:
159 RealType m_MeanDistance{};
160 bool m_UseImageSpacing{ true };
161}; // end of class
162} // end namespace itk
163
164#ifndef ITK_MANUAL_INSTANTIATION
165# include "itkContourMeanDistanceImageFilter.hxx"
166#endif
167
168#endif
Computes the Mean distance between the boundaries of non-zero regions of two images.
typename NumericTraits< InputImage1PixelType >::RealType RealType
typename TInputImage1::PixelType InputImage1PixelType
typename TInputImage2::PixelType InputImage2PixelType
typename TInputImage1::ConstPointer InputImage1ConstPointer
typename TInputImage2::ConstPointer InputImage2ConstPointer
Base class for all data objects in ITK.
Base class for filters that take an image as input and produce an image as output.
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....