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"
45
46#include "itkObjectFactory.h"
47
48namespace itk
49{
50
70template< class TScalarType,
71unsigned int NDimensions = 3 >
73 public AdvancedTransform< TScalarType, NDimensions, NDimensions >
74{
75public:
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::TransformCategoryEnum TransformCategoryEnum;
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 OutputPointType TransformPoint( const InputPointType & point ) const override
148 { return point; }
149
151 OutputVectorType TransformVector( const InputVectorType & vector ) const override
152 { return vector; }
153
156 { return vector; }
157
160 const InputCovariantVectorType & vector ) const override
161 { return vector; }
162
167 void SetIdentity( void ) {}
168
171 {
172 return this->New().GetPointer();
173 }
174
175
181 bool IsLinear() const override { return true; }
182
186 TransformCategoryEnum GetTransformCategory() const override
187 {
188 return TransformCategoryEnum::Linear;
189 }
190
191
193 const ParametersType & GetFixedParameters( void ) const override
194 {
195 return this->m_FixedParameters;
196 }
197
198
200 void SetFixedParameters( const ParametersType & ) override {}
201
203 const ParametersType & GetParameters( void ) const override
204 {
205 return this->m_Parameters;
206 }
207
208
210 void SetParameters( const ParametersType & ) override {}
211
214 const InputPointType &,
215 JacobianType & j,
216 NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const override
217 {
218 j = this->m_LocalJacobian;
219 nonZeroJacobianIndices = this->m_NonZeroJacobianIndices;
220 }
221
222
225 const InputPointType &,
226 SpatialJacobianType & sj ) const override
227 {
228 sj = this->m_SpatialJacobian;
229 }
230
231
234 const InputPointType &,
235 SpatialHessianType & sh ) const override
236 {
237 sh = this->m_SpatialHessian;
238 }
239
240
243 const InputPointType &,
245 NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const override
246 {
247 jsj = this->m_JacobianOfSpatialJacobian;
248 nonZeroJacobianIndices = this->m_NonZeroJacobianIndices;
249 }
250
251
254 const InputPointType &,
257 NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const override
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 override
270 {
271 jsh = this->m_JacobianOfSpatialHessian;
272 nonZeroJacobianIndices = this->m_NonZeroJacobianIndices;
273 }
274
275
280 const InputPointType &,
283 NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const override
284 {
285 sh = this->m_SpatialHessian;
286 jsh = this->m_JacobianOfSpatialHessian;
287 nonZeroJacobianIndices = this->m_NonZeroJacobianIndices;
288 }
289
290
291protected:
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
322private:
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
Implementation of an Identity Transform.
Superclass::ParametersType ParametersType
Superclass::SpatialJacobianType SpatialJacobianType
OutputCovariantVectorType TransformCovariantVector(const InputCovariantVectorType &vector) const override
Superclass::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
const ParametersType & GetParameters(void) const override
vnl_vector_fixed< TScalarType, itkGetStaticConstMacro(InputSpaceDimension) > InputVnlVectorType
CovariantVector< TScalarType, itkGetStaticConstMacro(OutputSpaceDimension) > OutputCovariantVectorType
void GetSpatialJacobian(const InputPointType &, SpatialJacobianType &sj) const override
void operator=(const Self &)
OutputVectorType TransformVector(const InputVectorType &vector) const override
Vector< TScalarType, itkGetStaticConstMacro(OutputSpaceDimension) > OutputVectorType
itkStaticConstMacro(OutputSpaceDimension, unsigned int, NDimensions)
void GetJacobian(const InputPointType &, JacobianType &j, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const override
itkStaticConstMacro(InputSpaceDimension, unsigned int, NDimensions)
AdvancedIdentityTransform(const Self &)
InverseTransformBaseType::Pointer InverseTransformBasePointer
Superclass::TransformCategoryEnum TransformCategoryEnum
InverseTransformBasePointer GetInverseTransform(void) const override
JacobianOfSpatialJacobianType m_JacobianOfSpatialJacobian
void GetJacobianOfSpatialJacobian(const InputPointType &, SpatialJacobianType &sj, JacobianOfSpatialJacobianType &jsj, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const override
Superclass::InternalMatrixType InternalMatrixType
CovariantVector< TScalarType, itkGetStaticConstMacro(InputSpaceDimension) > InputCovariantVectorType
void SetParameters(const ParametersType &) override
Superclass::JacobianOfSpatialHessianType JacobianOfSpatialHessianType
Superclass::NumberOfParametersType NumberOfParametersType
OutputPointType TransformPoint(const InputPointType &point) const override
Superclass::InverseTransformBaseType InverseTransformBaseType
void GetJacobianOfSpatialJacobian(const InputPointType &, JacobianOfSpatialJacobianType &jsj, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const override
Superclass::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType
void GetSpatialHessian(const InputPointType &, SpatialHessianType &sh) const override
JacobianOfSpatialHessianType m_JacobianOfSpatialHessian
AdvancedTransform< TScalarType, NDimensions, NDimensions > Superclass
Vector< TScalarType, itkGetStaticConstMacro(InputSpaceDimension) > InputVectorType
const ParametersType & GetFixedParameters(void) const override
TransformCategoryEnum GetTransformCategory() const override
Point< TScalarType, itkGetStaticConstMacro(InputSpaceDimension) > InputPointType
Superclass::SpatialHessianType SpatialHessianType
void GetJacobianOfSpatialHessian(const InputPointType &, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const override
void SetFixedParameters(const ParametersType &) override
Point< TScalarType, itkGetStaticConstMacro(OutputSpaceDimension) > OutputPointType
itkStaticConstMacro(ParametersDimension, unsigned int, 1)
vnl_vector_fixed< TScalarType, itkGetStaticConstMacro(OutputSpaceDimension) > OutputVnlVectorType
void GetJacobianOfSpatialHessian(const InputPointType &, SpatialHessianType &sh, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const override
NonZeroJacobianIndicesType m_NonZeroJacobianIndices
OutputVnlVectorType TransformVector(const InputVnlVectorType &vector) const override
Transform maps points, vectors and covariant vectors from an input space to an output space.
FixedArray< Matrix< ScalarType, InputSpaceDimension, InputSpaceDimension >, OutputSpaceDimension > SpatialHessianType
Matrix< ScalarType, OutputSpaceDimension, InputSpaceDimension > SpatialJacobianType


Generated on 1667476801 for elastix by doxygen 1.9.4 elastix logo