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 
15 #ifndef __itkAdvancedBSplineDeformableTransformBase_h
16 #define __itkAdvancedBSplineDeformableTransformBase_h
17 
18 #include "itkAdvancedTransform.h"
19 #include "itkImage.h"
20 #include "itkImageRegion.h"
21 
22 
23 namespace itk
24 {
25 
36 template <
37  class TScalarType = double, // Data type for scalars
38  unsigned int NDimensions = 3 > // Number of dimensions
40  : public AdvancedTransform< TScalarType, NDimensions, NDimensions >
41 {
42 public:
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 
57  typedef typename Superclass::ParametersType ParametersType;
71 
72  typedef typename Superclass
75  typedef typename Superclass
78  typedef typename Superclass
81 
100  void SetParameters( const ParametersType & parameters );
101 
117  void SetFixedParameters( const ParametersType & parameters );
118 
135  void SetParametersByValue( const ParametersType & parameters );
136 
145  void SetIdentity( void );
146 
148  virtual const ParametersType& GetParameters( void ) const;
149 
151  virtual const ParametersType& GetFixedParameters( void ) const;
152 
154  typedef typename ParametersType::ValueType PixelType;
155  typedef Image< PixelType,
156  itkGetStaticConstMacro( SpaceDimension )> ImageType;
157  typedef typename ImageType::Pointer ImagePointer;
158 
160  virtual const ImagePointer * GetCoefficientImage( void ) const
161  { return this->m_CoefficientImage; }
162 
174  virtual void SetCoefficientImage( ImagePointer images[] );
175 
177  typedef ImageRegion< itkGetStaticConstMacro( SpaceDimension ) > RegionType;
178 
179  typedef typename RegionType::IndexType IndexType;
180  typedef typename RegionType::SizeType SizeType;
181  typedef typename ImageType::SpacingType SpacingType;
182  typedef typename ImageType::DirectionType DirectionType;
183  typedef typename ImageType::PointType OriginType;
185 
187  virtual void SetGridRegion( const RegionType& region ) = 0;
188  //itkGetMacro( GridRegion, RegionType );
189  itkGetConstMacro( GridRegion, RegionType );
190 
192  virtual void SetGridSpacing( const SpacingType & spacing );
193  //itkGetMacro( GridSpacing, SpacingType );
194  itkGetConstMacro( GridSpacing, SpacingType );
195 
197  virtual void SetGridDirection( const DirectionType & direction );
198  //itkGetMacro( GridDirection, DirectionType );
199  itkGetConstMacro( GridDirection, DirectionType );
200 
202  virtual void SetGridOrigin( const OriginType& origin );
203  //itkGetMacro( GridOrigin, OriginType );
204  itkGetConstMacro( GridOrigin, OriginType );
205 
207  typedef Array<unsigned long> ParameterIndexArrayType;
208 
213  {
214  itkExceptionMacro( << "Method not applicable for deformable transform." );
215  return OutputVectorType();
216  }
217 
222  {
223  itkExceptionMacro( << "Method not applicable for deformable transform. ");
224  return OutputVnlVectorType();
225  }
226 
231  const InputCovariantVectorType & ) const
232  {
233  itkExceptionMacro( << "Method not applicable for deformable transform. ");
234  return OutputCovariantVectorType();
235  }
236 
238  virtual NumberOfParametersType GetNumberOfParameters( void ) const;
239 
241  virtual NumberOfParametersType GetNumberOfParametersPerDimension( void ) const;
242 
244  itkGetConstReferenceMacro( ValidRegion, RegionType );
245 
251  virtual bool IsLinear( void ) const { return false; }
252 
253  virtual unsigned int GetNumberOfAffectedWeights( void ) const = 0;
254 
255  virtual unsigned long GetNumberOfNonZeroJacobianIndices( void ) const = 0;
256 
260  typedef ContinuousIndex<ScalarType, SpaceDimension> ContinuousIndexType;
261 
262 protected:
264  virtual void PrintSelf( std::ostream &os, Indent indent ) const;
265 
268 
270  void WrapAsImages( void );
271 
273  void TransformPointToContinuousGridIndex(
274  const InputPointType & point, ContinuousIndexType & index ) const;
275 
276  virtual void ComputeNonZeroJacobianIndices(
277  NonZeroJacobianIndicesType & nonZeroJacobianIndices,
278  const RegionType & supportRegion ) const = 0;
279 
281  virtual bool InsideValidRegion( const ContinuousIndexType& index ) const;
282 
286  ImagePointer m_CoefficientImage[ NDimensions ];
287 
294 
300 
302 
304  unsigned long m_Offset;
308 
311 
314 
316  typedef typename JacobianType::ValueType JacobianPixelType;
317  typedef Image< JacobianPixelType,
318  itkGetStaticConstMacro( SpaceDimension ) > JacobianImageType;
319 
320  typename JacobianImageType::Pointer m_JacobianImage[ NDimensions ];
321 
326 
328  ImagePointer m_WrappedImage[ NDimensions ];
329 
332 
333  void UpdateGridOffsetTable( void );
334 
335 private:
336  AdvancedBSplineDeformableTransformBase(const Self&); //purposely not implemented
337  void operator=(const Self&); //purposely not implemented
338 
339 }; //class AdvancedBSplineDeformableTransformBase
340 
341 
342 } // namespace itk
343 
344 // Define instantiation macro for this template.
345 #define ITK_TEMPLATE_AdvancedBSplineDeformableTransformBase(_, EXPORT, x, y) namespace itk { \
346  _(3(class EXPORT AdvancedBSplineDeformableTransformBase< ITK_TEMPLATE_3 x >)) \
347  namespace Templates { typedef AdvancedBSplineDeformableTransformBase< ITK_TEMPLATE_3 x > \
348  AdvancedBSplineDeformableTransformBase##y; } \
349  }
350 
351 #if ITK_TEMPLATE_EXPLICIT
352 # include "Templates/itkAdvancedBSplineDeformableTransformBase+-.h"
353 #endif
354 
355 #if ITK_TEMPLATE_TXX
356 # include "itkAdvancedBSplineDeformableTransformBase.txx"
357 #endif
358 
359 #endif /* __itkAdvancedBSplineDeformableTransformBase_h */
Matrix< ScalarType, OutputSpaceDimension, InputSpaceDimension > SpatialJacobianType
Image< PixelType, itkGetStaticConstMacro(SpaceDimension)> ImageType
ImageRegion< itkGetStaticConstMacro(SpaceDimension) > RegionType
Superclass::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType
Superclass::JacobianOfSpatialHessianType JacobianOfSpatialHessianType
Image< JacobianPixelType, itkGetStaticConstMacro(SpaceDimension) > JacobianImageType
Transform maps points, vectors and covariant vectors from an input space to an output space...
virtual OutputCovariantVectorType TransformCovariantVector(const InputCovariantVectorType &) const
virtual OutputVnlVectorType TransformVector(const InputVnlVectorType &) const
AdvancedTransform< TScalarType, NDimensions, NDimensions > Superclass
virtual OutputVectorType TransformVector(const InputVectorType &) const
ContinuousIndex< ScalarType, SpaceDimension > ContinuousIndexType
Base class for deformable transform using a B-spline representation.
FixedArray< Matrix< ScalarType, InputSpaceDimension, InputSpaceDimension >, OutputSpaceDimension > SpatialHessianType


Generated on 05-01-2014 for elastix by doxygen 1.8.5 elastix logo