NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkPointSetToPointSetSingleValuedMetric.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef itkPointSetToPointSetSingleValuedMetric_h
16 #define itkPointSetToPointSetSingleValuedMetric_h
17 
18 #include <itkImageBase.h>
19 #include <itkTransform.h>
20 #include <itkSingleValuedCostFunction.h>
21 #include <itkExceptionObject.h>
22 
23 namespace itk
24 {
25 
41 template <class TFixedPointSet, class TMovingPointSet>
42 class ITK_EXPORT PointSetToPointSetSingleValuedMetric : public SingleValuedCostFunction
43 {
44 public:
45 
48  typedef SingleValuedCostFunction Superclass;
49  typedef SmartPointer<Self> Pointer;
50  typedef SmartPointer<const Self> ConstPointer;
51 
53  typedef Superclass::ParametersValueType CoordinateRepresentationType;
54 
56  itkTypeMacro(PointSetToPointSetSingleValuedMetric, SingleValuedCostFunction);
57 
59  typedef TMovingPointSet MovingPointSetType;
61  typedef typename MovingPointSetType::ConstPointer MovingPointSetConstPointer;
62 
64  typedef TFixedPointSet FixedPointSetType;
66  typedef typename FixedPointSetType::ConstPointer FixedPointSetConstPointer;
67 
69  itkStaticConstMacro(MovingPointSetDimension, unsigned int,
70  TMovingPointSet::PointDimension);
71  itkStaticConstMacro(FixedPointSetDimension, unsigned int,
72  TFixedPointSet::PointDimension);
73 
74  typedef typename FixedPointSetType::PointsContainer::ConstIterator PointIterator;
75  typedef typename FixedPointSetType::PointDataContainer::ConstIterator PointDataIterator;
76 
78  typedef Transform<CoordinateRepresentationType,
79  itkGetStaticConstMacro(MovingPointSetDimension),
80  itkGetStaticConstMacro(FixedPointSetDimension)> TransformType;
81 
87 
89  typedef Superclass::MeasureType MeasureType;
90 
92  typedef Superclass::DerivativeType DerivativeType;
93 
95  typedef Superclass::ParametersType ParametersType;
96 
98  itkSetConstObjectMacro( FixedPointSet, FixedPointSetType );
99 
101  itkGetConstObjectMacro( FixedPointSet, FixedPointSetType );
102 
104  itkSetConstObjectMacro( MovingPointSet, MovingPointSetType );
105 
107  itkGetConstObjectMacro( MovingPointSet, MovingPointSetType );
108 
110  itkSetObjectMacro( Transform, TransformType );
111 
113  itkGetObjectMacro( Transform, TransformType );
114 
116  void SetTransformParameters( const ParametersType & parameters ) const;
117 
119  unsigned int GetNumberOfParameters(void) const override
120  { return m_Transform->GetNumberOfParameters(); }
121 
124  virtual void Initialize(void) throw ( ExceptionObject );
125 
126 protected:
128  virtual ~PointSetToPointSetSingleValuedMetric() {};
129  void PrintSelf(std::ostream& os, Indent indent) const override;
130 
131  FixedPointSetConstPointer m_FixedPointSet;
132  MovingPointSetConstPointer m_MovingPointSet;
133 
134  mutable TransformPointer m_Transform;
135 
136 private:
137  PointSetToPointSetSingleValuedMetric(const Self&); //purposely not implemented
138  void operator=(const Self&); //purposely not implemented
139 
140 };
141 
142 } // end namespace itk
143 
144 #ifndef ITK_MANUAL_INSTANTIATION
145 #include "itkPointSetToPointSetSingleValuedMetric.txx"
146 #endif
147 
148 #endif
149 
Superclass::MeasureType MeasureType
Definition: itkPointSetToPointSetSingleValuedMetric.h:89
TMovingPointSet MovingPointSetType
Definition: itkPointSetToPointSetSingleValuedMetric.h:56
Superclass::ParametersValueType CoordinateRepresentationType
Definition: itkPointSetToPointSetSingleValuedMetric.h:53
MovingPointSetType::PixelType MovingPointSetPixelType
Definition: itkPointSetToPointSetSingleValuedMetric.h:60
SmartPointer< Self > Pointer
Definition: itkPointSetToPointSetSingleValuedMetric.h:49
Superclass::ParametersType ParametersType
Definition: itkPointSetToPointSetSingleValuedMetric.h:95
FixedPointSetType::PointsContainer::ConstIterator PointIterator
Definition: itkPointSetToPointSetSingleValuedMetric.h:74
MovingPointSetConstPointer m_MovingPointSet
Definition: itkPointSetToPointSetSingleValuedMetric.h:132
Definition: niftkITKAffineResampleImage.cxx:74
TransformPointer m_Transform
Definition: itkPointSetToPointSetSingleValuedMetric.h:134
Superclass::DerivativeType DerivativeType
Definition: itkPointSetToPointSetSingleValuedMetric.h:92
unsigned int GetNumberOfParameters(void) const override
Definition: itkPointSetToPointSetSingleValuedMetric.h:119
TransformType::Pointer TransformPointer
Definition: itkPointSetToPointSetSingleValuedMetric.h:82
Superclass::ParametersType ParametersType
Definition: itkEulerAffineTransform.h:66
SingleValuedCostFunction Superclass
Definition: itkPointSetToPointSetSingleValuedMetric.h:48
FixedPointSetConstPointer m_FixedPointSet
Definition: itkPointSetToPointSetSingleValuedMetric.h:131
FixedPointSetType::ConstPointer FixedPointSetConstPointer
Definition: itkPointSetToPointSetSingleValuedMetric.h:66
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
TransformType::ParametersType TransformParametersType
Definition: itkPointSetToPointSetSingleValuedMetric.h:85
FixedPointSetType::PointDataContainer::ConstIterator PointDataIterator
Definition: itkPointSetToPointSetSingleValuedMetric.h:75
Computes similarity between two point sets, but sums it up to a single value.
Definition: itkPointSetToPointSetSingleValuedMetric.h:42
SmartPointer< const Self > ConstPointer
Definition: itkPointSetToPointSetSingleValuedMetric.h:50
PointSetToPointSetSingleValuedMetric Self
Definition: itkPointSetToPointSetSingleValuedMetric.h:47
FixedPointSetType::PixelType FixedPointSetPixelType
Definition: itkPointSetToPointSetSingleValuedMetric.h:65
TFixedPointSet FixedPointSetType
Definition: itkPointSetToPointSetSingleValuedMetric.h:64
Superclass::OutputPointType OutputPointType
Definition: itkEulerAffineTransform.h:89
MovingPointSetType::ConstPointer MovingPointSetConstPointer
Definition: itkPointSetToPointSetSingleValuedMetric.h:61
Transform< CoordinateRepresentationType, itkGetStaticConstMacro(MovingPointSetDimension), itkGetStaticConstMacro(FixedPointSetDimension)> TransformType
Definition: itkPointSetToPointSetSingleValuedMetric.h:80
TransformType::JacobianType TransformJacobianType
Definition: itkPointSetToPointSetSingleValuedMetric.h:86
TransformType::OutputPointType OutputPointType
Definition: itkPointSetToPointSetSingleValuedMetric.h:84
Superclass::JacobianType JacobianType
Definition: itkEulerAffineTransform.h:69
SmartPointer< Self > Pointer
Definition: itkEulerAffineTransform.h:49
Superclass::InputPointType InputPointType
Definition: itkEulerAffineTransform.h:87
TransformType::InputPointType InputPointType
Definition: itkPointSetToPointSetSingleValuedMetric.h:83