ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkSimilarityIndexImageFilter.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 __itkSimilarityIndexImageFilter_h
19 #define __itkSimilarityIndexImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "itkNumericTraits.h"
23 #include "itkArray.h"
24 
25 namespace itk
26 {
59 template< class TInputImage1, class TInputImage2 >
60 class ITK_EXPORT SimilarityIndexImageFilter:
61  public ImageToImageFilter< TInputImage1, TInputImage1 >
62 {
63 public:
69 
71  itkNewMacro(Self);
72 
75 
77  typedef TInputImage1 InputImage1Type;
78  typedef TInputImage2 InputImage2Type;
79  typedef typename TInputImage1::Pointer InputImage1Pointer;
80  typedef typename TInputImage2::Pointer InputImage2Pointer;
81  typedef typename TInputImage1::ConstPointer InputImage1ConstPointer;
82  typedef typename TInputImage2::ConstPointer InputImage2ConstPointer;
83 
84  typedef typename TInputImage1::RegionType RegionType;
85  typedef typename TInputImage1::SizeType SizeType;
86  typedef typename TInputImage1::IndexType IndexType;
87 
88  typedef typename TInputImage1::PixelType InputImage1PixelType;
89  typedef typename TInputImage2::PixelType InputImage2PixelType;
90 
92  itkStaticConstMacro(ImageDimension, unsigned int,
93  TInputImage1::ImageDimension);
94 
97 
99  void SetInput1(const InputImage1Type *image)
100  { this->SetInput(image); }
101 
103  void SetInput2(const InputImage2Type *image);
104 
106  const InputImage1Type * GetInput1(void)
107  { return this->GetInput(); }
108 
110  const InputImage2Type * GetInput2(void);
111 
113  itkGetConstMacro(SimilarityIndex, RealType);
114 
115 #ifdef ITK_USE_CONCEPT_CHECKING
116 
117  itkConceptMacro( Input1HasNumericTraitsCheck,
119  itkConceptMacro( Input2HasNumericTraitsCheck,
121 
123 #endif
124 protected:
127  void PrintSelf(std::ostream & os, Indent indent) const;
129 
132  void AllocateOutputs();
133 
135  void BeforeThreadedGenerateData();
136 
139  void AfterThreadedGenerateData();
140 
142  void ThreadedGenerateData(const RegionType &
143  outputRegionForThread,
144  ThreadIdType threadId);
145 
146  // Override since the filter needs all the data for the algorithm
147  void GenerateInputRequestedRegion();
148 
149  // Override since the filter produces all of its output
150  void EnlargeOutputRequestedRegion(DataObject *data);
151 
152 private:
153  SimilarityIndexImageFilter(const Self &); //purposely not implemented
154  void operator=(const Self &); //purposely not implemented
155 
157 
161 }; // end of class
162 } // end namespace itk
163 
164 #ifndef ITK_MANUAL_INSTANTIATION
165 #include "itkSimilarityIndexImageFilter.hxx"
166 #endif
167 
168 #endif
169