NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkTransform2D3D.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 itkTransform2D3D_h
16 #define itkTransform2D3D_h
17 
18 #include <itkMacro.h>
19 #include <iostream>
20 
21 #include <itkTransform.h>
24 
25 
26 namespace itk
27 {
28 
39 template <class TScalarType=double> // Data type for scalars (float or double)
40 class ITK_EXPORT Transform2D3D :
41  public Transform< TScalarType, 3, 2 >
42 {
43 public:
45  itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
46  itkStaticConstMacro(OutputSpaceDimension, unsigned int, 2);
47 
49  itkStaticConstMacro(SpaceDimension, unsigned int, 3);
50  itkStaticConstMacro(ParametersDimension, unsigned int, 0);
51 
54  typedef Transform< TScalarType,
55  InputSpaceDimension,
56  OutputSpaceDimension> Superclass;
57 
58  typedef SmartPointer<Self> Pointer;
59  typedef SmartPointer<const Self> ConstPointer;
60 
62  itkTypeMacro( Transform2D3D, Transform );
63 
65  itkNewMacro( Self );
66 
68  typedef typename Superclass::ScalarType ScalarType;
69 
71  typedef typename Superclass::ParametersType ParametersType;
72 
75 
79  typedef itk::Transform< ScalarType, InputSpaceDimension, InputSpaceDimension > DeformableTransformType;
82 
84  itkSetObjectMacro( GlobalAffineTransform, GlobalAffineTransformType );
86  itkSetObjectMacro( DeformableTransform, DeformableTransformType );
88  itkSetObjectMacro( PerspectiveTransform, PerspectiveProjectionTransformType );
89 
91  typedef Vector<ScalarType, InputSpaceDimension> InputVectorType;
92  typedef Vector<ScalarType, OutputSpaceDimension> OutputVectorType;
93 
95  typedef Point<ScalarType, InputSpaceDimension> InputPointType;
96  typedef Point<ScalarType, OutputSpaceDimension> OutputPointType;
97 
102  void SetParameters( const ParametersType & parameters );
103  const ParametersType & GetParameters() const;
104 
106  virtual void SetFixedParameters( const ParametersType & ) {}
107 
109  virtual const ParametersType& GetFixedParameters(void) const
110  { return this->m_FixedParameters; }
111 
115  OutputPointType TransformPoint(const InputPointType &point ) const;
116 
118  virtual const JacobianType GetJacobian(const InputPointType &point ) const;
119 
120  virtual void ComputeJacobianWithRespectToParameters(const InputPointType & point,
121  JacobianType & jacobian ) const;
122 
123 protected:
124  Transform2D3D();
125  ~Transform2D3D();
126  void PrintSelf(std::ostream &os, Indent indent) const;
127 
129  typename DeformableTransformType::Pointer m_DeformableTransform;
131 
132 
133 private:
134  Transform2D3D(const Self&); //purposely not implemented
135  void operator=(const Self&); //purposely not implemented
136 
137 }; //class Transform2D3D:
138 
139 
140 
141 } // namespace itk
142 
143 // Define instantiation macro for this template.
144 #define ITK_TEMPLATE_Transform2D3D(_, EXPORT, x, y) namespace itk { \
145  _(1(class EXPORT Transform2D3D< ITK_TEMPLATE_1 x >)) \
146  namespace Templates { typedef Transform2D3D< ITK_TEMPLATE_1 x > \
147  Transform2D3D##y; } \
148  }
149 
150 #if ITK_TEMPLATE_EXPLICIT
151 # include "Templates/itkTransform2D3D+-.h"
152 #endif
153 
154 #if ITK_TEMPLATE_TXX
155 # include "itkTransform2D3D.txx"
156 #endif
157 
158 #endif /* __itkTransform2D3D_h */
Transform< TScalarType, InputSpaceDimension, OutputSpaceDimension > Superclass
Definition: itkTransform2D3D.h:56
DeformableTransformType::Pointer m_DeformableTransform
Definition: itkTransform2D3D.h:129
SmartPointer< Self > Pointer
Definition: itkTransform2D3D.h:58
Base class for deformable transforms.
Definition: itkDeformableTransform.h:69
Definition: niftkITKAffineResampleImage.cxx:74
Transform2D3D of a vector space (e.g. space coordinates)
Definition: itkTransform2D3D.h:40
Vector< ScalarType, InputSpaceDimension > InputVectorType
Definition: itkTransform2D3D.h:88
Superclass::JacobianType JacobianType
Definition: itkTransform2D3D.h:74
Point< ScalarType, InputSpaceDimension > InputPointType
Definition: itkTransform2D3D.h:95
PerspectiveProjectionTransform of a vector space (e.g. space coordinates)
Definition: itkPerspectiveProjectionTransform.h:39
itk::EulerAffineTransform< ScalarType, InputSpaceDimension, InputSpaceDimension > GlobalAffineTransformType
Definition: itkTransform2D3D.h:77
Transform2D3D Self
Definition: itkTransform2D3D.h:53
Euler Affine transform.
Definition: itkEulerAffineTransform.h:38
SmartPointer< const Self > ConstPointer
Definition: itkTransform2D3D.h:59
Vector< ScalarType, OutputSpaceDimension > OutputVectorType
Definition: itkTransform2D3D.h:92
Superclass::ScalarType ScalarType
Definition: itkTransform2D3D.h:65
Point< ScalarType, OutputSpaceDimension > OutputPointType
Definition: itkTransform2D3D.h:96
itk::PerspectiveProjectionTransform< ScalarType > PerspectiveProjectionTransformType
Definition: itkTransform2D3D.h:81
virtual const ParametersType & GetFixedParameters(void) const
Definition: itkTransform2D3D.h:109
SmartPointer< Self > Pointer
Definition: itkPerspectiveProjectionTransform.h:57
itk::Transform< ScalarType, InputSpaceDimension, InputSpaceDimension > DeformableTransformType
Definition: itkTransform2D3D.h:79
Superclass::ParametersType ParametersType
Definition: itkTransform2D3D.h:71
virtual void SetFixedParameters(const ParametersType &)
Definition: itkTransform2D3D.h:106
SmartPointer< Self > Pointer
Definition: itkEulerAffineTransform.h:49
PerspectiveProjectionTransformType::Pointer m_PerspectiveTransform
Definition: itkTransform2D3D.h:130
GlobalAffineTransformType::Pointer m_GlobalAffineTransform
Definition: itkTransform2D3D.h:128
itk::Array2D< double > JacobianType
Definition: EulerAffine2DJacobianTest.cxx:28