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::ParametersValueType ParametersValueType;
112  typedef typename Superclass::NumberOfParametersType NumberOfParametersType;
113  typedef typename Superclass::DerivativeType DerivativeType;
114  typedef typename Superclass::JacobianType JacobianType;
115  typedef typename Superclass::InputVectorType InputVectorType;
116  typedef typename Superclass::OutputVectorType OutputVectorType;
117  typedef typename Superclass
118  ::InputCovariantVectorType InputCovariantVectorType;
119  typedef typename Superclass
120  ::OutputCovariantVectorType OutputCovariantVectorType;
121  typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
122  typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
123  typedef typename Superclass::InputPointType InputPointType;
124  typedef typename Superclass::OutputPointType OutputPointType;
125 
126  typedef typename Superclass::InverseTransformBaseType InverseTransformBaseType;
127  typedef typename Superclass::InverseTransformBasePointer InverseTransformBasePointer;
128 
130  typedef Transform< TScalarType,
131  NInputDimensions,
132  NOutputDimensions > TransformType;
133  typedef typename TransformType::Pointer TransformTypePointer;
134  typedef typename TransformType::ConstPointer TransformTypeConstPointer;
135 
140  typedef std::vector< unsigned long > NonZeroJacobianIndicesType;
141  typedef Matrix< ScalarType,
142  OutputSpaceDimension, InputSpaceDimension > SpatialJacobianType;
143  typedef std::vector< SpatialJacobianType > JacobianOfSpatialJacobianType;
144  // \todo: think about the SpatialHessian type, should be a 3D native type
145  typedef FixedArray<
146  Matrix< ScalarType,
147  InputSpaceDimension, InputSpaceDimension >,
148  OutputSpaceDimension > SpatialHessianType;
149  typedef std::vector< SpatialHessianType > JacobianOfSpatialHessianType;
150  typedef typename SpatialJacobianType::InternalMatrixType InternalMatrixType;
151 
157  typedef OutputCovariantVectorType MovingImageGradientType;
158  typedef typename MovingImageGradientType::ValueType MovingImageGradientValueType;
159 
161  virtual NumberOfParametersType GetNumberOfNonZeroJacobianIndices( void ) const;
162 
164  itkGetConstMacro( HasNonZeroSpatialHessian, bool );
165  itkGetConstMacro( HasNonZeroJacobianOfSpatialHessian, bool );
166 
193  virtual void GetJacobian(
194  const InputPointType & ipp,
195  JacobianType & j,
196  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const = 0;
197 
202  const InputPointType & ipp,
203  const MovingImageGradientType & movingImageGradient,
204  DerivativeType & imageJacobian,
205  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const;
206 
233  virtual void GetSpatialJacobian(
234  const InputPointType & ipp,
235  SpatialJacobianType & sj ) const = 0;
236 
239  const InputPointType & itkNotUsed( p ), JacobianType & itkNotUsed( j ) ) const
240  {
241  itkExceptionMacro( << "This ITK4 function is currently not used in elastix." );
242  }
243 
244 
246  const InputPointType & itkNotUsed( p ), JacobianType & itkNotUsed( j ) ) const
247  {
248  itkExceptionMacro( << "This ITK4 function is currently not used in elastix." );
249  }
250 
251 
268  virtual void GetSpatialHessian(
269  const InputPointType & ipp,
270  SpatialHessianType & sh ) const = 0;
271 
278  virtual void GetJacobianOfSpatialJacobian(
279  const InputPointType & ipp,
280  JacobianOfSpatialJacobianType & jsj,
281  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const = 0;
282 
286  virtual void GetJacobianOfSpatialJacobian(
287  const InputPointType & ipp,
288  SpatialJacobianType & sj,
289  JacobianOfSpatialJacobianType & jsj,
290  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const = 0;
291 
298  virtual void GetJacobianOfSpatialHessian(
299  const InputPointType & ipp,
300  JacobianOfSpatialHessianType & jsh,
301  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const = 0;
302 
306  virtual void GetJacobianOfSpatialHessian(
307  const InputPointType & ipp,
308  SpatialHessianType & sh,
309  JacobianOfSpatialHessianType & jsh,
310  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const = 0;
311 
312 protected:
313 
315  AdvancedTransform( NumberOfParametersType numberOfParameters );
316  virtual ~AdvancedTransform() {}
317 
320 
321 private:
322 
323  AdvancedTransform( const Self & ); // purposely not implemented
324  void operator=( const Self & ); // purposely not implemented
325 
326 };
327 
328 } // end namespace itk
329 
330 #ifndef ITK_MANUAL_INSTANTIATION
331 #include "itkAdvancedTransform.hxx"
332 #endif
333 
334 #endif
Matrix< ScalarType, OutputSpaceDimension, InputSpaceDimension > SpatialJacobianType
itkStaticConstMacro(InputSpaceDimension, unsigned int, NInputDimensions)
Superclass::InverseTransformBaseType InverseTransformBaseType
std::vector< unsigned long > NonZeroJacobianIndicesType
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 void EvaluateJacobianWithImageGradientProduct(const InputPointType &ipp, const MovingImageGradientType &movingImageGradient, DerivativeType &imageJacobian, NonZeroJacobianIndicesType &nonZeroJacobianIndices) 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
virtual NumberOfParametersType GetNumberOfNonZeroJacobianIndices(void) const
Superclass::InputPointType InputPointType
MovingImageGradientType::ValueType MovingImageGradientValueType
virtual void ComputeJacobianWithRespectToParameters(const InputPointType &, JacobianType &) const
void operator=(const Self &)
Superclass::InputVectorType InputVectorType
Transform< TScalarType, NInputDimensions, NOutputDimensions > TransformType
TransformType::Pointer TransformTypePointer
TransformType::ConstPointer TransformTypeConstPointer
Superclass::OutputPointType OutputPointType
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
virtual void ComputeJacobianWithRespectToPosition(const InputPointType &, JacobianType &) const


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