ANIMA  4.0
animaDenseSVFTransformAgregator.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include <itkStationaryVelocityFieldTransform.h>
5 
6 namespace anima
7 {
8 
9 template <unsigned int NDimensions = 3>
11 public BaseTransformAgregator <NDimensions>
12 {
13 public:
15  typedef typename Superclass::PointType PointType;
18  typedef typename itk::StationaryVelocityFieldTransform<ScalarType,NDimensions> BaseOutputTransformType;
20 
21  typedef itk::Image <ScalarType,NDimensions> WeightImageType;
22  typedef typename WeightImageType::IndexType IndexType;
23  typedef typename WeightImageType::Pointer WeightImagePointer;
24 
25  typedef itk::MatrixOffsetTransformBase <InternalScalarType, NDimensions, NDimensions> BaseMatrixTransformType;
26  typedef typename BaseMatrixTransformType::ParametersType ParametersType;
27 
28  typedef typename BaseOutputTransformType::VectorFieldType VelocityFieldType;
29  typedef typename VelocityFieldType::Pointer VelocityFieldPointer;
30  typedef typename VelocityFieldType::IndexType VelocityFieldIndexType;
31  typedef typename VelocityFieldType::PixelType VelocityFieldPixelType;
32  typedef typename VelocityFieldType::PointType VelocityFieldPointType;
33  typedef typename VelocityFieldType::RegionType VelocityFieldRegionType;
34  typedef typename VelocityFieldType::SpacingType VelocityFieldSpacingType;
35  typedef typename VelocityFieldType::DirectionType VelocityFieldDirectionType;
36 
39 
40  virtual bool Update();
41 
42  void SetExtrapolationSigma(double sigma) {m_ExtrapolationSigma = sigma;}
43  void SetOutlierRejectionSigma(double sigma) {m_OutlierRejectionSigma = sigma;}
44 
45  void SetNumberOfWorkUnits(unsigned int num) {m_NumberOfThreads = num;}
46 
47  void SetNeighborhoodHalfSize(unsigned int num) {m_NeighborhoodHalfSize = num;}
48  void SetDistanceBoundary(double num) {m_DistanceBoundary = num;}
50 
51  template <class TInputImageType> void SetGeometryInformation(const TInputImageType *geomImage)
52  {
53  if (geomImage == NULL)
54  return;
55 
56  m_Origin = geomImage->GetOrigin();
57  m_LargestRegion = geomImage->GetLargestPossibleRegion();
58  m_Spacing = geomImage->GetSpacing();
59  m_Direction = geomImage->GetDirection();
60  }
61 
62 protected:
65 
66  unsigned int m_NeighborhoodHalfSize;
69 
70  VelocityFieldPointType m_Origin;
71  VelocityFieldRegionType m_LargestRegion;
72  VelocityFieldSpacingType m_Spacing;
73  VelocityFieldDirectionType m_Direction;
74 
75  unsigned int m_NumberOfThreads;
76 
77 private:
78  void estimateSVFFromTranslations();
79  void estimateSVFFromRigidTransforms();
80  void estimateSVFFromAffineTransforms();
81 };
82 
83 } // end of namespace anima
84 
VelocityFieldType::RegionType VelocityFieldRegionType
BaseMatrixTransformType::ParametersType ParametersType
itk::Point< InternalScalarType, NDimensions > PointType
VelocityFieldType::DirectionType VelocityFieldDirectionType
itk::Image< ScalarType, NDimensions > WeightImageType
itk::MatrixOffsetTransformBase< InternalScalarType, NDimensions, NDimensions > BaseMatrixTransformType
BaseOutputTransformType::VectorFieldType VelocityFieldType
VelocityFieldType::PointType VelocityFieldPointType
void SetGeometryInformation(const TInputImageType *geomImage)
BaseTransformAgregator< NDimensions > Superclass
VelocityFieldType::PixelType VelocityFieldPixelType
Superclass::BaseInputTransformType BaseInputTransformType
VelocityFieldType::IndexType VelocityFieldIndexType
Superclass::InternalScalarType InternalScalarType
itk::StationaryVelocityFieldTransform< ScalarType, NDimensions > BaseOutputTransformType
VelocityFieldType::SpacingType VelocityFieldSpacingType
itk::Transform< InternalScalarType, NDimensions, NDimensions > BaseInputTransformType