ITK  6.0.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 
21 #include "itkImageToImageFilter.h"
22 #include "itkNumericTraits.h"
23 
24 namespace itk
25 {
69 template <typename TInputImage1, typename TInputImage2>
70 class ITK_TEMPLATE_EXPORT ContourMeanDistanceImageFilter : public ImageToImageFilter<TInputImage1, TInputImage1>
71 {
72 public:
73  ITK_DISALLOW_COPY_AND_MOVE(ContourMeanDistanceImageFilter);
81 
83  itkNewMacro(Self);
84 
86  itkOverrideGetNameOfClassMacro(ContourMeanDistanceImageFilter);
87 
89  using InputImage1Type = TInputImage1;
90  using InputImage2Type = TInputImage2;
95 
97  using SizeType = typename TInputImage1::SizeType;
99 
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 
118  const InputImage1Type *
119  GetInput1();
120 
122  const InputImage2Type *
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 
140 protected:
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 
158 private:
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
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::ContourMeanDistanceImageFilter::SizeType
typename TInputImage1::SizeType SizeType
Definition: itkContourMeanDistanceImageFilter.h:97
itk::Concept::HasNumericTraits
Definition: itkConceptChecking.h:716
itk::ContourMeanDistanceImageFilter::InputImage2PixelType
typename TInputImage2::PixelType InputImage2PixelType
Definition: itkContourMeanDistanceImageFilter.h:101
itk::ContourMeanDistanceImageFilter::InputImage2ConstPointer
typename TInputImage2::ConstPointer InputImage2ConstPointer
Definition: itkContourMeanDistanceImageFilter.h:94
itk::ContourMeanDistanceImageFilter::InputImage1ConstPointer
typename TInputImage1::ConstPointer InputImage1ConstPointer
Definition: itkContourMeanDistanceImageFilter.h:93
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ContourMeanDistanceImageFilter::InputImage2Pointer
typename TInputImage2::Pointer InputImage2Pointer
Definition: itkContourMeanDistanceImageFilter.h:92
itk::ContourMeanDistanceImageFilter::InputImage1Type
TInputImage1 InputImage1Type
Definition: itkContourMeanDistanceImageFilter.h:89
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::ContourMeanDistanceImageFilter::InputImage1PixelType
typename TInputImage1::PixelType InputImage1PixelType
Definition: itkContourMeanDistanceImageFilter.h:100
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ContourMeanDistanceImageFilter::IndexType
typename TInputImage1::IndexType IndexType
Definition: itkContourMeanDistanceImageFilter.h:98
itkImageToImageFilter.h
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:60
itk::ContourMeanDistanceImageFilter::RegionType
typename TInputImage1::RegionType RegionType
Definition: itkContourMeanDistanceImageFilter.h:96
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ContourMeanDistanceImageFilter
Computes the Mean distance between the boundaries of non-zero regions of two images.
Definition: itkContourMeanDistanceImageFilter.h:70
itk::ContourMeanDistanceImageFilter::InputImage2Type
TInputImage2 InputImage2Type
Definition: itkContourMeanDistanceImageFilter.h:90
itkNumericTraits.h
itk::ContourMeanDistanceImageFilter::InputImage1Pointer
typename TInputImage1::Pointer InputImage1Pointer
Definition: itkContourMeanDistanceImageFilter.h:91
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293
itk::ContourMeanDistanceImageFilter::RealType
typename NumericTraits< InputImage1PixelType >::RealType RealType
Definition: itkContourMeanDistanceImageFilter.h:107