go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkStackTransform.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 #ifndef __itkStackTransform_h
19 #define __itkStackTransform_h
20 
21 #include "itkAdvancedTransform.h"
22 #include "itkIndex.h"
23 
24 namespace itk
25 {
26 
37 template< class TScalarType,
38 unsigned int NInputDimensions = 3,
39 unsigned int NOutputDimensions = 3 >
41  public AdvancedTransform< TScalarType, NInputDimensions, NOutputDimensions >
42 {
43 public:
44 
48  NInputDimensions,
49  NOutputDimensions > Superclass;
51  typedef SmartPointer< const Self > ConstPointer;
52 
54  itkNewMacro( Self );
55 
58 
60  itkStaticConstMacro( InputSpaceDimension, unsigned int, NInputDimensions );
61  itkStaticConstMacro( OutputSpaceDimension, unsigned int, NOutputDimensions );
62  itkStaticConstMacro( ReducedInputSpaceDimension, unsigned int, NInputDimensions - 1 );
63  itkStaticConstMacro( ReducedOutputSpaceDimension, unsigned int, NOutputDimensions - 1 );
64 
68  typedef typename Superclass::NumberOfParametersType
78  typedef typename
90  typedef typename Superclass::OutputVectorPixelType OutputVectorPixelType;
91  typedef typename Superclass::InputVectorPixelType InputVectorPixelType;
92 
95  itkGetStaticConstMacro( ReducedInputSpaceDimension ),
96  itkGetStaticConstMacro( ReducedOutputSpaceDimension ) > SubTransformType;
98  typedef std::vector< SubTransformPointer > SubTransformContainerType;
100 
104 
106  typedef typename ParametersType::ArrayType ParametersArrayType;
107 
109  virtual OutputPointType TransformPoint( const InputPointType & ipp ) const;
110 
113  {
114  itkExceptionMacro(
115  << "TransformVector(const InputVectorType &) is not implemented "
116  << "for StackTransform" );
117  }
118 
119 
121  {
122  itkExceptionMacro(
123  << "TransformVector(const InputVnlVectorType &) is not implemented "
124  << "for StackTransform" );
125  }
126 
127 
129  {
130  itkExceptionMacro(
131  << "TransformCovariantVector(const InputCovariantVectorType &) is not implemented "
132  << "for StackTransform" );
133  }
134 
135 
141  virtual void GetJacobian(
142  const InputPointType & ipp,
143  JacobianType & jac,
144  NonZeroJacobianIndicesType & nzji ) const;
145 
148  virtual void SetParameters( const ParametersType & param );
149 
152  virtual const ParametersType & GetParameters( void ) const;
153 
155  virtual void SetFixedParameters( const ParametersType & )
156  {
157  // \todo: to be implemented by Coert
158  }
159 
160 
162  virtual const ParametersType & GetFixedParameters( void ) const
163  {
164  // \todo: to be implemented by Coert: check this:
165  return this->m_FixedParameters;
166  }
167 
168 
171  {
172  if( this->m_SubTransformContainer.size() == 0 )
173  {
174  return 0;
175  }
176  else
177  {
178  return this->m_SubTransformContainer.size() * m_SubTransformContainer[ 0 ]->GetNumberOfParameters();
179  }
180  }
181 
182 
184  virtual void SetNumberOfSubTransforms( const unsigned int num )
185  {
186  if( this->m_NumberOfSubTransforms != num )
187  {
188  this->m_NumberOfSubTransforms = num;
189  this->m_SubTransformContainer.clear();
190  this->m_SubTransformContainer.resize( num );
191  this->Modified();
192  }
193  }
194 
195 
196  itkGetMacro( NumberOfSubTransforms, unsigned int );
197 
199  itkSetMacro( StackSpacing, TScalarType );
200  itkGetConstMacro( StackSpacing, TScalarType );
201  itkSetMacro( StackOrigin, TScalarType );
202  itkGetConstMacro( StackOrigin, TScalarType );
203 
205  virtual void SetSubTransform( unsigned int i, SubTransformType * transform )
206  {
207  this->m_SubTransformContainer[ i ] = transform;
208  this->Modified();
209  }
210 
211 
213  virtual void SetAllSubTransforms( SubTransformType * transform )
214  {
215  for( unsigned int t = 0; t < this->m_NumberOfSubTransforms; ++t )
216  {
217  // Copy transform
218  SubTransformPointer transformcopy = dynamic_cast< SubTransformType * >( transform->CreateAnother().GetPointer() );
219  transformcopy->SetFixedParameters( transform->GetFixedParameters() );
220  transformcopy->SetParameters( transform->GetParameters() );
221  // Set sub transform
222  this->m_SubTransformContainer[ t ] = transformcopy;
223  }
224  }
225 
226 
228  virtual SubTransformPointer GetSubTransform( unsigned int i )
229  {
230  return this->m_SubTransformContainer[ i ];
231  }
232 
233 
236 
238  virtual void GetSpatialJacobian(
239  const InputPointType & ipp, SpatialJacobianType & sj ) const
240  {
241  itkExceptionMacro( << "Not implemented for StackTransform" );
242  }
243 
244 
245  virtual void GetSpatialHessian(
246  const InputPointType & ipp, SpatialHessianType & sh ) const
247  {
248  itkExceptionMacro( << "Not implemented for StackTransform" );
249  }
250 
251 
254  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
255  {
256  itkExceptionMacro( << "Not implemented for StackTransform" );
257  }
258 
259 
261  const InputPointType & ipp, SpatialJacobianType & sj,
263  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
264  {
265  itkExceptionMacro( << "Not implemented for StackTransform" );
266  }
267 
268 
270  const InputPointType & ipp, JacobianOfSpatialHessianType & jsh,
271  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
272  {
273  itkExceptionMacro( << "Not implemented for StackTransform" );
274  }
275 
276 
278  const InputPointType & ipp, SpatialHessianType & sh,
280  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const
281  {
282  itkExceptionMacro( << "Not implemented for StackTransform" );
283  }
284 
285 
286 protected:
287 
289  virtual ~StackTransform() {}
290 
291 private:
292 
293  StackTransform( const Self & ); // purposely not implemented
294  void operator=( const Self & ); // purposely not implemented
295 
296  // Number of transforms and transform container
299 
300  // Stack spacing and origin of last dimension
302 
303 };
304 
305 } // end namespace itk
306 
307 #ifndef ITK_MANUAL_INSTANTIATION
308 #include "itkStackTransform.hxx"
309 #endif
310 
311 #endif
itk::StackTransform::SubTransformContainerType
std::vector< SubTransformPointer > SubTransformContainerType
Definition: itkStackTransform.h:98
itk::StackTransform::ParametersValueType
Superclass::ParametersValueType ParametersValueType
Definition: itkStackTransform.h:70
itk::StackTransform::operator=
void operator=(const Self &)
itk::AdvancedTransform::OutputPointType
Superclass::OutputPointType OutputPointType
Definition: itkAdvancedTransform.h:125
itk::StackTransform::SetNumberOfSubTransforms
virtual void SetNumberOfSubTransforms(const unsigned int num)
Definition: itkStackTransform.h:184
itk::StackTransform::SetFixedParameters
virtual void SetFixedParameters(const ParametersType &)
Definition: itkStackTransform.h:155
itk::StackTransform::StackTransform
StackTransform()
itk::StackTransform::OutputVectorType
Superclass::OutputVectorType OutputVectorType
Definition: itkStackTransform.h:82
itk::AdvancedTransform::SpatialJacobianType
Matrix< ScalarType, OutputSpaceDimension, InputSpaceDimension > SpatialJacobianType
Definition: itkAdvancedTransform.h:143
itk::StackTransform::SubTransformOutputPointType
SubTransformType::OutputPointType SubTransformOutputPointType
Definition: itkStackTransform.h:103
itk::StackTransform::GetJacobianOfSpatialHessian
virtual void GetJacobianOfSpatialHessian(const InputPointType &ipp, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
Definition: itkStackTransform.h:269
itkAdvancedTransform.h
itk::AdvancedTransform::InputCovariantVectorType
Superclass ::InputCovariantVectorType InputCovariantVectorType
Definition: itkAdvancedTransform.h:119
itk::AdvancedTransform::InputPointType
Superclass::InputPointType InputPointType
Definition: itkAdvancedTransform.h:124
SmartPointer< Self >
itk::StackTransform::NonZeroJacobianIndicesType
Superclass::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
Definition: itkStackTransform.h:79
itk::AdvancedTransform::InputVnlVectorType
Superclass::InputVnlVectorType InputVnlVectorType
Definition: itkAdvancedTransform.h:122
itk::AdvancedTransform::JacobianOfSpatialHessianType
std::vector< SpatialHessianType > JacobianOfSpatialHessianType
Definition: itkAdvancedTransform.h:150
itk::StackTransform::itkStaticConstMacro
itkStaticConstMacro(InputSpaceDimension, unsigned int, NInputDimensions)
itk::StackTransform::TransformPoint
virtual OutputPointType TransformPoint(const InputPointType &ipp) const
itk::StackTransform::InputVectorPixelType
Superclass::InputVectorPixelType InputVectorPixelType
Definition: itkStackTransform.h:91
itk::StackTransform::m_StackOrigin
TScalarType m_StackOrigin
Definition: itkStackTransform.h:301
itk::StackTransform::OutputPointType
Superclass::OutputPointType OutputPointType
Definition: itkStackTransform.h:89
itk::AdvancedTransform::ScalarType
Superclass::ScalarType ScalarType
Definition: itkAdvancedTransform.h:109
itk::StackTransform::SetParameters
virtual void SetParameters(const ParametersType &param)
itk::StackTransform::SetSubTransform
virtual void SetSubTransform(unsigned int i, SubTransformType *transform)
Definition: itkStackTransform.h:205
itk::StackTransform::Superclass
AdvancedTransform< TScalarType, NInputDimensions, NOutputDimensions > Superclass
Definition: itkStackTransform.h:49
itk::StackTransform::JacobianType
Superclass::JacobianType JacobianType
Definition: itkStackTransform.h:71
itk::StackTransform::GetNumberOfParameters
virtual NumberOfParametersType GetNumberOfParameters(void) const
Definition: itkStackTransform.h:170
itk::StackTransform::GetJacobianOfSpatialHessian
virtual void GetJacobianOfSpatialHessian(const InputPointType &ipp, SpatialHessianType &sh, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
Definition: itkStackTransform.h:277
itk::StackTransform::GetJacobianOfSpatialJacobian
virtual void GetJacobianOfSpatialJacobian(const InputPointType &ipp, JacobianOfSpatialJacobianType &jsj, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
Definition: itkStackTransform.h:252
itk::StackTransform::~StackTransform
virtual ~StackTransform()
Definition: itkStackTransform.h:289
itk::StackTransform::InputVectorType
Superclass::InputVectorType InputVectorType
Definition: itkStackTransform.h:81
itk::StackTransform::OutputVectorPixelType
Superclass::OutputVectorPixelType OutputVectorPixelType
Definition: itkStackTransform.h:90
itk::StackTransform::GetNumberOfNonZeroJacobianIndices
virtual NumberOfParametersType GetNumberOfNonZeroJacobianIndices(void) const
itk::StackTransform::TransformVector
virtual OutputVnlVectorType TransformVector(const InputVnlVectorType &) const
Definition: itkStackTransform.h:120
itk::StackTransform::itkStaticConstMacro
itkStaticConstMacro(ReducedOutputSpaceDimension, unsigned int, NOutputDimensions - 1)
itk::StackTransform::SubTransformType
AdvancedTransform< TScalarType, itkGetStaticConstMacro(ReducedInputSpaceDimension), itkGetStaticConstMacro(ReducedOutputSpaceDimension) > SubTransformType
Definition: itkStackTransform.h:96
itk::AdvancedTransform::JacobianType
Superclass::JacobianType JacobianType
Definition: itkAdvancedTransform.h:115
itk::StackTransform::m_SubTransformContainer
SubTransformContainerType m_SubTransformContainer
Definition: itkStackTransform.h:298
itk::StackTransform::NumberOfParametersType
Superclass::NumberOfParametersType NumberOfParametersType
Definition: itkStackTransform.h:69
itk::AdvancedTransform
Transform maps points, vectors and covariant vectors from an input space to an output space.
Definition: itkAdvancedTransform.h:87
itk::StackTransform::m_StackSpacing
TScalarType m_StackSpacing
Definition: itkStackTransform.h:301
itk::StackTransform::JacobianOfSpatialHessianType
Superclass::JacobianOfSpatialHessianType JacobianOfSpatialHessianType
Definition: itkStackTransform.h:77
itk::StackTransform::InputCovariantVectorType
Superclass::InputCovariantVectorType InputCovariantVectorType
Definition: itkStackTransform.h:88
itk::StackTransform::ScalarType
Superclass::ScalarType ScalarType
Definition: itkStackTransform.h:66
itk::StackTransform::SubTransformInputPointType
SubTransformType::InputPointType SubTransformInputPointType
Definition: itkStackTransform.h:102
itk::StackTransform::ParametersArrayType
ParametersType::ArrayType ParametersArrayType
Definition: itkStackTransform.h:106
itk::StackTransform::SpatialJacobianType
Superclass::SpatialJacobianType SpatialJacobianType
Definition: itkStackTransform.h:72
itk::StackTransform::InputVnlVectorType
Superclass::InputVnlVectorType InputVnlVectorType
Definition: itkStackTransform.h:83
itk::StackTransform
Implements stack of transforms: one for every last dimension index.
Definition: itkStackTransform.h:42
itk::AdvancedTransform::SpatialHessianType
FixedArray< Matrix< ScalarType, InputSpaceDimension, InputSpaceDimension >, OutputSpaceDimension > SpatialHessianType
Definition: itkAdvancedTransform.h:149
itk::AdvancedTransform::InputVectorType
Superclass::InputVectorType InputVectorType
Definition: itkAdvancedTransform.h:116
itk::StackTransform::OutputCovariantVectorType
Superclass::OutputCovariantVectorType OutputCovariantVectorType
Definition: itkStackTransform.h:86
itk::StackTransform::ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkStackTransform.h:51
itk::StackTransform::InputPointType
Superclass::InputPointType InputPointType
Definition: itkStackTransform.h:80
itk::StackTransform::TransformVector
virtual OutputVectorType TransformVector(const InputVectorType &) const
Definition: itkStackTransform.h:112
itk::StackTransform::itkStaticConstMacro
itkStaticConstMacro(ReducedInputSpaceDimension, unsigned int, NInputDimensions - 1)
itk::StackTransform::GetSpatialHessian
virtual void GetSpatialHessian(const InputPointType &ipp, SpatialHessianType &sh) const
Definition: itkStackTransform.h:245
itk::AdvancedTransform::JacobianOfSpatialJacobianType
std::vector< SpatialJacobianType > JacobianOfSpatialJacobianType
Definition: itkAdvancedTransform.h:144
itk::StackTransform::TransformCovariantVector
virtual OutputCovariantVectorType TransformCovariantVector(const InputCovariantVectorType &) const
Definition: itkStackTransform.h:128
itk::StackTransform::JacobianOfSpatialJacobianType
Superclass::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType
Definition: itkStackTransform.h:74
itk::StackTransform::GetJacobianOfSpatialJacobian
virtual void GetJacobianOfSpatialJacobian(const InputPointType &ipp, SpatialJacobianType &sj, JacobianOfSpatialJacobianType &jsj, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const
Definition: itkStackTransform.h:260
itk::StackTransform::Pointer
SmartPointer< Self > Pointer
Definition: itkStackTransform.h:50
itk::AdvancedTransform::NonZeroJacobianIndicesType
std::vector< unsigned long > NonZeroJacobianIndicesType
Definition: itkAdvancedTransform.h:141
itk::StackTransform::GetJacobian
virtual void GetJacobian(const InputPointType &ipp, JacobianType &jac, NonZeroJacobianIndicesType &nzji) const
itk
Definition: itkAdvancedImageToImageMetric.h:40
itk::AdvancedTransform::OutputVectorType
Superclass::OutputVectorType OutputVectorType
Definition: itkAdvancedTransform.h:117
itk::StackTransform::SetAllSubTransforms
virtual void SetAllSubTransforms(SubTransformType *transform)
Definition: itkStackTransform.h:213
itk::StackTransform::GetParameters
virtual const ParametersType & GetParameters(void) const
itk::AdvancedTransform::ParametersValueType
Superclass::ParametersValueType ParametersValueType
Definition: itkAdvancedTransform.h:112
itk::StackTransform::SpatialHessianType
Superclass::SpatialHessianType SpatialHessianType
Definition: itkStackTransform.h:75
itk::StackTransform::OutputVnlVectorType
Superclass::OutputVnlVectorType OutputVnlVectorType
Definition: itkStackTransform.h:84
itk::StackTransform::m_NumberOfSubTransforms
unsigned int m_NumberOfSubTransforms
Definition: itkStackTransform.h:297
itk::AdvancedTransform::NumberOfParametersType
Superclass::NumberOfParametersType NumberOfParametersType
Definition: itkAdvancedTransform.h:113
itk::StackTransform::ParametersType
Superclass::ParametersType ParametersType
Definition: itkStackTransform.h:67
itk::StackTransform::Self
StackTransform Self
Definition: itkStackTransform.h:46
TScalarType
itk::StackTransform::GetFixedParameters
virtual const ParametersType & GetFixedParameters(void) const
Definition: itkStackTransform.h:162
itk::StackTransform::GetSpatialJacobian
virtual void GetSpatialJacobian(const InputPointType &ipp, SpatialJacobianType &sj) const
Definition: itkStackTransform.h:238
itk::AdvancedTransform::ParametersType
Superclass::ParametersType ParametersType
Definition: itkAdvancedTransform.h:110
itk::StackTransform::itkStaticConstMacro
itkStaticConstMacro(OutputSpaceDimension, unsigned int, NOutputDimensions)
itk::StackTransform::SubTransformJacobianType
SubTransformType::JacobianType SubTransformJacobianType
Definition: itkStackTransform.h:99
itk::StackTransform::SubTransformPointer
SubTransformType::Pointer SubTransformPointer
Definition: itkStackTransform.h:97
itk::AdvancedTransform::OutputVnlVectorType
Superclass::OutputVnlVectorType OutputVnlVectorType
Definition: itkAdvancedTransform.h:123
itk::StackTransform::StackTransform
StackTransform(const Self &)
itk::AdvancedTransform::OutputCovariantVectorType
Superclass ::OutputCovariantVectorType OutputCovariantVectorType
Definition: itkAdvancedTransform.h:121
itk::StackTransform::GetSubTransform
virtual SubTransformPointer GetSubTransform(unsigned int i)
Definition: itkStackTransform.h:228


Generated on OURCE_DATE_EPOCH for elastix by doxygen 1.8.18 elastix logo