ITK  5.1.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  * http://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 
21 #include "itkImageToImageFilter.h"
22 #include "itkNumericTraits.h"
23 #include "itkArray.h"
24 #include "itkImage.h"
25 
26 namespace itk
27 {
63 template <typename TInputImage1, typename TInputImage2>
64 class ITK_TEMPLATE_EXPORT ContourDirectedMeanDistanceImageFilter : public ImageToImageFilter<TInputImage1, TInputImage1>
65 {
66 public:
67  ITK_DISALLOW_COPY_AND_ASSIGN(ContourDirectedMeanDistanceImageFilter);
68 
74 
76  itkNewMacro(Self);
77 
80 
82  using InputImage1Type = TInputImage1;
83  using InputImage2Type = TInputImage2;
84  using InputImage1Pointer = typename TInputImage1::Pointer;
85  using InputImage2Pointer = typename TInputImage2::Pointer;
86  using InputImage1ConstPointer = typename TInputImage1::ConstPointer;
87  using InputImage2ConstPointer = typename TInputImage2::ConstPointer;
88 
90  using SizeType = typename TInputImage1::SizeType;
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
104  SetInput1(const InputImage1Type * image);
105 
107  void
108  SetInput2(const InputImage2Type * image);
109 
111  const InputImage1Type *
112  GetInput1();
113 
115  const InputImage2Type *
116  GetInput2();
117 
119  itkGetConstMacro(ContourDirectedMeanDistance, RealType);
120 
122  itkSetMacro(UseImageSpacing, bool);
123  itkGetConstMacro(UseImageSpacing, bool);
125 
126 #ifdef ITK_USE_CONCEPT_CHECKING
127  // Begin concept checking
129  // End concept checking
130 #endif
131 
132 protected:
134  ~ContourDirectedMeanDistanceImageFilter() override = default;
135  void
136  PrintSelf(std::ostream & os, Indent indent) const override;
137 
140  void
141  AllocateOutputs() override;
142 
144  void
145  BeforeThreadedGenerateData() override;
146 
149  void
150  AfterThreadedGenerateData() override;
151 
153  void
154  ThreadedGenerateData(const RegionType & outputRegionForThread, ThreadIdType threadId) override;
155 
156  void
158  {
159  itkExceptionMacro("This class requires threadId so it must use classic multi-threading model");
160  }
161 
162  // Override since the filter needs all the data for the algorithm
163  void
164  GenerateInputRequestedRegion() override;
165 
166  // Override since the filter produces all of its output
167  void
168  EnlargeOutputRequestedRegion(DataObject * data) override;
169 
170 private:
172 
174 
179 }; // end of class
180 } // end namespace itk
181 
182 #ifndef ITK_MANUAL_INSTANTIATION
183 # include "itkContourDirectedMeanDistanceImageFilter.hxx"
184 #endif
185 
186 #endif
itk::ContourDirectedMeanDistanceImageFilter::InputImage1Type
TInputImage1 InputImage1Type
Definition: itkContourDirectedMeanDistanceImageFilter.h:82
itk::Concept::HasNumericTraits
Definition: itkConceptChecking.h:712
itk::ContourDirectedMeanDistanceImageFilter::m_Count
Array< IdentifierType > m_Count
Definition: itkContourDirectedMeanDistanceImageFilter.h:176
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::ContourDirectedMeanDistanceImageFilter::InputImage1PixelType
typename TInputImage1::PixelType InputImage1PixelType
Definition: itkContourDirectedMeanDistanceImageFilter.h:93
itkImage.h
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ContourDirectedMeanDistanceImageFilter::m_MeanDistance
Array< RealType > m_MeanDistance
Definition: itkContourDirectedMeanDistanceImageFilter.h:175
itk::ContourDirectedMeanDistanceImageFilter::InputImage2PixelType
typename TInputImage2::PixelType InputImage2PixelType
Definition: itkContourDirectedMeanDistanceImageFilter.h:94
itk::ContourDirectedMeanDistanceImageFilter::InputImage2ConstPointer
typename TInputImage2::ConstPointer InputImage2ConstPointer
Definition: itkContourDirectedMeanDistanceImageFilter.h:87
itk::ContourDirectedMeanDistanceImageFilter::InputImage2Type
TInputImage2 InputImage2Type
Definition: itkContourDirectedMeanDistanceImageFilter.h:83
itk::ThreadIdType
unsigned int ThreadIdType
Definition: itkIntTypes.h:99
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::ContourDirectedMeanDistanceImageFilter
Computes the directed Mean distance between the boundaries of non-zero pixel regions of two images.
Definition: itkContourDirectedMeanDistanceImageFilter.h:64
itk::ContourDirectedMeanDistanceImageFilter::m_DistanceMap
DistanceMapType::Pointer m_DistanceMap
Definition: itkContourDirectedMeanDistanceImageFilter.h:173
itk::ContourDirectedMeanDistanceImageFilter::RealType
typename NumericTraits< InputImage1PixelType >::RealType RealType
Definition: itkContourDirectedMeanDistanceImageFilter.h:100
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ContourDirectedMeanDistanceImageFilter::RegionType
typename TInputImage1::RegionType RegionType
Definition: itkContourDirectedMeanDistanceImageFilter.h:89
itk::ContourDirectedMeanDistanceImageFilter::InputImage1ConstPointer
typename TInputImage1::ConstPointer InputImage1ConstPointer
Definition: itkContourDirectedMeanDistanceImageFilter.h:86
itkImageToImageFilter.h
itk::ContourDirectedMeanDistanceImageFilter::m_UseImageSpacing
bool m_UseImageSpacing
Definition: itkContourDirectedMeanDistanceImageFilter.h:178
itk::ContourDirectedMeanDistanceImageFilter::IndexType
typename TInputImage1::IndexType IndexType
Definition: itkContourDirectedMeanDistanceImageFilter.h:91
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:58
itkArray.h
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:64
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkArray.h:26
itk::ContourDirectedMeanDistanceImageFilter::SizeType
typename TInputImage1::SizeType SizeType
Definition: itkContourDirectedMeanDistanceImageFilter.h:90
itk::Array< RealType >
itkNumericTraits.h
itk::ContourDirectedMeanDistanceImageFilter::DynamicThreadedGenerateData
void DynamicThreadedGenerateData(const RegionType &) override
Definition: itkContourDirectedMeanDistanceImageFilter.h:157
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itk::ContourDirectedMeanDistanceImageFilter::InputImage2Pointer
typename TInputImage2::Pointer InputImage2Pointer
Definition: itkContourDirectedMeanDistanceImageFilter.h:85
itk::ContourDirectedMeanDistanceImageFilter::m_ContourDirectedMeanDistance
RealType m_ContourDirectedMeanDistance
Definition: itkContourDirectedMeanDistanceImageFilter.h:177
itk::ContourDirectedMeanDistanceImageFilter::InputImage1Pointer
typename TInputImage1::Pointer InputImage1Pointer
Definition: itkContourDirectedMeanDistanceImageFilter.h:84
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293