ANIMA  4.0
animaMultiCompartmentModelCreator.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include <animaBaseCompartment.h>
5 #include <AnimaMCMExport.h>
6 
7 namespace anima
8 {
9 
11 // One could think of making it a singleton, but parameter are somewhat in the way
12 class ANIMAMCM_EXPORT MultiCompartmentModelCreator
13 {
14 public:
17 
20 
24 
25  // Isotropic compartments (one free water, one stationary water, one restricted water
26  void SetModelWithFreeWaterComponent(bool arg) {m_ModelWithFreeWaterComponent = arg;}
27  void SetModelWithStationaryWaterComponent(bool arg) {m_ModelWithStationaryWaterComponent = arg;}
28  void SetModelWithRestrictedWaterComponent(bool arg) {m_ModelWithRestrictedWaterComponent = arg;}
29  void SetModelWithStaniszComponent(bool arg) {m_ModelWithStaniszComponent = arg;}
30 
31  void SetCompartmentType(CompartmentType arg) {m_CompartmentType = arg;}
32  void SetNumberOfCompartments(unsigned int num) {m_NumberOfCompartments = num;}
33  void SetVariableProjectionEstimationMode(bool arg) {m_VariableProjectionEstimationMode = arg;}
34 
35  void SetUseConstrainedDiffusivity(bool arg) {m_UseConstrainedDiffusivity = arg;}
36  void SetUseConstrainedOrientationConcentration(bool arg) {m_UseConstrainedOrientationConcentration = arg;}
37  void SetUseConstrainedExtraAxonalFraction(bool arg) {m_UseConstrainedExtraAxonalFraction = arg;}
38  void SetUseConstrainedFreeWaterDiffusivity(bool arg) {m_UseConstrainedFreeWaterDiffusivity = arg;}
39  void SetUseConstrainedIRWDiffusivity(bool arg) {m_UseConstrainedIRWDiffusivity = arg;}
40  void SetUseConstrainedStaniszDiffusivity(bool arg) {m_UseConstrainedStaniszDiffusivity = arg;}
41  void SetUseConstrainedStaniszRadius(bool arg) {m_UseConstrainedStaniszRadius = arg;}
42 
43  bool GetUseConstrainedDiffusivity() {return m_UseConstrainedDiffusivity;}
44  bool GetUseConstrainedOrientationConcentration() {return m_UseConstrainedOrientationConcentration;}
45  bool GetUseConstrainedExtraAxonalFraction() {return m_UseConstrainedExtraAxonalFraction;}
46 
47  void SetUseCommonDiffusivities(bool arg) {m_UseCommonDiffusivities = arg;}
48  void SetUseCommonConcentrations(bool arg) {m_UseCommonConcentrations = arg;}
49  void SetUseCommonExtraAxonalFractions(bool arg) {m_UseCommonExtraAxonalFractions = arg;}
50 
51  bool GetUseCommonDiffusivities() {return m_UseCommonDiffusivities;}
52  bool GetUseCommonConcentrations() {return m_UseCommonConcentrations;}
53  bool GetUseCommonExtraAxonalFractions() {return m_UseCommonExtraAxonalFractions;}
54 
55  void SetFreeWaterDiffusivityValue(double arg) {m_FreeWaterDiffusivity = arg;}
56  void SetIRWDiffusivityValue(double arg) {m_IRWDiffusivity = arg;}
57  void SetStaniszDiffusivityValue(double arg) {m_StaniszDiffusivity = arg;}
58  void SetAxialDiffusivityValue(double arg) {m_AxialDiffusivity = arg;}
59  void SetRadialDiffusivity1Value(double arg) {m_RadialDiffusivity1 = arg;}
60  void SetRadialDiffusivity2Value(double arg) {m_RadialDiffusivity2 = arg;}
61 
62  double GetOrientationConcentration() {return m_OrientationConcentration;}
63  double GetAxialDiffusivity() {return m_AxialDiffusivity;}
64  double GetRadialDiffusivity1() {return m_RadialDiffusivity1;}
65  double GetRadialDiffusivity2() {return m_RadialDiffusivity2;}
66  double GetExtraAxonalFraction() {return m_ExtraAxonalFraction;}
67 
68  MCMPointer GetNewMultiCompartmentModel();
69 
70 private:
71  void CreateStickCompartment(BaseCompartmentPointer &compartmentPointer, bool applyConstraints);
72  void CreateZeppelinCompartment(BaseCompartmentPointer &compartmentPointer, bool applyConstraints);
73  void CreateTensorCompartment(BaseCompartmentPointer &compartmentPointer, bool applyConstraints);
74  void CreateNODDICompartment(BaseCompartmentPointer &compartmentPointer, bool applyConstraints);
75  virtual void CreateDDICompartment(BaseCompartmentPointer &compartmentPointer, bool applyConstraints);
76 
77  CompartmentType m_CompartmentType;
78  bool m_ModelWithFreeWaterComponent, m_ModelWithStationaryWaterComponent;
79  bool m_ModelWithRestrictedWaterComponent, m_ModelWithStaniszComponent;
80  unsigned int m_NumberOfCompartments;
81 
82  bool m_VariableProjectionEstimationMode;
83  bool m_UseConstrainedDiffusivity;
84  bool m_UseConstrainedOrientationConcentration;
85  bool m_UseConstrainedExtraAxonalFraction;
86  bool m_UseConstrainedFreeWaterDiffusivity;
87  bool m_UseConstrainedIRWDiffusivity;
88  bool m_UseConstrainedStaniszDiffusivity;
89  bool m_UseConstrainedStaniszRadius;
90 
91  bool m_UseCommonDiffusivities;
92  bool m_UseCommonConcentrations;
93  bool m_UseCommonExtraAxonalFractions;
94 
95  double m_FreeWaterDiffusivity, m_IRWDiffusivity, m_StaniszDiffusivity;
96  double m_OrientationConcentration, m_ExtraAxonalFraction;
97  double m_AxialDiffusivity;
98  double m_RadialDiffusivity1, m_RadialDiffusivity2;
99 };
100 
101 } // end namespace anima
DiffusionModelCompartmentType
anima::DiffusionModelCompartmentType CompartmentType
itk::SmartPointer< Self > Pointer
MultiCompartmentModel: holds several diffusion compartments, ordered by type It also handles weights ...
Really this class is some simplified factory that creates the MCM that it knows.