go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkAdvancedTranslationTransform.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright UMC Utrecht and contributors
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 /*=========================================================================
19 
20  Program: Insight Segmentation & Registration Toolkit
21  Module: $RCSfile: itkAdvancedTranslationTransform.h,v $
22  Language: C++
23  Date: $Date: 2007-07-15 16:38:25 $
24  Version: $Revision: 1.36 $
25 
26  Copyright (c) Insight Software Consortium. All rights reserved.
27  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
28 
29  This software is distributed WITHOUT ANY WARRANTY; without even
30  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
31  PURPOSE. See the above copyright notices for more information.
32 
33 =========================================================================*/
34 #ifndef __itkAdvancedTranslationTransform_h
35 #define __itkAdvancedTranslationTransform_h
36 
37 #include <iostream>
38 #include "itkAdvancedTransform.h"
39 #include "itkExceptionObject.h"
40 #include "itkMatrix.h"
41 
42 namespace itk
43 {
44 
52 template<
53 class TScalarType = double, // Data type for scalars (float or double)
54 unsigned int NDimensions = 3 >
55 // Number of dimensions
56 class ITK_EXPORT AdvancedTranslationTransform :
57  public AdvancedTransform< TScalarType, NDimensions, NDimensions >
58 {
59 public:
60 
65  typedef SmartPointer< const Self > ConstPointer;
66 
68  itkNewMacro( Self );
69 
72 
74  itkStaticConstMacro( SpaceDimension, unsigned int, NDimensions );
75  itkStaticConstMacro( ParametersDimension, unsigned int, NDimensions );
76 
79 
83  typedef typename Superclass::TransformCategoryType TransformCategoryType;
84 
86  typedef typename Superclass::JacobianType JacobianType;
87 
89  typedef Vector< TScalarType, itkGetStaticConstMacro( SpaceDimension ) > InputVectorType;
90  typedef Vector< TScalarType, itkGetStaticConstMacro( SpaceDimension ) > OutputVectorType;
91 
93  typedef CovariantVector< TScalarType, itkGetStaticConstMacro( SpaceDimension ) > InputCovariantVectorType;
94  typedef CovariantVector< TScalarType, itkGetStaticConstMacro( SpaceDimension ) > OutputCovariantVectorType;
95 
97  typedef vnl_vector_fixed< TScalarType, itkGetStaticConstMacro( SpaceDimension ) > InputVnlVectorType;
98  typedef vnl_vector_fixed< TScalarType, itkGetStaticConstMacro( SpaceDimension ) > OutputVnlVectorType;
99 
101  typedef Point< TScalarType, itkGetStaticConstMacro( SpaceDimension ) > InputPointType;
102  typedef Point< TScalarType, itkGetStaticConstMacro( SpaceDimension ) > OutputPointType;
103 
105  typedef typename Superclass
106  ::NonZeroJacobianIndicesType NonZeroJacobianIndicesType;
107  typedef typename Superclass::SpatialJacobianType SpatialJacobianType;
108  typedef typename Superclass
109  ::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType;
110  typedef typename Superclass::SpatialHessianType SpatialHessianType;
111  typedef typename Superclass
112  ::JacobianOfSpatialHessianType JacobianOfSpatialHessianType;
114 
118  const OutputVectorType & GetOffset( void ) const
119  { return m_Offset; }
120 
123  void SetParameters( const ParametersType & parameters );
124 
126  virtual const ParametersType & GetParameters( void ) const;
127 
131  void SetOffset( const OutputVectorType & offset )
132  { m_Offset = offset; return; }
133 
135  void Compose( const Self * other, bool pre = 0 );
136 
141  void Translate( const OutputVectorType & offset, bool pre = 0 );
142 
147  OutputPointType TransformPoint( const InputPointType & point ) const;
148 
149  OutputVectorType TransformVector( const InputVectorType & vector ) const;
150 
151  OutputVnlVectorType TransformVector( const InputVnlVectorType & vector ) const;
152 
153  OutputCovariantVectorType TransformCovariantVector(
154  const InputCovariantVectorType & vector ) const;
155 
159  inline InputPointType BackTransform( const OutputPointType & point ) const;
160 
161  inline InputVectorType BackTransform( const OutputVectorType & vector ) const;
162 
163  inline InputVnlVectorType BackTransform( const OutputVnlVectorType & vector ) const;
164 
165  inline InputCovariantVectorType BackTransform(
166  const OutputCovariantVectorType & vector ) const;
167 
172  bool GetInverse( Self * inverse ) const;
173 
175  virtual void GetJacobian(
176  const InputPointType &,
177  JacobianType &,
178  NonZeroJacobianIndicesType & ) const;
179 
181  virtual void GetSpatialJacobian(
182  const InputPointType &,
183  SpatialJacobianType & ) const;
184 
186  virtual void GetSpatialHessian(
187  const InputPointType &,
188  SpatialHessianType & ) const;
189 
191  virtual void GetJacobianOfSpatialJacobian(
192  const InputPointType &,
193  JacobianOfSpatialJacobianType &,
194  NonZeroJacobianIndicesType & ) const;
195 
197  virtual void GetJacobianOfSpatialJacobian(
198  const InputPointType &,
199  SpatialJacobianType &,
200  JacobianOfSpatialJacobianType &,
201  NonZeroJacobianIndicesType & ) const;
202 
204  virtual void GetJacobianOfSpatialHessian(
205  const InputPointType &,
206  JacobianOfSpatialHessianType &,
207  NonZeroJacobianIndicesType & ) const;
208 
212  virtual void GetJacobianOfSpatialHessian(
213  const InputPointType & ipp,
214  SpatialHessianType & sh,
215  JacobianOfSpatialHessianType & jsh,
216  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const;
217 
219  void SetIdentity( void );
220 
222  virtual NumberOfParametersType GetNumberOfParameters( void ) const
223  { return NDimensions; }
224 
230  virtual bool IsLinear() const { return true; }
231 
235  virtual TransformCategoryType GetTransformCategory() const
236  {
237  return Self::Linear;
238  }
239 
240 
244  virtual void SetFixedParameters( const ParametersType & )
245  { /* purposely blank */ }
246 
250  virtual const ParametersType & GetFixedParameters( void ) const
251  {
252  this->m_FixedParameters.SetSize( 0 );
253  return this->m_FixedParameters;
254  }
255 
256 
257 protected:
258 
262  void PrintSelf( std::ostream & os, Indent indent ) const;
263 
264 private:
265 
266  AdvancedTranslationTransform( const Self & ); //purposely not implemented
267  void operator=( const Self & ); //purposely not implemented
268 
269  OutputVectorType m_Offset; // Offset of the transformation
270 
271  JacobianType m_LocalJacobian;
272  SpatialJacobianType m_SpatialJacobian;
273  SpatialHessianType m_SpatialHessian;
274  NonZeroJacobianIndicesType m_NonZeroJacobianIndices;
275  JacobianOfSpatialJacobianType m_JacobianOfSpatialJacobian;
276  JacobianOfSpatialHessianType m_JacobianOfSpatialHessian;
277 
278 };
279 
280 //class AdvancedTranslationTransform
281 
282 // Back transform a point
283 template< class TScalarType, unsigned int NDimensions >
284 inline
287 {
288  return point - m_Offset;
289 }
290 
291 
292 // Back transform a vector
293 template< class TScalarType, unsigned int NDimensions >
294 inline
297 {
298  return vect;
299 }
300 
301 
302 // Back transform a vnl_vector
303 template< class TScalarType, unsigned int NDimensions >
304 inline
307 {
308  return vect;
309 }
310 
311 
312 // Back Transform a CovariantVector
313 template< class TScalarType, unsigned int NDimensions >
314 inline
317 {
318  return vect;
319 }
320 
321 
322 } // namespace itk
323 
324 #ifndef ITK_MANUAL_INSTANTIATION
325 #include "itkAdvancedTranslationTransform.hxx"
326 #endif
327 
328 #endif /* __itkAdvancedTranslationTransform_h */
JacobianOfSpatialHessianType m_JacobianOfSpatialHessian
Superclass::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType
Superclass::NumberOfParametersType NumberOfParametersType
virtual TransformCategoryType GetTransformCategory() const
Vector< TScalarType, itkGetStaticConstMacro(SpaceDimension) > OutputVectorType
Vector< TScalarType, itkGetStaticConstMacro(SpaceDimension) > InputVectorType
Superclass::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
Superclass::JacobianOfSpatialHessianType JacobianOfSpatialHessianType
virtual void SetFixedParameters(const ParametersType &)
Superclass::TransformCategoryType TransformCategoryType
JacobianOfSpatialJacobianType m_JacobianOfSpatialJacobian
void SetOffset(const OutputVectorType &offset)
Superclass::SpatialJacobianType SpatialJacobianType
Transform maps points, vectors and covariant vectors from an input space to an output space...
const OutputVectorType & GetOffset(void) const
virtual const ParametersType & GetFixedParameters(void) const
InputPointType BackTransform(const OutputPointType &point) const
vnl_vector_fixed< TScalarType, itkGetStaticConstMacro(SpaceDimension) > InputVnlVectorType
CovariantVector< TScalarType, itkGetStaticConstMacro(SpaceDimension) > InputCovariantVectorType
Translation transformation of a vector space (e.g. space coordinates)
Superclass::InternalMatrixType InternalMatrixType
CovariantVector< TScalarType, itkGetStaticConstMacro(SpaceDimension) > OutputCovariantVectorType
Superclass::SpatialHessianType SpatialHessianType
AdvancedTransform< TScalarType, NDimensions, NDimensions > Superclass
vnl_vector_fixed< TScalarType, itkGetStaticConstMacro(SpaceDimension) > OutputVnlVectorType
Point< TScalarType, itkGetStaticConstMacro(SpaceDimension) > InputPointType
Point< TScalarType, itkGetStaticConstMacro(SpaceDimension) > OutputPointType
virtual NumberOfParametersType GetNumberOfParameters(void) const


Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo