ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkRigid3DPerspectiveTransform.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkRigid3DPerspectiveTransform_h
19 #define __itkRigid3DPerspectiveTransform_h
20 
21 #include "itkMacro.h"
22 #include "vnl/vnl_quaternion.h"
23 #include <iostream>
24 #include "itkTransform.h"
25 #include "itkVersor.h"
26 
27 namespace itk
28 {
37 template< typename TScalar = double >
38 // Data type for scalars (float or double)
40  public Transform< TScalar, 3, 2 >
41 {
42 public:
44  itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
45  itkStaticConstMacro(OutputSpaceDimension, unsigned int, 2);
47 
49  itkStaticConstMacro(SpaceDimension, unsigned int, 3);
50  itkStaticConstMacro(ParametersDimension, unsigned int, 6);
52 
55  typedef Transform<TScalar,
56  itkGetStaticConstMacro(InputSpaceDimension),
57  itkGetStaticConstMacro(OutputSpaceDimension)> Superclass;
59 
62 
65 
67  itkNewMacro(Self);
68 
70  typedef typename Superclass::ScalarType ScalarType;
71 
74  typedef typename ParametersType::ValueType ParameterValueType;
75 
78 
80  typedef Matrix<TScalar, itkGetStaticConstMacro(InputSpaceDimension),
81  itkGetStaticConstMacro(InputSpaceDimension)> MatrixType;
82 
86 
91 
95 
100 
102  typedef vnl_quaternion<TScalar> VnlQuaternionType;
103 
107 
113 
117  const OffsetType & GetOffset() const
118  {
119  return m_Offset;
120  }
121 
125  const VersorType & GetRotation() const
126  {
127  return m_Versor;
128  }
129 
134  void SetParameters(const ParametersType & parameters);
135 
136  const ParametersType & GetParameters() const;
137 
141  virtual void SetFixedParameters(const ParametersType &)
142  {
143  }
144 
147  void SetOffset(const OffsetType & offset)
148  {
149  m_Offset = offset; return;
150  }
151 
154  void SetRotation(const VersorType & rotation);
155 
160  void SetRotation(const Vector<TScalar, 3> & axis, double angle);
161 
165  void SetFocalDistance(TScalar focalDistance)
166  {
167  m_FocalDistance = focalDistance;
168  }
169 
171  double GetFocalDistance(void) const
172  {
173  return m_FocalDistance;
174  }
175 
179  OutputPointType TransformPoint(const InputPointType & point) const;
180 
183 
185  {
186  itkExceptionMacro(
187  << "TransformVector(const InputVectorType &) is not implemented for Rigid3DPerspectiveTransform");
188  }
189 
191  {
192  itkExceptionMacro(
193  << "TransformVector(const InputVnlVectorType &) is not implemented for Rigid3DPerspectiveTransform");
194  }
195 
197 
199  {
200  itkExceptionMacro(
201  <<
202  "TransformCovariantVector(const InputCovariantVectorType &) is not implemented for Rigid3DPerspectiveTransform");
203  }
204 
207  {
208  return m_RotationMatrix;
209  }
210 
212  void ComputeMatrix(void);
213 
216  virtual void ComputeJacobianWithRespectToParameters( const InputPointType & p, JacobianType & jacobian) const;
217 
219  JacobianType &) const
220  {
221  itkExceptionMacro( "ComputeJacobianWithRespectToPosition not yet implemented "
222  "for " << this->GetNameOfClass() );
223  }
224 
226  itkGetConstReferenceMacro(FixedOffset, OffsetType);
227  itkSetMacro(FixedOffset, OffsetType);
229 
231  itkSetMacro(CenterOfRotation, InputPointType);
232  itkGetConstReferenceMacro(CenterOfRotation, InputPointType);
234 
235 protected:
238  void PrintSelf(std::ostream & os, Indent indent) const;
239 
240 private:
241  Rigid3DPerspectiveTransform(const Self &); // purposely not implemented
242  void operator=(const Self &); // purposely not implemented
243 
246 
249 
252 
255 
258 
261 }; // class Rigid3DPerspectiveTransform:
262 } // namespace itk
263 
264 #ifndef ITK_MANUAL_INSTANTIATION
265 #include "itkRigid3DPerspectiveTransform.hxx"
266 #endif
267 
268 #endif /* __itkRigid3DPerspectiveTransform_h */
virtual OutputCovariantVectorType TransformCovariantVector(const InputCovariantVectorType &) const
Definition: itkTransform.h:238
virtual void ComputeJacobianWithRespectToPosition(const InputPointType &, JacobianType &) const
A templated class holding a M x N size Matrix.
Definition: itkMatrix.h:46
vnl_vector_fixed< TScalar, NInputDimensions > InputVnlVectorType
Definition: itkTransform.h:151
Light weight base class for most itk classes.
Array2D< ParametersValueType > JacobianType
Definition: itkTransform.h:123
void SetParameters(const ParametersType &parameters)
Point< TScalar, itkGetStaticConstMacro(OutputSpaceDimension)> OutputPointType
Superclass::InputVnlVectorType InputVnlVectorType
Superclass::InputCovariantVectorType InputCovariantVectorType
OutputPointType TransformPoint(const InputPointType &point) const
Superclass::ParametersType ParametersType
Definition: itkTransform.h:118
virtual OutputCovariantVectorType TransformCovariantVector(const InputCovariantVectorType &) const
virtual OutputVnlVectorType TransformVector(const InputVnlVectorType &) const
const ParametersType & GetParameters() const
CovariantVector< TScalar, NOutputDimensions > OutputCovariantVectorType
Definition: itkTransform.h:148
void PrintSelf(std::ostream &os, Indent indent) const
CovariantVector< TScalar, NInputDimensions > InputCovariantVectorType
Definition: itkTransform.h:146
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:82
Matrix< TScalar, itkGetStaticConstMacro(InputSpaceDimension), itkGetStaticConstMacro(InputSpaceDimension)> MatrixType
Superclass::OutputCovariantVectorType OutputCovariantVectorType
Vector< TScalar, itkGetStaticConstMacro(OutputSpaceDimension)> OutputVectorType
virtual void SetFixedParameters(const ParametersType &)
Point< TScalar, itkGetStaticConstMacro(InputSpaceDimension)> InputPointType
virtual OutputVectorType TransformVector(const InputVectorType &) const
Definition: itkTransform.h:192
virtual void ComputeJacobianWithRespectToParameters(const InputPointType &p, JacobianType &jacobian) const
Rigid3DTramsform of a vector space (e.g. space coordinates)
void SetRotation(const VersorType &rotation)
Vector< TScalar, itkGetStaticConstMacro(InputSpaceDimension)> OffsetType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Vector< TScalar, itkGetStaticConstMacro(InputSpaceDimension)> InputVectorType
vnl_vector_fixed< TScalar, NOutputDimensions > OutputVnlVectorType
Definition: itkTransform.h:152
virtual const char * GetNameOfClass() const
Transform< TScalar, itkGetStaticConstMacro(InputSpaceDimension), itkGetStaticConstMacro(OutputSpaceDimension)> Superclass
TScalar ScalarType
Definition: itkTransform.h:115
virtual OutputVectorType TransformVector(const InputVectorType &) const
Superclass::OutputVnlVectorType OutputVnlVectorType