Orfeo Toolbox  3.16
itkMatchCardinalityImageToImageMetric.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkMatchCardinalityImageToImageMetric.h,v $
5  Language: C++
6  Date: $Date: 2009-04-23 03:53:36 $
7  Version: $Revision: 1.8 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef __itkMatchCardinalityImageToImageMetric_h
18 #define __itkMatchCardinalityImageToImageMetric_h
19 
20 // First make sure that the configuration is available.
21 // This line can be removed once the optimized versions
22 // gets integrated into the main directories.
23 #include "itkConfigure.h"
24 
25 #ifdef ITK_USE_OPTIMIZED_REGISTRATION_METHODS
27 #else
28 
29 #include "itkImageToImageMetric.h"
30 #include "itkCovariantVector.h"
31 #include "itkPoint.h"
32 #include "itkMultiThreader.h"
33 #include <vector>
34 
35 namespace itk
36 {
70 template < class TFixedImage, class TMovingImage >
72  public ImageToImageMetric< TFixedImage, TMovingImage>
73 {
74 public:
75 
81 
83  itkNewMacro(Self);
84 
87 
88 
90  typedef typename Superclass::RealType RealType;
92  typedef typename Superclass::TransformPointer TransformPointer;
93  typedef typename Superclass::TransformParametersType TransformParametersType;
94  typedef typename Superclass::TransformJacobianType TransformJacobianType;
95  typedef typename Superclass::GradientPixelType GradientPixelType;
96  typedef typename Superclass::InputPointType InputPointType;
97  typedef typename Superclass::OutputPointType OutputPointType;
98 
101  typedef typename Superclass::FixedImageType FixedImageType;
102  typedef typename Superclass::MovingImageType MovingImageType;
103  typedef typename Superclass::FixedImageConstPointer FixedImageConstPointer;
104  typedef typename Superclass::MovingImageConstPointer MovingImageConstPointer;
105  typedef typename Superclass::FixedImageRegionType FixedImageRegionType;
106 
107 
109  void GetDerivative( const TransformParametersType &,
110  DerivativeType & derivative ) const
111  {
112  itkWarningMacro(<< "This metric does not provide metric derivatives.");
114  }
115 
122  MeasureType GetValue( const TransformParametersType & parameters ) const;
123 
130  itkSetMacro(MeasureMatches, bool);
131  itkBooleanMacro(MeasureMatches);
132  itkGetConstMacro(MeasureMatches, bool);
133 
135  itkSetClampMacro( NumberOfThreads, int, 1, ITK_MAX_THREADS );
136  itkGetConstReferenceMacro( NumberOfThreads, int );
137 
139  MultiThreader * GetMultiThreader()
140  {return m_Threader;}
141 
142 protected:
145  void PrintSelf(std::ostream& os, Indent indent) const;
146 
152  MeasureType GetNonconstValue( const TransformParametersType & parameters );
153 
158  virtual
159  void ThreadedGetValue(const FixedImageRegionType& outputRegionForThread,
160  int threadId );
161 
167  virtual
168  int SplitFixedRegion(int i,int num, FixedImageRegionType& splitRegion);
169 
173  static ITK_THREAD_RETURN_TYPE ThreaderCallback( void *arg );
174 
177  {
179  };
180 
181 private:
182  MatchCardinalityImageToImageMetric(const Self&); //purposely not implemented
183  void operator=(const Self&); //purposely not implemented
184 
186  std::vector<MeasureType> m_ThreadMatches;
187  std::vector<unsigned long> m_ThreadCounts;
188 
193 };
194 
195 
196 } // end namespace itk
197 
198 #ifndef ITK_MANUAL_INSTANTIATION
200 #endif
201 
202 #endif
203 
204 #endif

Generated at Sat May 18 2013 23:52:39 for Orfeo Toolbox with doxygen 1.8.3.1