go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkSingleValuedPointSetToPointSetMetric.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkSingleValuedPointSetToPointSetMetric.h,v $
5  Language: C++
6  Date: $Date: 2009-01-26 21:45:56 $
7  Version: $Revision: 1.2 $
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 __itkSingleValuedPointSetToPointSetMetric_h
18 #define __itkSingleValuedPointSetToPointSetMetric_h
19 
20 #include "itkImageBase.h"
21 #include "itkAdvancedTransform.h"
22 #include "itkSingleValuedCostFunction.h"
23 #include "itkExceptionObject.h"
24 #include "itkSpatialObject.h"
25 #include "itkPointSet.h"
26 
27 namespace itk
28 {
29 
44 template< class TFixedPointSet, class TMovingPointSet >
46  public SingleValuedCostFunction
47 {
48 public:
49 
52  typedef SingleValuedCostFunction Superclass;
53  typedef SmartPointer< Self > Pointer;
54  typedef SmartPointer< const Self > ConstPointer;
55 
57  typedef Superclass::ParametersValueType CoordinateRepresentationType;
58 
60  itkTypeMacro( SingleValuedPointSetToPointSetMetric, SingleValuedCostFunction );
61 
63  typedef TFixedPointSet FixedPointSetType;
64  typedef typename FixedPointSetType::PixelType FixedPointSetPixelType;
65  typedef typename FixedPointSetType::ConstPointer FixedPointSetConstPointer;
66  typedef TMovingPointSet MovingPointSetType;
67  typedef typename MovingPointSetType::PixelType MovingPointSetPixelType;
68  typedef typename MovingPointSetType::ConstPointer MovingPointSetConstPointer;
69  typedef typename FixedPointSetType::PointsContainer::ConstIterator PointIterator;
70  typedef typename FixedPointSetType::PointDataContainer::ConstIterator PointDataIterator;
71 
73  itkStaticConstMacro( FixedPointSetDimension, unsigned int,
74  TFixedPointSet::PointDimension );
75  itkStaticConstMacro( MovingPointSetDimension, unsigned int,
76  TMovingPointSet::PointDimension );
77 
80  itkGetStaticConstMacro( FixedPointSetDimension ),
81  itkGetStaticConstMacro( MovingPointSetDimension ) > TransformType;
87 
88  typedef SpatialObject<
89  itkGetStaticConstMacro( FixedPointSetDimension ) > FixedImageMaskType;
90  typedef typename FixedImageMaskType::Pointer FixedImageMaskPointer;
91  typedef typename FixedImageMaskType::ConstPointer FixedImageMaskConstPointer;
92  typedef SpatialObject<
93  itkGetStaticConstMacro( MovingPointSetDimension ) > MovingImageMaskType;
94  typedef typename MovingImageMaskType::Pointer MovingImageMaskPointer;
95  typedef typename MovingImageMaskType::ConstPointer MovingImageMaskConstPointer;
96 
98  typedef Superclass::MeasureType MeasureType;
99  typedef Superclass::DerivativeType DerivativeType;
100  typedef typename DerivativeType::ValueType DerivativeValueType;
101  typedef Superclass::ParametersType ParametersType;
102 
105 
107  itkSetConstObjectMacro( FixedPointSet, FixedPointSetType );
108 
110  itkGetConstObjectMacro( FixedPointSet, FixedPointSetType );
111 
113  itkSetConstObjectMacro( MovingPointSet, MovingPointSetType );
114 
116  itkGetConstObjectMacro( MovingPointSet, MovingPointSetType );
117 
119  itkSetObjectMacro( Transform, TransformType );
120 
122  itkGetConstObjectMacro( Transform, TransformType );
123 
125  void SetTransformParameters( const ParametersType & parameters ) const;
126 
128  unsigned int GetNumberOfParameters( void ) const
129  { return this->m_Transform->GetNumberOfParameters(); }
130 
134  virtual void Initialize( void ) throw ( ExceptionObject );
135 
137  // \todo: currently not used
138  itkSetConstObjectMacro( FixedImageMask, FixedImageMaskType );
139 
141  itkGetConstObjectMacro( FixedImageMask, FixedImageMaskType );
142 
144  itkSetConstObjectMacro( MovingImageMask, MovingImageMaskType );
145 
147  itkGetConstObjectMacro( MovingImageMask, MovingImageMaskType );
148 
150  virtual void BeforeThreadedGetValueAndDerivative( const TransformParametersType & parameters ) const;
151 
153  itkSetMacro( UseMetricSingleThreaded, bool );
154  itkGetConstReferenceMacro( UseMetricSingleThreaded, bool );
155  itkBooleanMacro( UseMetricSingleThreaded );
156 
157 protected:
158 
160  virtual ~SingleValuedPointSetToPointSetMetric() {}
161 
163  void PrintSelf( std::ostream & os, Indent indent ) const;
164 
171 
172  mutable unsigned int m_NumberOfPointsCounted;
173 
176 
177 private:
178 
179  SingleValuedPointSetToPointSetMetric( const Self & ); // purposely not implemented
180  void operator=( const Self & ); // purposely not implemented
181 
182 };
183 
184 } // end namespace itk
185 
186 #ifndef ITK_MANUAL_INSTANTIATION
187 #include "itkSingleValuedPointSetToPointSetMetric.hxx"
188 #endif
189 
190 #endif
void SetTransformParameters(const ParametersType &parameters) const
std::vector< unsigned long > NonZeroJacobianIndicesType
FixedPointSetType::PointsContainer::ConstIterator PointIterator
SpatialObject< itkGetStaticConstMacro(MovingPointSetDimension) > MovingImageMaskType
SmartPointer< Self > Pointer
Superclass::ParametersType ParametersType
void PrintSelf(std::ostream &os, Indent indent) const
Transform maps points, vectors and covariant vectors from an input space to an output space...
SpatialObject< itkGetStaticConstMacro(FixedPointSetDimension) > FixedImageMaskType
TransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
Superclass::JacobianType JacobianType
FixedPointSetType::PointDataContainer::ConstIterator PointDataIterator
itkStaticConstMacro(FixedPointSetDimension, unsigned int, TFixedPointSet::PointDimension)
Superclass::InputPointType InputPointType
Superclass::OutputPointType OutputPointType
virtual void BeforeThreadedGetValueAndDerivative(const TransformParametersType &parameters) const
AdvancedTransform< CoordinateRepresentationType, itkGetStaticConstMacro(FixedPointSetDimension), itkGetStaticConstMacro(MovingPointSetDimension) > TransformType


Generated on 11-03-2014 for elastix by doxygen 1.8.6 elastix logo