go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkAdvancedTransform.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: itkTransform.h,v $
22  Language: C++
23  Date: $Date: 2008-06-29 12:58:58 $
24  Version: $Revision: 1.64 $
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 __itkAdvancedTransform_h
35 #define __itkAdvancedTransform_h
36 
37 #include "itkTransform.h"
38 #include "itkMatrix.h"
39 #include "itkFixedArray.h"
40 
41 namespace itk
42 {
43 
82 template< class TScalarType,
83 unsigned int NInputDimensions = 3,
84 unsigned int NOutputDimensions = 3 >
86  public Transform< TScalarType, NInputDimensions, NOutputDimensions >
87 {
88 public:
89 
92  typedef Transform< TScalarType,
93  NInputDimensions,
94  NOutputDimensions > Superclass;
96  typedef SmartPointer< const Self > ConstPointer;
97 
99  //itkNewMacro( Self );
100 
102  itkTypeMacro( AdvancedTransform, Transform );
103 
105  itkStaticConstMacro( InputSpaceDimension, unsigned int, NInputDimensions );
106  itkStaticConstMacro( OutputSpaceDimension, unsigned int, NOutputDimensions );
107 
109  typedef typename Superclass::ScalarType ScalarType;
110  typedef typename Superclass::ParametersType ParametersType;
111  typedef typename Superclass::FixedParametersType FixedParametersType;
112  typedef typename Superclass::ParametersValueType ParametersValueType;
113  typedef typename Superclass::NumberOfParametersType NumberOfParametersType;
114  typedef typename Superclass::DerivativeType DerivativeType;
115  typedef typename Superclass::JacobianType JacobianType;
116  typedef typename Superclass::InputVectorType InputVectorType;
117  typedef typename Superclass::OutputVectorType OutputVectorType;
118  typedef typename Superclass
119  ::InputCovariantVectorType InputCovariantVectorType;
120  typedef typename Superclass
121  ::OutputCovariantVectorType OutputCovariantVectorType;
122  typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
123  typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
124  typedef typename Superclass::InputPointType InputPointType;
125  typedef typename Superclass::OutputPointType OutputPointType;
126 
127  typedef typename Superclass::InverseTransformBaseType InverseTransformBaseType;
128  typedef typename Superclass::InverseTransformBasePointer InverseTransformBasePointer;
129 
131  typedef Transform< TScalarType,
132  NInputDimensions,
133  NOutputDimensions > TransformType;
134  typedef typename TransformType::Pointer TransformTypePointer;
135  typedef typename TransformType::ConstPointer TransformTypeConstPointer;
136 
141  typedef std::vector< unsigned long > NonZeroJacobianIndicesType;
142  typedef Matrix< ScalarType,
143  OutputSpaceDimension, InputSpaceDimension > SpatialJacobianType;
144  typedef std::vector< SpatialJacobianType > JacobianOfSpatialJacobianType;
145  // \todo: think about the SpatialHessian type, should be a 3D native type
146  typedef FixedArray<
147  Matrix< ScalarType,
148  InputSpaceDimension, InputSpaceDimension >,
149  OutputSpaceDimension > SpatialHessianType;
150  typedef std::vector< SpatialHessianType > JacobianOfSpatialHessianType;
151  typedef typename SpatialJacobianType::InternalMatrixType InternalMatrixType;
152 
158  typedef OutputCovariantVectorType MovingImageGradientType;
159  typedef typename MovingImageGradientType::ValueType MovingImageGradientValueType;
160 
162  virtual NumberOfParametersType GetNumberOfNonZeroJacobianIndices( void ) const;
163 
165  itkGetConstMacro( HasNonZeroSpatialHessian, bool );
166  itkGetConstMacro( HasNonZeroJacobianOfSpatialHessian, bool );
167 
194  virtual void GetJacobian(
195  const InputPointType & ipp,
196  JacobianType & j,
197  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const = 0;
198 
203  const InputPointType & ipp,
204  const MovingImageGradientType & movingImageGradient,
205  DerivativeType & imageJacobian,
206  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const;
207 
234  virtual void GetSpatialJacobian(
235  const InputPointType & ipp,
236  SpatialJacobianType & sj ) const = 0;
237 
240  const InputPointType & itkNotUsed( p ), JacobianType & itkNotUsed( j ) ) const
241  {
242  itkExceptionMacro( << "This ITK4 function is currently not used in elastix." );
243  }
244 
245 
247  const InputPointType & itkNotUsed( p ), JacobianType & itkNotUsed( j ) ) const
248  {
249  itkExceptionMacro( << "This ITK4 function is currently not used in elastix." );
250  }
251 
252 
269  virtual void GetSpatialHessian(
270  const InputPointType & ipp,
271  SpatialHessianType & sh ) const = 0;
272 
279  virtual void GetJacobianOfSpatialJacobian(
280  const InputPointType & ipp,
281  JacobianOfSpatialJacobianType & jsj,
282  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const = 0;
283 
287  virtual void GetJacobianOfSpatialJacobian(
288  const InputPointType & ipp,
289  SpatialJacobianType & sj,
290  JacobianOfSpatialJacobianType & jsj,
291  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const = 0;
292 
299  virtual void GetJacobianOfSpatialHessian(
300  const InputPointType & ipp,
301  JacobianOfSpatialHessianType & jsh,
302  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const = 0;
303 
307  virtual void GetJacobianOfSpatialHessian(
308  const InputPointType & ipp,
309  SpatialHessianType & sh,
310  JacobianOfSpatialHessianType & jsh,
311  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const = 0;
312 
313 protected:
314 
316  AdvancedTransform( NumberOfParametersType numberOfParameters );
317  virtual ~AdvancedTransform() {}
318 
321 
322 private:
323 
324  AdvancedTransform( const Self & ); // purposely not implemented
325  void operator=( const Self & ); // purposely not implemented
326 
327 };
328 
329 } // end namespace itk
330 
331 #ifndef ITK_MANUAL_INSTANTIATION
332 #include "itkAdvancedTransform.hxx"
333 #endif
334 
335 #endif
Matrix< ScalarType, OutputSpaceDimension, InputSpaceDimension > SpatialJacobianType
itkStaticConstMacro(InputSpaceDimension, unsigned int, NInputDimensions)
Superclass::InverseTransformBaseType InverseTransformBaseType
std::vector< unsigned long > NonZeroJacobianIndicesType
virtual void ComputeJacobianWithRespectToPosition(const InputPointType &, JacobianType &) const
Superclass::FixedParametersType FixedParametersType
virtual void GetJacobianOfSpatialJacobian(const InputPointType &ipp, JacobianOfSpatialJacobianType &jsj, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const =0
Superclass::ScalarType ScalarType
SmartPointer< const Self > ConstPointer
virtual void GetSpatialHessian(const InputPointType &ipp, SpatialHessianType &sh) const =0
SpatialJacobianType::InternalMatrixType InternalMatrixType
Superclass::InverseTransformBasePointer InverseTransformBasePointer
Superclass ::OutputCovariantVectorType OutputCovariantVectorType
virtual NumberOfParametersType GetNumberOfNonZeroJacobianIndices(void) const
Superclass::OutputVnlVectorType OutputVnlVectorType
SmartPointer< Self > Pointer
virtual void GetSpatialJacobian(const InputPointType &ipp, SpatialJacobianType &sj) const =0
Superclass::DerivativeType DerivativeType
Superclass::ParametersType ParametersType
Transform maps points, vectors and covariant vectors from an input space to an output space...
virtual void GetJacobianOfSpatialHessian(const InputPointType &ipp, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const =0
Superclass::InputVnlVectorType InputVnlVectorType
Transform< TScalarType, NInputDimensions, NOutputDimensions > Superclass
Superclass::ParametersValueType ParametersValueType
Superclass::OutputVectorType OutputVectorType
Superclass::NumberOfParametersType NumberOfParametersType
Superclass::JacobianType JacobianType
Superclass::InputPointType InputPointType
MovingImageGradientType::ValueType MovingImageGradientValueType
void operator=(const Self &)
Superclass::InputVectorType InputVectorType
Transform< TScalarType, NInputDimensions, NOutputDimensions > TransformType
TransformType::Pointer TransformTypePointer
virtual void EvaluateJacobianWithImageGradientProduct(const InputPointType &ipp, const MovingImageGradientType &movingImageGradient, DerivativeType &imageJacobian, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
TransformType::ConstPointer TransformTypeConstPointer
Superclass::OutputPointType OutputPointType
virtual void ComputeJacobianWithRespectToParameters(const InputPointType &, JacobianType &) const
std::vector< SpatialJacobianType > JacobianOfSpatialJacobianType
std::vector< SpatialHessianType > JacobianOfSpatialHessianType
virtual void GetJacobian(const InputPointType &ipp, JacobianType &j, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const =0
Superclass ::InputCovariantVectorType InputCovariantVectorType
FixedArray< Matrix< ScalarType, InputSpaceDimension, InputSpaceDimension >, OutputSpaceDimension > SpatialHessianType
OutputCovariantVectorType MovingImageGradientType


Generated on OURCE_DATE_EPOCH for elastix by doxygen 1.8.13 elastix logo