DMRITool  v0.1.1-139-g860d86b4
Diffusion MRI Tool
itkDiscreteBasisMatrixGenerator.h
Go to the documentation of this file.
1 
18 #ifndef __itkDiscreteBasisMatrixGenerator_h
19 #define __itkDiscreteBasisMatrixGenerator_h
20 
21 
23 
24 namespace itk
25 {
26 
35 template <typename TElement = double>
37  : public BasisMatrixGenerator<TElement>
38 {
39 public:
43  typedef SmartPointer<Self> Pointer;
44  typedef SmartPointer<const Self> ConstPointer;
45 
48 
50  itkNewMacro(Self);
51 
53  typedef typename Superclass::MatrixType MatrixType;
54  typedef typename Superclass::VectorType VectorType;
56  typedef typename Superclass::VectorPointer VectorPointer;
57  typedef typename Superclass::STDVectorType STDVectorType;
58  typedef typename Superclass::STDVectorPointer STDVectorPointer;
59 
60  itkSetMacro(BasisOrientations, MatrixPointer);
61  itkGetMacro(BasisOrientations, MatrixPointer);
62 
63  int GetNumberOfBasis() const override
64  {
65  int numberOfBasis = this->m_BasisOrientations->Rows();
66  if (m_UseIsotropicTerm)
67  numberOfBasis += 1;
68  return numberOfBasis;
69  }
70 
72  itkSetMacro(UseIsotropicTerm, bool);
73  itkGetMacro(UseIsotropicTerm, bool);
74  itkBooleanMacro(UseIsotropicTerm);
75 
76  void Flip(const int flipx, const int flipy, const int flipz) override
77  {
78  std::vector<int> flipVec(3);
79  flipVec[0]=flipx, flipVec[1]=flipy, flipVec[2]=flipz;
80  MatrixPointer mat (new MatrixType());
81  *mat = utl::FlipOrientations(*m_BasisOrientations, flipVec);
82  m_BasisOrientations = mat;
83  }
84 
85 protected:
88  {}
89 
90  virtual void VerifyInputParameters() const ITK_OVERRIDE;
91 
92  void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE;
93  typename LightObject::Pointer InternalClone() const ITK_OVERRIDE;
94 
96 
97  MatrixPointer m_BasisOrientations;
98 
99 private:
100  DiscreteBasisMatrixGenerator(const Self&); //purposely not implemented
101  void operator=(const Self&); //purposely not implemented
102 };
103 
104 } // end namespace itk
105 
106 // Define instantiation macro for this template.
107 #define ITK_TEMPLATE_DiscreteBasisMatrixGenerator(_, EXPORT, x, y) namespace itk { \
108  _(2(class EXPORT DiscreteBasisMatrixGenerator< ITK_TEMPLATE_2 x >)) \
109  namespace Templates { typedef DiscreteBasisMatrixGenerator< ITK_TEMPLATE_2 x > DiscreteBasisMatrixGenerator##y; } \
110  }
111 
112 #if ITK_TEMPLATE_EXPLICIT
113 # include "Templates/itkDiscreteBasisMatrixGenerator+-.h"
114 #endif
115 
116 #if !defined(ITK_MANUAL_INSTANTIATION) && !defined(__itkDiscreteBasisMatrixGenerator_hxx)
118 #endif
119 
120 
121 #endif
void Flip(const int flipx, const int flipy, const int flipz) override
BasisMatrixGenerator< TElement > Superclass
NDArray< T, 2 > FlipOrientations(const NDArray< T, 2 > &in, const std::vector< int > &flip)
#define ITK_OVERRIDE
Definition: utlITKMacro.h:46
utl_shared_ptr< MatrixType > MatrixPointer