ITK  4.6.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< typename TInputImage1, typename TInputImage2 >
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 
107  { return this->GetInput(); }
108 
110  const InputImage2Type * GetInput2(void);
111 
113  itkGetConstMacro(SimilarityIndex, RealType);
114 
115 #ifdef ITK_USE_CONCEPT_CHECKING
116  // Begin concept checking
117  itkConceptMacro( Input1HasNumericTraitsCheck,
119  itkConceptMacro( Input2HasNumericTraitsCheck,
121  // End concept checking
122 #endif
123 
124 protected:
127  void PrintSelf(std::ostream & os, Indent indent) const;
128 
131  void AllocateOutputs();
132 
135 
139 
141  void ThreadedGenerateData(const RegionType &
142  outputRegionForThread,
143  ThreadIdType threadId);
144 
145  // Override since the filter needs all the data for the algorithm
147 
148  // Override since the filter produces all of its output
150 
151 private:
152  SimilarityIndexImageFilter(const Self &); //purposely not implemented
153  void operator=(const Self &); //purposely not implemented
154 
156 
160 }; // end of class
161 } // end namespace itk
162 
163 #ifndef ITK_MANUAL_INSTANTIATION
164 #include "itkSimilarityIndexImageFilter.hxx"
165 #endif
166 
167 #endif
Light weight base class for most itk classes.
TInputImage2::ConstPointer InputImage2ConstPointer
void PrintSelf(std::ostream &os, Indent indent) const
NumericTraits< InputImage1PixelType >::RealType RealType
virtual void SetInput(const InputImageType *image)
void ThreadedGenerateData(const RegionType &outputRegionForThread, ThreadIdType threadId)
ImageToImageFilter< TInputImage1, TInputImage1 > Superclass
const InputImageType * GetInput(void) const
Measures the similarity between the set of non-zero pixels of two images.
void SetInput1(const InputImage1Type *image)
void SetInput2(const InputImage2Type *image)
const InputImage2Type * GetInput2(void)
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.
void EnlargeOutputRequestedRegion(DataObject *data)
#define itkConceptMacro(name, concept)
TInputImage1::ConstPointer InputImage1ConstPointer
Base class for all data objects in ITK.
void operator=(const Self &)
unsigned int ThreadIdType
Definition: itkIntTypes.h:159