go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkAdvancedBSplineDeformableTransformBase.h
Go to the documentation of this file.
1 /*======================================================================
2 
3 This file is part of the elastix software.
4 
5 Copyright (c) University Medical Center Utrecht. All rights reserved.
6 See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
7 details.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notices for more information.
12 
13 ======================================================================*/
14 #ifndef __itkAdvancedBSplineDeformableTransformBase_h
15 #define __itkAdvancedBSplineDeformableTransformBase_h
16 
17 #include "itkAdvancedTransform.h"
18 #include "itkImage.h"
19 #include "itkImageRegion.h"
20 
21 namespace itk
22 {
23 
34 template<
35 class TScalarType = double, // Data type for scalars
36 unsigned int NDimensions = 3 >
37 // Number of dimensions
39  public AdvancedTransform< TScalarType, NDimensions, NDimensions >
40 {
41 public:
42 
45  typedef AdvancedTransform<
46  TScalarType, NDimensions, NDimensions > Superclass;
47  typedef SmartPointer< Self > Pointer;
48  typedef SmartPointer< const Self > ConstPointer;
49 
52 
54  itkStaticConstMacro( SpaceDimension, unsigned int, NDimensions );
55 
71  typedef typename Superclass::TransformCategoryType TransformCategoryType;
72 
73  typedef typename Superclass
76  typedef typename Superclass
79  typedef typename Superclass
82 
101  void SetParameters( const ParametersType & parameters );
102 
118  void SetFixedParameters( const ParametersType & parameters );
119 
136  void SetParametersByValue( const ParametersType & parameters );
137 
146  void SetIdentity( void );
147 
149  virtual const ParametersType & GetParameters( void ) const;
150 
152  virtual const ParametersType & GetFixedParameters( void ) const;
153 
155  typedef typename ParametersType::ValueType PixelType;
156  typedef Image< PixelType,
157  itkGetStaticConstMacro( SpaceDimension ) > ImageType;
158  typedef typename ImageType::Pointer ImagePointer;
159 
161  virtual const ImagePointer * GetCoefficientImages( void ) const
162  { return this->m_CoefficientImages; }
163 
175  virtual void SetCoefficientImages( ImagePointer images[] );
176 
178  typedef ImageRegion< itkGetStaticConstMacro( SpaceDimension ) > RegionType;
179 
180  typedef typename RegionType::IndexType IndexType;
181  typedef typename RegionType::SizeType SizeType;
182  typedef typename ImageType::SpacingType SpacingType;
183  typedef typename ImageType::DirectionType DirectionType;
184  typedef typename ImageType::PointType OriginType;
186 
188  virtual void SetGridRegion( const RegionType & region ) = 0;
189 
190  //itkGetMacro( GridRegion, RegionType );
191  itkGetConstMacro( GridRegion, RegionType );
192 
194  virtual void SetGridSpacing( const SpacingType & spacing );
195 
196  //itkGetMacro( GridSpacing, SpacingType );
197  itkGetConstMacro( GridSpacing, SpacingType );
198 
200  virtual void SetGridDirection( const DirectionType & direction );
201 
202  //itkGetMacro( GridDirection, DirectionType );
203  itkGetConstMacro( GridDirection, DirectionType );
204 
206  virtual void SetGridOrigin( const OriginType & origin );
207 
208  //itkGetMacro( GridOrigin, OriginType );
209  itkGetConstMacro( GridOrigin, OriginType );
210 
212  typedef Array< unsigned long > ParameterIndexArrayType;
213 
218  {
219  itkExceptionMacro( << "Method not applicable for deformable transform." );
220  return OutputVectorType();
221  }
222 
223 
228  {
229  itkExceptionMacro( << "Method not applicable for deformable transform. " );
230  return OutputVnlVectorType();
231  }
232 
233 
238  const InputCovariantVectorType & ) const
239  {
240  itkExceptionMacro( << "Method not applicable for deformable transform. " );
241  return OutputCovariantVectorType();
242  }
243 
244 
246  virtual NumberOfParametersType GetNumberOfParameters( void ) const;
247 
250 
252  itkGetConstReferenceMacro( ValidRegion, RegionType );
253 
259  virtual bool IsLinear( void ) const { return false; }
260 
265  {
266  return Self::BSpline;
267  }
268 
269 
270  virtual unsigned int GetNumberOfAffectedWeights( void ) const = 0;
271 
273 
277  typedef ContinuousIndex< ScalarType, SpaceDimension > ContinuousIndexType;
278 
279 protected:
280 
282  virtual void PrintSelf( std::ostream & os, Indent indent ) const;
283 
286 
288  void WrapAsImages( void );
289 
292  const InputPointType & point, ContinuousIndexType & index ) const;
293 
294  void UpdatePointIndexConversions( void );
295 
296  virtual void ComputeNonZeroJacobianIndices(
297  NonZeroJacobianIndicesType & nonZeroJacobianIndices,
298  const RegionType & supportRegion ) const = 0;
299 
301  virtual bool InsideValidRegion( const ContinuousIndexType & index ) const;
302 
307 
314 
319  FixedArray< ScalarType, NDimensions > m_PointToIndexMatrixDiagonal;
320  FixedArray< ScalarType, NDimensions * NDimensions > m_PointToIndexMatrixDiagonalProducts;
323 
325 
327  unsigned long m_Offset;
331 
334 
337 
339  typedef typename JacobianType::ValueType JacobianPixelType;
340  typedef Image< JacobianPixelType,
341  itkGetStaticConstMacro( SpaceDimension ) > JacobianImageType;
342 
343  typename JacobianImageType::Pointer m_JacobianImage[ NDimensions ];
344 
349 
351  ImagePointer m_WrappedImage[ NDimensions ];
352 
355 
356  void UpdateGridOffsetTable( void );
357 
358 private:
359 
360  AdvancedBSplineDeformableTransformBase( const Self & ); // purposely not implemented
361  void operator=( const Self & ); // purposely not implemented
362 
363 };
364 
365 } // namespace itk
366 
367 #ifndef ITK_MANUAL_INSTANTIATION
368 #include "itkAdvancedBSplineDeformableTransformBase.hxx"
369 #endif
370 
371 #endif /* __itkAdvancedBSplineDeformableTransformBase_h */
Matrix< ScalarType, OutputSpaceDimension, InputSpaceDimension > SpatialJacobianType
void SetParameters(const ParametersType &parameters)
virtual const ParametersType & GetParameters(void) const
virtual NumberOfParametersType GetNumberOfParameters(void) const
virtual void SetGridOrigin(const OriginType &origin)
FixedArray< ScalarType, NDimensions *NDimensions > m_PointToIndexMatrixDiagonalProducts
virtual bool InsideValidRegion(const ContinuousIndexType &index) const
ImageRegion< itkGetStaticConstMacro(SpaceDimension) > RegionType
Superclass::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType
virtual void SetGridRegion(const RegionType &region)=0
Superclass::JacobianOfSpatialHessianType JacobianOfSpatialHessianType
void SetFixedParameters(const ParametersType &parameters)
virtual void SetGridSpacing(const SpacingType &spacing)
virtual TransformCategoryType GetTransformCategory(void) const
virtual unsigned int GetNumberOfAffectedWeights(void) const =0
Image< JacobianPixelType, itkGetStaticConstMacro(SpaceDimension) > JacobianImageType
Transform maps points, vectors and covariant vectors from an input space to an output space...
virtual void SetCoefficientImages(ImagePointer images[])
virtual OutputCovariantVectorType TransformCovariantVector(const InputCovariantVectorType &) const
virtual OutputVnlVectorType TransformVector(const InputVnlVectorType &) const
Image< PixelType, itkGetStaticConstMacro(SpaceDimension) > ImageType
AdvancedTransform< TScalarType, NDimensions, NDimensions > Superclass
virtual OutputVectorType TransformVector(const InputVectorType &) const
void TransformPointToContinuousGridIndex(const InputPointType &point, ContinuousIndexType &index) const
itkStaticConstMacro(SpaceDimension, unsigned int, NDimensions)
virtual const ParametersType & GetFixedParameters(void) const
virtual void SetGridDirection(const DirectionType &direction)
ContinuousIndex< ScalarType, SpaceDimension > ContinuousIndexType
virtual NumberOfParametersType GetNumberOfNonZeroJacobianIndices(void) const =0
void SetParametersByValue(const ParametersType &parameters)
virtual void PrintSelf(std::ostream &os, Indent indent) const
virtual void ComputeNonZeroJacobianIndices(NonZeroJacobianIndicesType &nonZeroJacobianIndices, const RegionType &supportRegion) const =0
Base class for deformable transform using a B-spline representation.
FixedArray< Matrix< ScalarType, InputSpaceDimension, InputSpaceDimension >, OutputSpaceDimension > SpatialHessianType
virtual NumberOfParametersType GetNumberOfParametersPerDimension(void) const


Generated on 11-03-2014 for elastix by doxygen 1.8.6 elastix logo