go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkAdvancedBSplineDeformableTransform.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 /*=========================================================================
16 
17  Program: Insight Segmentation & Registration Toolkit
18  Module: $RCSfile: itkAdvancedBSplineDeformableTransform.h,v $
19  Language: C++
20  Date: $Date: 2008-04-11 16:28:11 $
21  Version: $Revision: 1.38 $
22 
23  Copyright (c) Insight Software Consortium. All rights reserved.
24  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
25 
26  This software is distributed WITHOUT ANY WARRANTY; without even
27  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
28  PURPOSE. See the above copyright notices for more information.
29 
30 =========================================================================*/
31 #ifndef __itkAdvancedBSplineDeformableTransform_h
32 #define __itkAdvancedBSplineDeformableTransform_h
33 
35 #include "itkImage.h"
36 #include "itkImageRegion.h"
40 
41 
42 namespace itk
43 {
44 
45 // Forward declarations for friendship
46 template <class TScalarType, unsigned int NDimensions, unsigned int VSplineOrder>
48 
126 template <
127  class TScalarType = double, // Data type for scalars
128  unsigned int NDimensions = 3, // Number of dimensions
129  unsigned int VSplineOrder = 3 > // Spline order
131  : public AdvancedBSplineDeformableTransformBase< TScalarType, NDimensions >
132 {
133 public:
137  TScalarType, NDimensions > Superclass;
138  typedef SmartPointer<Self> Pointer;
139  typedef SmartPointer<const Self> ConstPointer;
140 
142  itkNewMacro( Self );
143 
146 
148  itkStaticConstMacro( SpaceDimension, unsigned int, NDimensions );
149 
151  itkStaticConstMacro( SplineOrder, unsigned int, VSplineOrder );
152 
164  typedef typename Superclass::InputCovariantVectorType
168 
169  typedef typename Superclass
172  typedef typename Superclass
175  typedef typename Superclass
178 
180  typedef typename Superclass::PixelType PixelType;
181  typedef typename Superclass::ImageType ImageType;
182  typedef typename Superclass::ImagePointer ImagePointer;
183 
185  typedef typename Superclass::RegionType RegionType;
186 
187  typedef typename Superclass::IndexType IndexType;
188  typedef typename Superclass::SizeType SizeType;
189  typedef typename Superclass::SpacingType SpacingType;
190  typedef typename Superclass::DirectionType DirectionType;
191  typedef typename Superclass::OriginType OriginType;
192  typedef typename Superclass::GridOffsetType GridOffsetType;
193 
195  virtual void SetGridRegion( const RegionType& region );
196 
198  OutputPointType TransformPoint( const InputPointType & point ) const;
199 
202  itkGetStaticConstMacro( SpaceDimension ),
203  itkGetStaticConstMacro( SplineOrder ) > WeightsFunctionType;
207  ScalarType,
208  itkGetStaticConstMacro( SpaceDimension ),
209  itkGetStaticConstMacro( SplineOrder ) > DerivativeWeightsFunctionType;
211  ScalarType,
212  itkGetStaticConstMacro( SpaceDimension ),
213  itkGetStaticConstMacro( SplineOrder ) > SODerivativeWeightsFunctionType;
214 
216  typedef typename Superclass::ParameterIndexArrayType ParameterIndexArrayType;
217 
225  virtual void TransformPoint(
226  const InputPointType & inputPoint,
227  OutputPointType & outputPoint,
228  WeightsType & weights,
229  ParameterIndexArrayType & indices,
230  bool & inside ) const;
231 
233  unsigned long GetNumberOfWeights( void ) const
234  {
235  return this->m_WeightsFunction->GetNumberOfWeights();
236  }
237 
238  unsigned int GetNumberOfAffectedWeights( void ) const;
239 
240  virtual unsigned long GetNumberOfNonZeroJacobianIndices( void ) const;
241 
243  virtual void GetJacobian(
244  const InputPointType & ipp,
245  JacobianType & j,
246  NonZeroJacobianIndicesType & ) const;
247 
249  virtual void GetSpatialJacobian(
250  const InputPointType & ipp,
251  SpatialJacobianType & sj ) const;
252 
254  virtual void GetSpatialHessian(
255  const InputPointType & ipp,
256  SpatialHessianType & sh ) const;
257 
259  virtual void GetJacobianOfSpatialJacobian(
260  const InputPointType & ipp,
261  JacobianOfSpatialJacobianType & jsj,
262  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const;
263 
267  virtual void GetJacobianOfSpatialJacobian(
268  const InputPointType & ipp,
269  SpatialJacobianType & sj,
270  JacobianOfSpatialJacobianType & jsj,
271  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const;
272 
274  virtual void GetJacobianOfSpatialHessian(
275  const InputPointType & ipp,
276  JacobianOfSpatialHessianType & jsh,
277  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const;
278 
282  virtual void GetJacobianOfSpatialHessian(
283  const InputPointType & ipp,
284  SpatialHessianType & sh,
285  JacobianOfSpatialHessianType & jsh,
286  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const;
287 
288 protected:
290  virtual void PrintSelf( std::ostream &os, Indent indent ) const;
291 
294 
296  // Why??
297  itkSetObjectMacro( WeightsFunction, WeightsFunctionType );
298  itkGetObjectMacro( WeightsFunction, WeightsFunctionType );
299 
301  void WrapAsImages( void );
302 
303  virtual void ComputeNonZeroJacobianIndices(
304  NonZeroJacobianIndicesType & nonZeroJacobianIndices,
305  const RegionType & supportRegion ) const;
306 
307  typedef typename Superclass::JacobianImageType JacobianImageType;
308  typedef typename Superclass::JacobianPixelType JacobianPixelType;
309 
314  typename WeightsFunctionType::Pointer m_WeightsFunction;
315  std::vector<
317  std::vector< std::vector<
319 
320 private:
321  AdvancedBSplineDeformableTransform(const Self&); //purposely not implemented
322  void operator=(const Self&); //purposely not implemented
323 
325  itkGetStaticConstMacro( SpaceDimension ),
326  itkGetStaticConstMacro( SplineOrder ) >;
327 
328 }; //class AdvancedBSplineDeformableTransform
329 
330 
331 } // namespace itk
332 
333 // Define instantiation macro for this template.
334 #define ITK_TEMPLATE_AdvancedBSplineDeformableTransform(_, EXPORT, x, y) namespace itk { \
335  _(3(class EXPORT AdvancedBSplineDeformableTransform< ITK_TEMPLATE_3 x >)) \
336  namespace Templates { typedef AdvancedBSplineDeformableTransform< ITK_TEMPLATE_3 x > \
337  AdvancedBSplineDeformableTransform##y; } \
338  }
339 
340 #if ITK_TEMPLATE_EXPLICIT
341 # include "Templates/itkAdvancedBSplineDeformableTransform+-.h"
342 #endif
343 
344 #if ITK_TEMPLATE_TXX
345 # include "itkAdvancedBSplineDeformableTransform.txx"
346 #endif
347 
348 #endif /* __itkAdvancedBSplineDeformableTransform_h */
Matrix< ScalarType, OutputSpaceDimension, InputSpaceDimension > SpatialJacobianType
Deformable transform using a B-spline representation.
Superclass::InputCovariantVectorType InputCovariantVectorType
BSplineInterpolationSecondOrderDerivativeWeightFunction< ScalarType, itkGetStaticConstMacro(SpaceDimension), itkGetStaticConstMacro(SplineOrder) > SODerivativeWeightsFunctionType
Superclass::JacobianOfSpatialHessianType JacobianOfSpatialHessianType
ImageRegion< itkGetStaticConstMacro(SpaceDimension) > RegionType
Superclass::OutputCovariantVectorType OutputCovariantVectorType
BSplineInterpolationWeightFunction2< ScalarType, itkGetStaticConstMacro(SpaceDimension), itkGetStaticConstMacro(SplineOrder) > WeightsFunctionType
std::vector< typename DerivativeWeightsFunctionType::Pointer > m_DerivativeWeightsFunctions
BSplineInterpolationDerivativeWeightFunction< ScalarType, itkGetStaticConstMacro(SpaceDimension), itkGetStaticConstMacro(SplineOrder) > DerivativeWeightsFunctionType
Returns the weights over the support region used for B-spline interpolation/reconstruction.
AdvancedBSplineDeformableTransformBase< TScalarType, NDimensions > Superclass
Returns the weights over the support region used for B-spline interpolation/reconstruction.
Superclass::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
WeightsFunctionType::ContinuousIndexType ContinuousIndexType
std::vector< std::vector< typename SODerivativeWeightsFunctionType::Pointer > > m_SODerivativeWeightsFunctions
This transform is a composition of B-spline transformations, allowing sliding motion between differen...
Superclass::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType
Returns the weights over the support region used for B-spline interpolation/reconstruction.
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