ITK  4.8.0
Insight Segmentation and Registration Toolkit
itkContourDirectedMeanDistanceImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 {
62 template< typename TInputImage1, typename TInputImage2 >
64  public ImageToImageFilter< TInputImage1, TInputImage1 >
65 {
66 public:
72 
74  itkNewMacro(Self);
75 
78 
80  typedef TInputImage1 InputImage1Type;
81  typedef TInputImage2 InputImage2Type;
82  typedef typename TInputImage1::Pointer InputImage1Pointer;
83  typedef typename TInputImage2::Pointer InputImage2Pointer;
84  typedef typename TInputImage1::ConstPointer InputImage1ConstPointer;
85  typedef typename TInputImage2::ConstPointer InputImage2ConstPointer;
86 
87  typedef typename TInputImage1::RegionType RegionType;
88  typedef typename TInputImage1::SizeType SizeType;
89  typedef typename TInputImage1::IndexType IndexType;
90 
91  typedef typename TInputImage1::PixelType InputImage1PixelType;
92  typedef typename TInputImage2::PixelType InputImage2PixelType;
93 
95  itkStaticConstMacro(ImageDimension, unsigned int,
96  TInputImage1::ImageDimension);
97 
100 
102  void SetInput1(const InputImage1Type *image);
103 
105  void SetInput2(const InputImage2Type *image);
106 
108  const InputImage1Type * GetInput1();
109 
111  const InputImage2Type * GetInput2();
112 
114  itkGetConstMacro(ContourDirectedMeanDistance, RealType);
115 
117  itkSetMacro( UseImageSpacing, bool );
118  itkGetConstMacro( UseImageSpacing, bool );
120 
121 #ifdef ITK_USE_CONCEPT_CHECKING
122  // Begin concept checking
123  itkConceptMacro( InputHasNumericTraitsCheck,
125  // End concept checking
126 #endif
127 
128 protected:
131  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
132 
135  void AllocateOutputs() ITK_OVERRIDE;
136 
138  void BeforeThreadedGenerateData() ITK_OVERRIDE;
139 
142  void AfterThreadedGenerateData() ITK_OVERRIDE;
143 
145  void ThreadedGenerateData(const RegionType &
146  outputRegionForThread,
147  ThreadIdType threadId) ITK_OVERRIDE;
148 
149  // Override since the filter needs all the data for the algorithm
150  void GenerateInputRequestedRegion() ITK_OVERRIDE;
151 
152  // Override since the filter produces all of its output
153  void EnlargeOutputRequestedRegion(DataObject *data) ITK_OVERRIDE;
154 
155 private:
156  ContourDirectedMeanDistanceImageFilter(const Self &); //purposely not
157  // implemented
158  void operator=(const Self &); //purposely not
159 
160  // implemented
161 
162  typedef Image< RealType, itkGetStaticConstMacro(ImageDimension) > DistanceMapType;
163 
164  typename DistanceMapType::Pointer m_DistanceMap;
165 
166  Array< RealType > m_MeanDistance;
170 }; // end of class
171 } // end namespace itk
172 
173 #ifndef ITK_MANUAL_INSTANTIATION
174 #include "itkContourDirectedMeanDistanceImageFilter.hxx"
175 #endif
176 
177 #endif
Array class with size defined at construction time.
Definition: itkArray.h:50
void EnlargeOutputRequestedRegion(DataObject *data) override
Light weight base class for most itk classes.
typedef(Concept::HasNumericTraits< InputImage1PixelType >) InputHasNumericTraitsCheck
NumericTraits< InputImage1PixelType >::RealType RealType
SizeValueType IdentifierType
Definition: itkIntTypes.h:147
void SetInput2(const InputImage2Type *image)
void SetInput1(const InputImage1Type *image)
Computes the directed Mean distance between the boundaries of non-zero pixel regions of two images...
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Define additional traits for native types such as int or float.
#define itkConceptMacro(name, concept)
ImageToImageFilter< TInputImage1, TInputImage1 > Superclass
void PrintSelf(std::ostream &os, Indent indent) const override
Base class for all data objects in ITK.
Templated n-dimensional image class.
Definition: itkImage.h:75
void ThreadedGenerateData(const RegionType &outputRegionForThread, ThreadIdType threadId) override