Orfeo Toolbox  3.16
itkOptMatchCardinalityImageToImageMetric.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkOptMatchCardinalityImageToImageMetric.h,v $
5  Language: C++
6  Date: $Date: 2009-04-23 03:43:42 $
7  Version: $Revision: 1.5 $
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 __itkOptMatchCardinalityImageToImageMetric_h
18 #define __itkOptMatchCardinalityImageToImageMetric_h
19 
25 #include "itkImageToImageMetric.h"
26 #include "itkCovariantVector.h"
27 #include "itkPoint.h"
28 #include "itkMultiThreader.h"
29 #include <vector>
30 
31 namespace itk
32 {
66 template < class TFixedImage, class TMovingImage >
67 class ITK_EXPORT MatchCardinalityImageToImageMetric :
68  public ImageToImageMetric< TFixedImage, TMovingImage>
69 {
70 public:
71 
77 
79  itkNewMacro(Self);
80 
83 
84 
86  typedef typename Superclass::RealType RealType;
88  typedef typename Superclass::TransformPointer TransformPointer;
89  typedef typename Superclass::TransformParametersType TransformParametersType;
90  typedef typename Superclass::TransformJacobianType TransformJacobianType;
91  typedef typename Superclass::GradientPixelType GradientPixelType;
92 
95  typedef typename Superclass::FixedImageType FixedImageType;
96  typedef typename Superclass::MovingImageType MovingImageType;
97  typedef typename Superclass::FixedImageConstPointer FixedImageConstPointer;
98  typedef typename Superclass::MovingImageConstPointer MovingImageConstPointer;
99  typedef typename Superclass::FixedImageRegionType FixedImageRegionType;
100 
101 
103  void GetDerivative( const TransformParametersType &,
104  DerivativeType & derivative ) const
105  {
106  itkWarningMacro(<< "This metric does not provide metric derivatives.");
108  }
109 
116  MeasureType GetValue( const TransformParametersType & parameters ) const;
117 
124  itkSetMacro(MeasureMatches, bool);
125  itkBooleanMacro(MeasureMatches);
126  itkGetConstMacro(MeasureMatches, bool);
127 
129  MultiThreader * GetMultiThreader()
130  {return m_Threader;}
131 
132 protected:
135  void PrintSelf(std::ostream& os, Indent indent) const;
136 
142  MeasureType GetNonconstValue( const TransformParametersType & parameters );
143 
148  virtual
149  void ThreadedGetValue(const FixedImageRegionType& outputRegionForThread,
150  int threadId );
151 
157  virtual
158  int SplitFixedRegion(int i,int num, FixedImageRegionType& splitRegion);
159 
163  static ITK_THREAD_RETURN_TYPE ThreaderCallback( void *arg );
164 
166  struct ThreadStruct
167  {
168  Pointer Metric;
169  };
170 
171 private:
172  MatchCardinalityImageToImageMetric(const Self&); //purposely not implemented
173  void operator=(const Self&); //purposely not implemented
174 
175  bool m_MeasureMatches;
176  std::vector<MeasureType> m_ThreadMatches;
177  std::vector<unsigned long> m_ThreadCounts;
178 
181  MultiThreader::Pointer m_Threader;
182 };
183 
184 } // end namespace itk
185 
186 #ifndef ITK_MANUAL_INSTANTIATION
188 #endif
189 
190 #endif

Generated at Sat Jun 15 2013 23:58:13 for Orfeo Toolbox with doxygen 1.8.3.1