go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
Components/Transforms/TranslationStackTransform/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 
35 #ifndef __itkAdvancedTranslationTransform_h
36 #define __itkAdvancedTranslationTransform_h
37 
38 #include <iostream>
39 #include "itkAdvancedTransform.h"
40 #include "itkMacro.h"
41 #include "itkMatrix.h"
42 
43 namespace itk
44 {
45 
53 template<
54  class TScalarType = double, // Data type for scalars (float or double)
55  unsigned int NDimensions = 3 > // Number of dimensions
56 class ITK_EXPORT AdvancedTranslationTransform :
57  public AdvancedTransform< TScalarType, NDimensions, NDimensions >
58 {
59 public:
60 
64  typedef SmartPointer< Self > Pointer;
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 
86 
88  typedef Vector< TScalarType, itkGetStaticConstMacro( SpaceDimension ) > InputVectorType;
89  typedef Vector< TScalarType, itkGetStaticConstMacro( SpaceDimension ) > OutputVectorType;
90 
92  typedef CovariantVector< TScalarType, itkGetStaticConstMacro( SpaceDimension ) > InputCovariantVectorType;
93  typedef CovariantVector< TScalarType, itkGetStaticConstMacro( SpaceDimension ) > OutputCovariantVectorType;
94 
96  typedef vnl_vector_fixed< TScalarType, itkGetStaticConstMacro( SpaceDimension ) > InputVnlVectorType;
97  typedef vnl_vector_fixed< TScalarType, itkGetStaticConstMacro( SpaceDimension ) > OutputVnlVectorType;
98 
100  typedef Point< TScalarType, itkGetStaticConstMacro( SpaceDimension ) > InputPointType;
101  typedef Point< TScalarType, itkGetStaticConstMacro( SpaceDimension ) > OutputPointType;
102 
104  typedef typename Superclass
105  ::NonZeroJacobianIndicesType NonZeroJacobianIndicesType;
107  typedef typename Superclass
108  ::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType;
110  typedef typename Superclass
111  ::JacobianOfSpatialHessianType JacobianOfSpatialHessianType;
113 
117  const OutputVectorType & GetOffset( void ) const
118  { return m_Offset; }
119 
122  void SetParameters( const ParametersType & parameters ) override;
123 
125  const ParametersType & GetParameters( void ) const override;
126 
130  void SetOffset( const OutputVectorType & offset )
131  { m_Offset = offset; return; }
132 
134  void Compose( const Self * other, bool pre = 0 );
135 
140  void Translate( const OutputVectorType & offset, bool pre = 0 );
141 
146  OutputPointType TransformPoint( const InputPointType & point ) const override;
147 
148  OutputVectorType TransformVector( const InputVectorType & vector ) const override;
149 
150  OutputVnlVectorType TransformVector( const InputVnlVectorType & vector ) const override;
151 
153  const InputCovariantVectorType & vector ) const override;
154 
158  inline InputPointType BackTransform( const OutputPointType & point ) const;
159 
160  inline InputVectorType BackTransform( const OutputVectorType & vector ) const;
161 
162  inline InputVnlVectorType BackTransform( const OutputVnlVectorType & vector ) const;
163 
165  const OutputCovariantVectorType & vector ) const;
166 
171  bool GetInverse( Self * inverse ) const;
172 
175  const InputPointType &,
176  JacobianType &,
177  NonZeroJacobianIndicesType & ) const override;
178 
181  const InputPointType &,
182  SpatialJacobianType & ) const override;
183 
186  const InputPointType &,
187  SpatialHessianType & ) const override;
188 
191  const InputPointType &,
193  NonZeroJacobianIndicesType & ) const override;
194 
197  const InputPointType &,
200  NonZeroJacobianIndicesType & ) const override;
201 
204  const InputPointType &,
206  NonZeroJacobianIndicesType & ) const override;
207 
212  const InputPointType & ipp,
213  SpatialHessianType & sh,
215  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const override;
216 
218  void SetIdentity( void );
219 
222  { return NDimensions; }
223 
229  bool IsLinear() const override { return true; }
230 
234  void SetFixedParameters( const ParametersType & ) override
235  { /* purposely blank */ }
236 
240  const ParametersType & GetFixedParameters( void ) const override
241  {
242  this->m_FixedParameters.SetSize( 0 );
243  return this->m_FixedParameters;
244  }
245 
246 
247 protected:
248 
252  void PrintSelf( std::ostream & os, Indent indent ) const override;
253 
254 private:
255 
256  AdvancedTranslationTransform( const Self & ); // purposely not implemented
257  void operator=( const Self & ); // purposely not implemented
258 
259  OutputVectorType m_Offset; // Offset of the transformation
260 
261  JacobianType m_LocalJacobian;
262  SpatialJacobianType m_SpatialJacobian;
263  SpatialHessianType m_SpatialHessian;
264  NonZeroJacobianIndicesType m_NonZeroJacobianIndices;
265  JacobianOfSpatialJacobianType m_JacobianOfSpatialJacobian;
266  JacobianOfSpatialHessianType m_JacobianOfSpatialHessian;
267 
268 };
269 
270 //class AdvancedTranslationTransform
271 
272 // Back transform a point
273 template< class TScalarType, unsigned int NDimensions >
274 inline
277 ::BackTransform( const OutputPointType & point ) const
278 {
279  return point - m_Offset;
280 }
281 
282 
283 // Back transform a vector
284 template< class TScalarType, unsigned int NDimensions >
285 inline
288 ::BackTransform( const OutputVectorType & vect ) const
289 {
290  return vect;
291 }
292 
293 
294 // Back transform a vnl_vector
295 template< class TScalarType, unsigned int NDimensions >
296 inline
299 ::BackTransform( const OutputVnlVectorType & vect ) const
300 {
301  return vect;
302 }
303 
304 
305 // Back Transform a CovariantVector
306 template< class TScalarType, unsigned int NDimensions >
307 inline
310 ::BackTransform( const OutputCovariantVectorType & vect ) const
311 {
312  return vect;
313 }
314 
315 
316 } // namespace itk
317 
318 #ifndef ITK_MANUAL_INSTANTIATION
319 #include "itkAdvancedTranslationTransform.txx"
320 #endif
321 
322 #endif /* __itkAdvancedTranslationTransform_h */
FixedArray< Matrix< ScalarType, InputSpaceDimension, InputSpaceDimension >, OutputSpaceDimension > SpatialHessianType
Matrix< ScalarType, OutputSpaceDimension, InputSpaceDimension > SpatialJacobianType
Translation transformation of a vector space (e.g. space coordinates)
void GetSpatialJacobian(const InputPointType &, SpatialJacobianType &) const override
void GetSpatialHessian(const InputPointType &, SpatialHessianType &) const override
InputCovariantVectorType BackTransform(const OutputCovariantVectorType &vector) const
vnl_vector_fixed< TScalarType, itkGetStaticConstMacro(SpaceDimension) > InputVnlVectorType
void SetParameters(const ParametersType &parameters) override
OutputVectorType TransformVector(const InputVectorType &vector) const override
itkStaticConstMacro(SpaceDimension, unsigned int, NDimensions)
CovariantVector< TScalarType, itkGetStaticConstMacro(SpaceDimension) > InputCovariantVectorType
OutputCovariantVectorType TransformCovariantVector(const InputCovariantVectorType &vector) const override
void GetJacobianOfSpatialHessian(const InputPointType &ipp, SpatialHessianType &sh, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const override
void PrintSelf(std::ostream &os, Indent indent) const override
vnl_vector_fixed< TScalarType, itkGetStaticConstMacro(SpaceDimension) > OutputVnlVectorType
CovariantVector< TScalarType, itkGetStaticConstMacro(SpaceDimension) > OutputCovariantVectorType
void GetJacobianOfSpatialHessian(const InputPointType &, JacobianOfSpatialHessianType &, NonZeroJacobianIndicesType &) const override
InputVnlVectorType BackTransform(const OutputVnlVectorType &vector) const
InputPointType BackTransform(const OutputPointType &point) const
void Compose(const Self *other, bool pre=0)
void Translate(const OutputVectorType &offset, bool pre=0)
OutputVnlVectorType TransformVector(const InputVnlVectorType &vector) const override
const ParametersType & GetParameters(void) const override
InputPointType BackTransform(const OutputPointType &point) const
AdvancedTranslationTransform(const Self &)
void GetJacobian(const InputPointType &, JacobianType &, NonZeroJacobianIndicesType &) const override
void GetJacobianOfSpatialJacobian(const InputPointType &, JacobianOfSpatialJacobianType &, NonZeroJacobianIndicesType &) const override
Vector< TScalarType, itkGetStaticConstMacro(SpaceDimension) > OutputVectorType
InputVectorType BackTransform(const OutputVectorType &vector) const
OutputPointType TransformPoint(const InputPointType &point) const override
bool GetInverse(Self *inverse) const
itkStaticConstMacro(ParametersDimension, unsigned int, NDimensions)
void GetJacobianOfSpatialJacobian(const InputPointType &, SpatialJacobianType &, JacobianOfSpatialJacobianType &, NonZeroJacobianIndicesType &) const override


Generated on 1641078589 for elastix by doxygen 1.9.1 elastix logo