DMRITool  v0.1.1-139-g860d86b4
Diffusion MRI Tool
itkSphericalPolarFourierEstimationImageFilter.h
Go to the documentation of this file.
1 
20 #ifndef __itkSphericalPolarFourierEstimationImageFilter_h
21 #define __itkSphericalPolarFourierEstimationImageFilter_h
22 
24 
28 
29 namespace itk
30 {
31 
39 template < class TInputImage, class TOutputImage >
41  public DiffusionModelEstimationInSphericalCoordinateImageFilter<TInputImage, TOutputImage>
42 {
43 public:
47  typedef SmartPointer<Self> Pointer;
48  typedef SmartPointer<const Self> ConstPointer;
49 
51  itkNewMacro(Self);
52 
55 
58 
59  typedef typename Superclass::MatrixType MatrixType;
60  typedef typename Superclass::VectorType VectorType;
63  typedef typename Superclass::STDVectorType STDVectorType;
65 
66  typedef enum
67  {
68  LS=0,
70  L1_DL
72 
77  typedef enum
78  {
79  FISTA_LS=0,
80  SPAMS
81  } L1SolverType;
82 
86 
87  itkSetMacro(EstimationType, EstimationType);
88  itkGetMacro(EstimationType, EstimationType);
89 
90  itkSetMacro(L1SolverType, L1SolverType);
91  itkGetMacro(L1SolverType, L1SolverType);
92 
93  // itkSetMacro(NeedToConvertToQValue,bool);
94  // itkGetMacro(NeedToConvertToQValue,bool);
95 
96  itkSetMacro(BasisCombinationMatrix, MatrixPointer);
97  itkGetMacro(BasisCombinationMatrix, MatrixPointer);
98  itkSetMacro(BasisEnergyDL, VectorPointer);
99  itkGetMacro(BasisEnergyDL, VectorPointer);
100  itkSetMacro(BasisEnergyPowerDL, double);
101  itkGetMacro(BasisEnergyPowerDL, double);
102 
103  // itkSetMacro(RegularizationWeight, VectorPointer);
104  itkGetMacro(RegularizationWeight, VectorPointer);
105 
106  itkSetMacro(IsOriginalBasis,bool);
107  itkGetMacro(IsOriginalBasis,bool);
108  itkBooleanMacro(IsOriginalBasis);
109 
110  itkSetMacro(LambdaSpherical, double);
111  itkGetMacro(LambdaSpherical, double);
112  itkSetMacro(LambdaRadial, double);
113  itkGetMacro(LambdaRadial, double);
114  itkSetMacro(LambdaL1, double);
115  itkGetMacro(LambdaL1, double);
116 
117 
118  virtual void SetBasisScale(const double scale);
119  itkGetMacro(BasisScale, double);
120 
122  itkSetObjectMacro(MDImage, ScalarImageType);
123  itkGetObjectMacro(MDImage, ScalarImageType);
124  itkGetConstObjectMacro(MDImage, ScalarImageType);
125 
127  itkSetObjectMacro(ScaleImage, ScalarImageType);
128  itkGetObjectMacro(ScaleImage, ScalarImageType);
129  itkGetConstObjectMacro(ScaleImage, ScalarImageType);
130 
131  itkSetGetBooleanMacro(IsAnalyticalB0);
132 
133  itkSetMacro(B0Weight,double);
134  itkGetMacro(B0Weight,double);
135 
136  itkSetMacro(L1FISTASolver, typename L1FISTASolverType::Pointer);
137  itkSetMacro(L1SpamsSolver, typename L1SpamsSolverType::Pointer);
138 
140  virtual std::vector<int> DimToRank(const int dimm) const
141  {return std::vector<int>();}
143  virtual int RankToDim(const bool is_radial=false, const int radialRank=-1, const int shRank=-1) const
144  {return -1;}
145 
146  virtual std::vector<int> GetIndexNLM(const int index) const
147  {return std::vector<int>();};
148  virtual int GetIndexJ(const int n, const int l, const int m) const
149  {return -1;};
150 
152  virtual double ComputeScale(const bool setScale=true);
153 
154  bool IsAdaptiveScale() const
155  {
156  return !IsImageEmpty(this->m_MDImage);
157  }
158 
159 protected:
162  {};
163 
164  void VerifyInputParameters() const ITK_OVERRIDE;
165 
167 
172  void GenerateOutputInformation() ITK_OVERRIDE;
173 
174  void BeforeThreadedGenerateData () ITK_OVERRIDE;
175 
176  void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE;
177  typename LightObject::Pointer InternalClone() const ITK_OVERRIDE;
178 
179 
181  double m_BasisScale;
182 
187  double m_LambdaL1;
189  double m_LambdaL2;
190 
194  VectorPointer m_BasisEnergyDL;
197 
201  double m_B0Weight;
203  MatrixPointer m_BasisMatrixForB0;
204 
206  typename ScalarImageType::Pointer m_MDImage;
207  typename ScalarImageType::Pointer m_ScaleImage;
208 
209  EstimationType m_EstimationType;
210 
214 
215  L1SolverType m_L1SolverType;
216 
219 
220 private:
221  SphericalPolarFourierEstimationImageFilter(const Self&);//purposely not implemented
222  void operator=(const Self&);//purposely not implemented
223 
224 };
225 
226 }
227 
228 #if ITK_TEMPLATE_EXPLICIT
229 # include "Templates/itkSphericalPolarFourierEstimationImageFilter+-.h"
230 #endif
231 
232 #if !defined(ITK_MANUAL_INSTANTIATION) && !defined(__itkSphericalPolarFourierEstimationImageFilter_hxx)
234 #endif
235 
236 #endif
solve least square problem with L1 regularization using FISTA
bool IsImageEmpty(const SmartPointer< ImageType > &image)
Definition: utlITK.h:435
#define itkTypedefMaskedImageToImageMacro(Superclass)
Definition: utlITKMacro.h:165
virtual std::vector< int > GetIndexNLM(const int index) const
virtual int RankToDim(const bool is_radial=false, const int radialRank=-1, const int shRank=-1) const
#define ITK_OVERRIDE
Definition: utlITKMacro.h:46
DiffusionModelEstimationInSphericalCoordinateImageFilter< TInputImage, TOutputImage > Superclass
virtual int GetIndexJ(const int n, const int l, const int m) const
static void InitializeThreadedLibraries(const int numThreads)
Definition: utl.h:327
estimate the coeffcients of generalized Spherical Polar Fourier basis which can be separated into dif...
solve least square problem with L2 regularization
solve weighted LASSO using spams
base filter for estimation of diffusion models in spherical coordinates
#define itkSetGetBooleanMacro(name)
Definition: utlITKMacro.h:139