go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkAdvancedIdentityTransform.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: itkIdentityTransform.h,v $
22  Language: C++
23  Date: $Date: 2009-06-28 14:41:47 $
24  Version: $Revision: 1.19 $
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 __itkAdvancedIdentityTransform_h
35 #define __itkAdvancedIdentityTransform_h
36 
37 #include "itkObject.h"
38 #include "itkPoint.h"
39 #include "itkVector.h"
40 #include "itkCovariantVector.h"
41 #include "vnl/vnl_vector_fixed.h"
42 #include "itkArray.h"
43 #include "itkArray2D.h"
44 #include "itkAdvancedTransform.h"
45 
46 #include "itkObjectFactory.h"
47 
48 namespace itk
49 {
50 
70 template< class TScalarType,
71 unsigned int NDimensions = 3 >
73  public AdvancedTransform< TScalarType, NDimensions, NDimensions >
74 {
75 public:
76 
79  typedef AdvancedTransform<
80  TScalarType, NDimensions, NDimensions > Superclass;
82  typedef SmartPointer< const Self > ConstPointer;
83 
85  itkNewMacro( Self );
86 
89 
91  itkStaticConstMacro( InputSpaceDimension, unsigned int, NDimensions );
92  itkStaticConstMacro( OutputSpaceDimension, unsigned int, NDimensions );
93  itkStaticConstMacro( ParametersDimension, unsigned int, 1 );
94 
97 
101  typedef typename Superclass::TransformCategoryType TransformCategoryType;
102 
105 
107  typedef Vector< TScalarType,
108  itkGetStaticConstMacro( InputSpaceDimension ) > InputVectorType;
109  typedef Vector< TScalarType,
110  itkGetStaticConstMacro( OutputSpaceDimension ) > OutputVectorType;
111 
113  typedef CovariantVector< TScalarType,
114  itkGetStaticConstMacro( InputSpaceDimension ) > InputCovariantVectorType;
115  typedef CovariantVector< TScalarType,
116  itkGetStaticConstMacro( OutputSpaceDimension ) > OutputCovariantVectorType;
117 
119  typedef vnl_vector_fixed< TScalarType,
120  itkGetStaticConstMacro( InputSpaceDimension ) > InputVnlVectorType;
121  typedef vnl_vector_fixed< TScalarType,
122  itkGetStaticConstMacro( OutputSpaceDimension ) > OutputVnlVectorType;
123 
125  typedef Point< TScalarType,
126  itkGetStaticConstMacro( InputSpaceDimension ) > InputPointType;
127  typedef Point< TScalarType,
128  itkGetStaticConstMacro( OutputSpaceDimension ) > OutputPointType;
129 
133  typedef typename InverseTransformBaseType::Pointer InverseTransformBasePointer;
134 
136  typedef typename Superclass
139  typedef typename Superclass
142  typedef typename Superclass
145 
147  virtual OutputPointType TransformPoint( const InputPointType & point ) const
148  { return point; }
149 
151  virtual OutputVectorType TransformVector( const InputVectorType & vector ) const
152  { return vector; }
153 
156  { return vector; }
157 
160  const InputCovariantVectorType & vector ) const
161  { return vector; }
162 
167  void SetIdentity( void ) {}
168 
171  {
172  return this->New().GetPointer();
173  }
174 
175 
181  virtual bool IsLinear() const { return true; }
182 
186  virtual TransformCategoryType GetTransformCategory() const
187  {
188  return Self::Linear;
189  }
190 
191 
193  virtual const ParametersType & GetFixedParameters( void ) const
194  {
195  return this->m_FixedParameters;
196  }
197 
198 
200  virtual void SetFixedParameters( const ParametersType & ) {}
201 
203  virtual const ParametersType & GetParameters( void ) const
204  {
205  return this->m_Parameters;
206  }
207 
208 
210  virtual void SetParameters( const ParametersType & ) {}
211 
213  virtual void GetJacobian(
214  const InputPointType &,
215  JacobianType & j,
216  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
217  {
218  j = this->m_LocalJacobian;
219  nonZeroJacobianIndices = this->m_NonZeroJacobianIndices;
220  }
221 
222 
224  virtual void GetSpatialJacobian(
225  const InputPointType &,
226  SpatialJacobianType & sj ) const
227  {
228  sj = this->m_SpatialJacobian;
229  }
230 
231 
233  virtual void GetSpatialHessian(
234  const InputPointType &,
235  SpatialHessianType & sh ) const
236  {
237  sh = this->m_SpatialHessian;
238  }
239 
240 
243  const InputPointType &,
245  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
246  {
247  jsj = this->m_JacobianOfSpatialJacobian;
248  nonZeroJacobianIndices = this->m_NonZeroJacobianIndices;
249  }
250 
251 
254  const InputPointType &,
255  SpatialJacobianType & sj,
257  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
258  {
259  sj = this->m_SpatialJacobian;
260  jsj = this->m_JacobianOfSpatialJacobian;
261  nonZeroJacobianIndices = this->m_NonZeroJacobianIndices;
262  }
263 
264 
267  const InputPointType &,
269  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
270  {
271  jsh = this->m_JacobianOfSpatialHessian;
272  nonZeroJacobianIndices = this->m_NonZeroJacobianIndices;
273  }
274 
275 
280  const InputPointType &,
281  SpatialHessianType & sh,
283  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
284  {
285  sh = this->m_SpatialHessian;
286  jsh = this->m_JacobianOfSpatialHessian;
287  nonZeroJacobianIndices = this->m_NonZeroJacobianIndices;
288  }
289 
290 
291 protected:
292 
294  AdvancedTransform< TScalarType, NDimensions, NDimensions >( NDimensions )
295  {
296  // The Jacobian is constant, therefore it can be initialized in the constructor.
297  this->m_LocalJacobian = JacobianType( NDimensions, 1 );
298  this->m_LocalJacobian.Fill( 0.0 );
299 
301  this->m_SpatialJacobian.SetIdentity();
302 
304  this->m_NonZeroJacobianIndices.resize( ParametersDimension );
305  for( unsigned int i = 0; i < ParametersDimension; ++i )
306  {
307  this->m_NonZeroJacobianIndices[ i ] = i;
308  }
309 
311  this->m_HasNonZeroSpatialHessian = false;
313  this->m_JacobianOfSpatialJacobian.resize( ParametersDimension );
314  this->m_JacobianOfSpatialHessian.resize( ParametersDimension );
315 
317  }
318 
319 
321 
322 private:
323 
324  AdvancedIdentityTransform( const Self & ); // purposely not implemented
325  void operator=( const Self & ); // purposely not implemented
326 
333 
334 };
335 
336 } // end namespace itk
337 
338 #endif
itk::AdvancedIdentityTransform::Superclass
AdvancedTransform< TScalarType, NDimensions, NDimensions > Superclass
Definition: itkAdvancedIdentityTransform.h:80
itk::AdvancedIdentityTransform::NumberOfParametersType
Superclass::NumberOfParametersType NumberOfParametersType
Definition: itkAdvancedIdentityTransform.h:100
itk::AdvancedIdentityTransform::GetInverseTransform
virtual InverseTransformBasePointer GetInverseTransform(void) const
Definition: itkAdvancedIdentityTransform.h:170
itk::AdvancedIdentityTransform::SetParameters
virtual void SetParameters(const ParametersType &)
Definition: itkAdvancedIdentityTransform.h:210
itk::AdvancedIdentityTransform::m_JacobianOfSpatialJacobian
JacobianOfSpatialJacobianType m_JacobianOfSpatialJacobian
Definition: itkAdvancedIdentityTransform.h:331
itk::AdvancedIdentityTransform::GetSpatialHessian
virtual void GetSpatialHessian(const InputPointType &, SpatialHessianType &sh) const
Definition: itkAdvancedIdentityTransform.h:233
itk::AdvancedIdentityTransform::GetJacobianOfSpatialJacobian
virtual void GetJacobianOfSpatialJacobian(const InputPointType &, JacobianOfSpatialJacobianType &jsj, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
Definition: itkAdvancedIdentityTransform.h:242
itk::AdvancedIdentityTransform::JacobianType
Superclass::JacobianType JacobianType
Definition: itkAdvancedIdentityTransform.h:104
itk::AdvancedIdentityTransform::InverseTransformBasePointer
InverseTransformBaseType::Pointer InverseTransformBasePointer
Definition: itkAdvancedIdentityTransform.h:133
itk::AdvancedIdentityTransform::GetJacobianOfSpatialHessian
virtual void GetJacobianOfSpatialHessian(const InputPointType &, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
Definition: itkAdvancedIdentityTransform.h:266
itk::AdvancedTransform< TScalarType, NDimensions, NDimensions >::SpatialJacobianType
Matrix< ScalarType, OutputSpaceDimension, InputSpaceDimension > SpatialJacobianType
Definition: itkAdvancedTransform.h:143
itk::AdvancedIdentityTransform::operator=
void operator=(const Self &)
itkAdvancedTransform.h
itk::AdvancedIdentityTransform::GetJacobianOfSpatialJacobian
virtual void GetJacobianOfSpatialJacobian(const InputPointType &, SpatialJacobianType &sj, JacobianOfSpatialJacobianType &jsj, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
Definition: itkAdvancedIdentityTransform.h:253
itk::AdvancedIdentityTransform::itkStaticConstMacro
itkStaticConstMacro(InputSpaceDimension, unsigned int, NDimensions)
SmartPointer< Self >
itk::AdvancedIdentityTransform::TransformVector
virtual OutputVectorType TransformVector(const InputVectorType &vector) const
Definition: itkAdvancedIdentityTransform.h:151
itk::AdvancedTransform< TScalarType, NDimensions, NDimensions >::JacobianOfSpatialHessianType
std::vector< SpatialHessianType > JacobianOfSpatialHessianType
Definition: itkAdvancedTransform.h:150
itk::AdvancedIdentityTransform::SetFixedParameters
virtual void SetFixedParameters(const ParametersType &)
Definition: itkAdvancedIdentityTransform.h:200
itk::AdvancedIdentityTransform
Implementation of an Identity Transform.
Definition: itkAdvancedIdentityTransform.h:74
itk::AdvancedIdentityTransform::InputVnlVectorType
vnl_vector_fixed< TScalarType, itkGetStaticConstMacro(InputSpaceDimension) > InputVnlVectorType
Definition: itkAdvancedIdentityTransform.h:120
itk::AdvancedIdentityTransform::m_LocalJacobian
JacobianType m_LocalJacobian
Definition: itkAdvancedIdentityTransform.h:327
itk::AdvancedIdentityTransform::InternalMatrixType
Superclass::InternalMatrixType InternalMatrixType
Definition: itkAdvancedIdentityTransform.h:144
itk::AdvancedIdentityTransform::JacobianOfSpatialJacobianType
Superclass ::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType
Definition: itkAdvancedIdentityTransform.h:140
itk::AdvancedIdentityTransform::InputCovariantVectorType
CovariantVector< TScalarType, itkGetStaticConstMacro(InputSpaceDimension) > InputCovariantVectorType
Definition: itkAdvancedIdentityTransform.h:114
itk::AdvancedIdentityTransform::OutputVectorType
Vector< TScalarType, itkGetStaticConstMacro(OutputSpaceDimension) > OutputVectorType
Definition: itkAdvancedIdentityTransform.h:110
itk::AdvancedIdentityTransform::New
static Pointer New()
itk::AdvancedIdentityTransform::Self
AdvancedIdentityTransform Self
Definition: itkAdvancedIdentityTransform.h:78
itk::AdvancedIdentityTransform::GetParameters
virtual const ParametersType & GetParameters(void) const
Definition: itkAdvancedIdentityTransform.h:203
itk::AdvancedIdentityTransform::GetJacobianOfSpatialHessian
virtual void GetJacobianOfSpatialHessian(const InputPointType &, SpatialHessianType &sh, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
Definition: itkAdvancedIdentityTransform.h:279
itk::AdvancedIdentityTransform::IsLinear
virtual bool IsLinear() const
Definition: itkAdvancedIdentityTransform.h:181
itk::AdvancedIdentityTransform::NonZeroJacobianIndicesType
Superclass ::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
Definition: itkAdvancedIdentityTransform.h:137
itk::AdvancedIdentityTransform::GetFixedParameters
virtual const ParametersType & GetFixedParameters(void) const
Definition: itkAdvancedIdentityTransform.h:193
itk::AdvancedIdentityTransform::GetSpatialJacobian
virtual void GetSpatialJacobian(const InputPointType &, SpatialJacobianType &sj) const
Definition: itkAdvancedIdentityTransform.h:224
itk::AdvancedIdentityTransform::m_NonZeroJacobianIndices
NonZeroJacobianIndicesType m_NonZeroJacobianIndices
Definition: itkAdvancedIdentityTransform.h:330
itk::AdvancedIdentityTransform::InputVectorType
Vector< TScalarType, itkGetStaticConstMacro(InputSpaceDimension) > InputVectorType
Definition: itkAdvancedIdentityTransform.h:108
itk::AdvancedTransform< TScalarType, NDimensions, NDimensions >::JacobianType
Superclass::JacobianType JacobianType
Definition: itkAdvancedTransform.h:115
itk::AdvancedIdentityTransform::ParametersType
Superclass::ParametersType ParametersType
Definition: itkAdvancedIdentityTransform.h:99
itk::AdvancedTransform
Transform maps points, vectors and covariant vectors from an input space to an output space.
Definition: itkAdvancedTransform.h:87
itk::AdvancedIdentityTransform::TransformVector
virtual OutputVnlVectorType TransformVector(const InputVnlVectorType &vector) const
Definition: itkAdvancedIdentityTransform.h:155
itk::AdvancedTransform< TScalarType, NDimensions, NDimensions >::InternalMatrixType
SpatialJacobianType::InternalMatrixType InternalMatrixType
Definition: itkAdvancedTransform.h:151
itk::AdvancedIdentityTransform::OutputVnlVectorType
vnl_vector_fixed< TScalarType, itkGetStaticConstMacro(OutputSpaceDimension) > OutputVnlVectorType
Definition: itkAdvancedIdentityTransform.h:122
itk::AdvancedIdentityTransform::OutputPointType
Point< TScalarType, itkGetStaticConstMacro(OutputSpaceDimension) > OutputPointType
Definition: itkAdvancedIdentityTransform.h:128
itk::AdvancedIdentityTransform::InputPointType
Point< TScalarType, itkGetStaticConstMacro(InputSpaceDimension) > InputPointType
Definition: itkAdvancedIdentityTransform.h:126
itk::AdvancedIdentityTransform::GetTransformCategory
virtual TransformCategoryType GetTransformCategory() const
Definition: itkAdvancedIdentityTransform.h:186
itk::AdvancedTransform< TScalarType, NDimensions, NDimensions >::SpatialHessianType
FixedArray< Matrix< ScalarType, InputSpaceDimension, InputSpaceDimension >, OutputSpaceDimension > SpatialHessianType
Definition: itkAdvancedTransform.h:149
itk::AdvancedIdentityTransform::ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAdvancedIdentityTransform.h:82
itk::AdvancedIdentityTransform::m_JacobianOfSpatialHessian
JacobianOfSpatialHessianType m_JacobianOfSpatialHessian
Definition: itkAdvancedIdentityTransform.h:332
itk::AdvancedIdentityTransform::JacobianOfSpatialHessianType
Superclass ::JacobianOfSpatialHessianType JacobianOfSpatialHessianType
Definition: itkAdvancedIdentityTransform.h:143
itk::AdvancedIdentityTransform::AdvancedIdentityTransform
AdvancedIdentityTransform(const Self &)
itk::AdvancedTransform< TScalarType, NDimensions, NDimensions >::JacobianOfSpatialJacobianType
std::vector< SpatialJacobianType > JacobianOfSpatialJacobianType
Definition: itkAdvancedTransform.h:144
itk::AdvancedIdentityTransform::m_SpatialJacobian
SpatialJacobianType m_SpatialJacobian
Definition: itkAdvancedIdentityTransform.h:328
itk::AdvancedTransform< TScalarType, NDimensions, NDimensions >::NonZeroJacobianIndicesType
std::vector< unsigned long > NonZeroJacobianIndicesType
Definition: itkAdvancedTransform.h:141
itk::AdvancedIdentityTransform::~AdvancedIdentityTransform
virtual ~AdvancedIdentityTransform()
Definition: itkAdvancedIdentityTransform.h:320
itk::AdvancedIdentityTransform::m_SpatialHessian
SpatialHessianType m_SpatialHessian
Definition: itkAdvancedIdentityTransform.h:329
itk::AdvancedIdentityTransform::itkStaticConstMacro
itkStaticConstMacro(OutputSpaceDimension, unsigned int, NDimensions)
itk
Definition: itkAdvancedImageToImageMetric.h:40
itk::AdvancedIdentityTransform::SpatialHessianType
Superclass::SpatialHessianType SpatialHessianType
Definition: itkAdvancedIdentityTransform.h:141
itk::AdvancedIdentityTransform::InverseTransformBaseType
Superclass::InverseTransformBaseType InverseTransformBaseType
Definition: itkAdvancedIdentityTransform.h:132
itk::AdvancedIdentityTransform::Pointer
SmartPointer< Self > Pointer
Definition: itkAdvancedIdentityTransform.h:81
itk::AdvancedTransform< TScalarType, NDimensions, NDimensions >::NumberOfParametersType
Superclass::NumberOfParametersType NumberOfParametersType
Definition: itkAdvancedTransform.h:113
itk::AdvancedIdentityTransform::SpatialJacobianType
Superclass::SpatialJacobianType SpatialJacobianType
Definition: itkAdvancedIdentityTransform.h:138
itk::AdvancedTransform< TScalarType, NDimensions, NDimensions >::InverseTransformBaseType
Superclass::InverseTransformBaseType InverseTransformBaseType
Definition: itkAdvancedTransform.h:127
itk::AdvancedIdentityTransform::GetJacobian
virtual void GetJacobian(const InputPointType &, JacobianType &j, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
Definition: itkAdvancedIdentityTransform.h:213
itk::AdvancedTransform< TScalarType, 3, 3 >::m_HasNonZeroJacobianOfSpatialHessian
bool m_HasNonZeroJacobianOfSpatialHessian
Definition: itkAdvancedTransform.h:320
TScalarType
itk::AdvancedIdentityTransform::TransformPoint
virtual OutputPointType TransformPoint(const InputPointType &point) const
Definition: itkAdvancedIdentityTransform.h:147
itk::AdvancedIdentityTransform::AdvancedIdentityTransform
AdvancedIdentityTransform()
Definition: itkAdvancedIdentityTransform.h:293
itk::AdvancedIdentityTransform::SetIdentity
void SetIdentity(void)
Definition: itkAdvancedIdentityTransform.h:167
itk::AdvancedTransform< TScalarType, NDimensions, NDimensions >::ParametersType
Superclass::ParametersType ParametersType
Definition: itkAdvancedTransform.h:110
itk::AdvancedIdentityTransform::itkStaticConstMacro
itkStaticConstMacro(ParametersDimension, unsigned int, 1)
itk::AdvancedIdentityTransform::ScalarType
TScalarType ScalarType
Definition: itkAdvancedIdentityTransform.h:96
itk::AdvancedIdentityTransform::TransformCategoryType
Superclass::TransformCategoryType TransformCategoryType
Definition: itkAdvancedIdentityTransform.h:101
itk::AdvancedIdentityTransform::OutputCovariantVectorType
CovariantVector< TScalarType, itkGetStaticConstMacro(OutputSpaceDimension) > OutputCovariantVectorType
Definition: itkAdvancedIdentityTransform.h:116
itk::AdvancedTransform< TScalarType, 3, 3 >::m_HasNonZeroSpatialHessian
bool m_HasNonZeroSpatialHessian
Definition: itkAdvancedTransform.h:319
itk::AdvancedIdentityTransform::TransformCovariantVector
virtual OutputCovariantVectorType TransformCovariantVector(const InputCovariantVectorType &vector) const
Definition: itkAdvancedIdentityTransform.h:159


Generated on OURCE_DATE_EPOCH for elastix by doxygen 1.8.18 elastix logo