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 
32 #ifndef __itkAdvancedBSplineDeformableTransform_h
33 #define __itkAdvancedBSplineDeformableTransform_h
34 
36 #include "itkImage.h"
37 #include "itkImageRegion.h"
41 
42 
43 namespace itk
44 {
45 
123 template <
124  class TScalarType = double, // Data type for scalars
125  unsigned int NDimensions = 3, // Number of dimensions
126  unsigned int VSplineOrder = 3 > // Spline order
128  : public AdvancedBSplineDeformableTransformBase< TScalarType, NDimensions >
129 {
130 public:
134  TScalarType, NDimensions > Superclass;
135  typedef SmartPointer<Self> Pointer;
136  typedef SmartPointer<const Self> ConstPointer;
137 
139  itkNewMacro( Self );
140 
143 
145  itkStaticConstMacro( SpaceDimension, unsigned int, NDimensions );
146 
148  itkStaticConstMacro( SplineOrder, unsigned int, VSplineOrder );
149 
160  typedef typename Superclass::InputCovariantVectorType
164 
165  typedef typename Superclass
168  typedef typename Superclass
171  typedef typename Superclass
174 
176  typedef typename Superclass::PixelType PixelType;
177  typedef typename Superclass::ImageType ImageType;
178  typedef typename Superclass::ImagePointer ImagePointer;
179 
181  typedef typename Superclass::RegionType RegionType;
182 
183  typedef typename Superclass::IndexType IndexType;
184  typedef typename Superclass::SizeType SizeType;
185  typedef typename Superclass::SpacingType SpacingType;
186  typedef typename Superclass::DirectionType DirectionType;
187  typedef typename Superclass::OriginType OriginType;
188  typedef typename Superclass::GridOffsetType GridOffsetType;
189 
191  virtual void SetGridRegion( const RegionType& region );
192 
194  OutputPointType TransformPoint( const InputPointType & point ) const;
195 
198  itkGetStaticConstMacro( SpaceDimension ),
199  itkGetStaticConstMacro( SplineOrder ) > WeightsFunctionType;
203  ScalarType,
204  itkGetStaticConstMacro( SpaceDimension ),
205  itkGetStaticConstMacro( SplineOrder ) > DerivativeWeightsFunctionType;
207  ScalarType,
208  itkGetStaticConstMacro( SpaceDimension ),
209  itkGetStaticConstMacro( SplineOrder ) > SODerivativeWeightsFunctionType;
210 
212  typedef typename Superclass::ParameterIndexArrayType ParameterIndexArrayType;
213 
221  virtual void TransformPoint(
222  const InputPointType & inputPoint,
223  OutputPointType & outputPoint,
224  WeightsType & weights,
225  ParameterIndexArrayType & indices,
226  bool & inside ) const;
227 
229  unsigned long GetNumberOfWeights( void ) const
230  {
231  return this->m_WeightsFunction->GetNumberOfWeights();
232  }
233 
234  unsigned int GetNumberOfAffectedWeights( void ) const;
235 
236  virtual unsigned long GetNumberOfNonZeroJacobianIndices( void ) const;
237 
239  virtual const JacobianType & GetJacobian( const InputPointType & point ) const;
240 
242  virtual void GetJacobian(
243  const InputPointType & ipp,
244  WeightsType & weights,
245  ParameterIndexArrayType & indices ) const;
246 
248  virtual void GetJacobian(
249  const InputPointType & ipp,
250  JacobianType & j,
251  NonZeroJacobianIndicesType & ) const;
252 
254  virtual void GetSpatialJacobian(
255  const InputPointType & ipp,
256  SpatialJacobianType & sj ) const;
257 
259  virtual void GetSpatialHessian(
260  const InputPointType & ipp,
261  SpatialHessianType & sh ) const;
262 
264  virtual void GetJacobianOfSpatialJacobian(
265  const InputPointType & ipp,
266  JacobianOfSpatialJacobianType & jsj,
267  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const;
268 
272  virtual void GetJacobianOfSpatialJacobian(
273  const InputPointType & ipp,
274  SpatialJacobianType & sj,
275  JacobianOfSpatialJacobianType & jsj,
276  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const;
277 
279  virtual void GetJacobianOfSpatialHessian(
280  const InputPointType & ipp,
281  JacobianOfSpatialHessianType & jsh,
282  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const;
283 
287  virtual void GetJacobianOfSpatialHessian(
288  const InputPointType & ipp,
289  SpatialHessianType & sh,
290  JacobianOfSpatialHessianType & jsh,
291  NonZeroJacobianIndicesType & nonZeroJacobianIndices ) const;
292 
293 protected:
295  virtual void PrintSelf( std::ostream &os, Indent indent ) const;
296 
299 
301  // Why??
302  itkSetObjectMacro( WeightsFunction, WeightsFunctionType );
303  itkGetObjectMacro( WeightsFunction, WeightsFunctionType );
304 
306  void WrapAsImages( void );
307 
308  virtual void ComputeNonZeroJacobianIndices(
309  NonZeroJacobianIndicesType & nonZeroJacobianIndices,
310  const RegionType & supportRegion ) const;
311 
312  typedef typename Superclass::JacobianImageType JacobianImageType;
313  typedef typename Superclass::JacobianPixelType JacobianPixelType;
314 
319  typename WeightsFunctionType::Pointer m_WeightsFunction;
320  std::vector<
322  std::vector< std::vector<
324 
325 private:
326  AdvancedBSplineDeformableTransform(const Self&); //purposely not implemented
327  void operator=(const Self&); //purposely not implemented
328 
329 }; //class AdvancedBSplineDeformableTransform
330 
331 
332 } // namespace itk
333 
334 // Define instantiation macro for this template.
335 #define ITK_TEMPLATE_AdvancedBSplineDeformableTransform(_, EXPORT, x, y) namespace itk { \
336  _(3(class EXPORT AdvancedBSplineDeformableTransform< ITK_TEMPLATE_3 x >)) \
337  namespace Templates { typedef AdvancedBSplineDeformableTransform< ITK_TEMPLATE_3 x > \
338  AdvancedBSplineDeformableTransform##y; } \
339  }
340 
341 #if ITK_TEMPLATE_EXPLICIT
342 # include "Templates/itkAdvancedBSplineDeformableTransform+-.h"
343 #endif
344 
345 #if ITK_TEMPLATE_TXX
346 # include "itkAdvancedBSplineDeformableTransform.txx"
347 #endif
348 
349 #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
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-12-2013 for elastix by doxygen 1.8.5 elastix logo