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 Date: $Date: 2008-06-29 12:58:58 $
23 Version: $Revision: 1.64 $
24
25 Copyright (c) Insight Software Consortium. All rights reserved.
26 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
27
28 This software is distributed WITHOUT ANY WARRANTY; without even
29 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
30 PURPOSE. See the above copyright notices for more information.
31
32=========================================================================*/
33#ifndef itkAdvancedTransform_h
34#define itkAdvancedTransform_h
35
36#include "itkTransform.h"
37#include "itkMatrix.h"
38#include "itkFixedArray.h"
39
40namespace itk
41{
42
81template <class TScalarType, unsigned int NInputDimensions = 3, unsigned int NOutputDimensions = 3>
82class ITK_TEMPLATE_EXPORT AdvancedTransform : public Transform<TScalarType, NInputDimensions, NOutputDimensions>
83{
84public:
86
89 using Superclass = Transform<TScalarType, NInputDimensions, NOutputDimensions>;
90 using Pointer = SmartPointer<Self>;
91 using ConstPointer = SmartPointer<const Self>;
92
94 // itkNewMacro( Self );
95
97 itkTypeMacro(AdvancedTransform, Transform);
98
100 itkStaticConstMacro(InputSpaceDimension, unsigned int, NInputDimensions);
101 itkStaticConstMacro(OutputSpaceDimension, unsigned int, NOutputDimensions);
102
104 using typename Superclass::ScalarType;
105 using typename Superclass::ParametersType;
106 using typename Superclass::FixedParametersType;
107 using typename Superclass::ParametersValueType;
108 using typename Superclass::NumberOfParametersType;
109 using typename Superclass::DerivativeType;
110 using typename Superclass::JacobianType;
111 using typename Superclass::InputVectorType;
112 using typename Superclass::OutputVectorType;
113 using typename Superclass::InputCovariantVectorType;
114 using typename Superclass::OutputCovariantVectorType;
115 using typename Superclass::InputVnlVectorType;
116 using typename Superclass::OutputVnlVectorType;
117 using typename Superclass::InputPointType;
118 using typename Superclass::OutputPointType;
119
120 using InverseTransformBaseType = typename Superclass::InverseTransformBaseType;
121 using typename Superclass::InverseTransformBasePointer;
122
124 using TransformType = Transform<TScalarType, NInputDimensions, NOutputDimensions>;
125 using TransformTypePointer = typename TransformType::Pointer;
126 using TransformTypeConstPointer = typename TransformType::ConstPointer;
127
132 using NonZeroJacobianIndicesType = std::vector<unsigned long>;
133 using SpatialJacobianType = Matrix<ScalarType, OutputSpaceDimension, InputSpaceDimension>;
134 using JacobianOfSpatialJacobianType = std::vector<SpatialJacobianType>;
135 // \todo: think about the SpatialHessian type, should be a 3D native type
137 FixedArray<Matrix<ScalarType, InputSpaceDimension, InputSpaceDimension>, OutputSpaceDimension>;
138 using JacobianOfSpatialHessianType = std::vector<SpatialHessianType>;
139 using InternalMatrixType = typename SpatialJacobianType::InternalMatrixType;
140
146 using MovingImageGradientType = OutputCovariantVectorType;
147 using MovingImageGradientValueType = typename MovingImageGradientType::ValueType;
148
150 virtual NumberOfParametersType
152
154 itkGetConstMacro(HasNonZeroSpatialHessian, bool);
155 itkGetConstMacro(HasNonZeroJacobianOfSpatialHessian, bool);
156
183 virtual void
184 GetJacobian(const InputPointType & inputPoint,
185 JacobianType & j,
186 NonZeroJacobianIndicesType & nonZeroJacobianIndices) const = 0;
187
191 virtual void
192 EvaluateJacobianWithImageGradientProduct(const InputPointType & inputPoint,
193 const MovingImageGradientType & movingImageGradient,
194 DerivativeType & imageJacobian,
195 NonZeroJacobianIndicesType & nonZeroJacobianIndices) const;
196
223 virtual void
224 GetSpatialJacobian(const InputPointType & inputPoint, SpatialJacobianType & sj) const = 0;
225
227 void
228 ComputeJacobianWithRespectToParameters(const InputPointType & itkNotUsed(p),
229 JacobianType & itkNotUsed(j)) const override
230 {
231 itkExceptionMacro(<< "This ITK4 function is currently not used in elastix.");
232 }
233
234
251 virtual void
252 GetSpatialHessian(const InputPointType & inputPoint, SpatialHessianType & sh) const = 0;
253
260 virtual void
261 GetJacobianOfSpatialJacobian(const InputPointType & inputPoint,
263 NonZeroJacobianIndicesType & nonZeroJacobianIndices) const = 0;
264
268 virtual void
269 GetJacobianOfSpatialJacobian(const InputPointType & inputPoint,
272 NonZeroJacobianIndicesType & nonZeroJacobianIndices) const = 0;
273
280 virtual void
281 GetJacobianOfSpatialHessian(const InputPointType & inputPoint,
283 NonZeroJacobianIndicesType & nonZeroJacobianIndices) const = 0;
284
288 virtual void
289 GetJacobianOfSpatialHessian(const InputPointType & inputPoint,
292 NonZeroJacobianIndicesType & nonZeroJacobianIndices) const = 0;
293
294protected:
295 AdvancedTransform() = default;
296
297 // Inherit the other (non-default) constructor from itk::Transform.
298 using Superclass::Superclass;
299
300 ~AdvancedTransform() override = default;
301
302 bool m_HasNonZeroSpatialHessian{ true };
303 bool m_HasNonZeroJacobianOfSpatialHessian{ true };
304};
305
306} // end namespace itk
307
308#ifndef ITK_MANUAL_INSTANTIATION
309# include "itkAdvancedTransform.hxx"
310#endif
311
312#endif
Transform maps points, vectors and covariant vectors from an input space to an output space.
typename SpatialJacobianType::InternalMatrixType InternalMatrixType
ITK_DISALLOW_COPY_AND_MOVE(AdvancedTransform)
virtual void EvaluateJacobianWithImageGradientProduct(const InputPointType &inputPoint, const MovingImageGradientType &movingImageGradient, DerivativeType &imageJacobian, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
typename Superclass::InverseTransformBaseType InverseTransformBaseType
virtual void GetSpatialHessian(const InputPointType &inputPoint, SpatialHessianType &sh) const =0
virtual void GetJacobian(const InputPointType &inputPoint, JacobianType &j, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const =0
Matrix< ScalarType, OutputSpaceDimension, InputSpaceDimension > SpatialJacobianType
itkStaticConstMacro(InputSpaceDimension, unsigned int, NInputDimensions)
virtual void GetJacobianOfSpatialHessian(const InputPointType &inputPoint, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const =0
Transform< TScalarType, NInputDimensions, NOutputDimensions > Superclass
void ComputeJacobianWithRespectToParameters(const InputPointType &, JacobianType &) const override
virtual NumberOfParametersType GetNumberOfNonZeroJacobianIndices() const
SmartPointer< const Self > ConstPointer
std::vector< SpatialHessianType > JacobianOfSpatialHessianType
typename TransformType::Pointer TransformTypePointer
virtual void GetJacobianOfSpatialJacobian(const InputPointType &inputPoint, SpatialJacobianType &sj, JacobianOfSpatialJacobianType &jsj, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const =0
std::vector< SpatialJacobianType > JacobianOfSpatialJacobianType
FixedArray< Matrix< ScalarType, InputSpaceDimension, InputSpaceDimension >, OutputSpaceDimension > SpatialHessianType
typename TransformType::ConstPointer TransformTypeConstPointer
virtual void GetSpatialJacobian(const InputPointType &inputPoint, SpatialJacobianType &sj) const =0
~AdvancedTransform() override=default
itkStaticConstMacro(OutputSpaceDimension, unsigned int, NOutputDimensions)
virtual void GetJacobianOfSpatialHessian(const InputPointType &inputPoint, SpatialHessianType &sh, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const =0
typename MovingImageGradientType::ValueType MovingImageGradientValueType
virtual void GetJacobianOfSpatialJacobian(const InputPointType &inputPoint, JacobianOfSpatialJacobianType &jsj, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const =0
std::vector< unsigned long > NonZeroJacobianIndicesType
Transform< TScalarType, NInputDimensions, NOutputDimensions > TransformType
OutputCovariantVectorType MovingImageGradientType


Generated on 2023-01-13 for elastix by doxygen 1.9.6 elastix logo