17 m_CompartmentType =
Tensor;
18 m_ModelWithFreeWaterComponent =
false;
19 m_ModelWithStationaryWaterComponent =
false;
20 m_ModelWithRestrictedWaterComponent =
false;
21 m_ModelWithStaniszComponent =
false;
23 m_NumberOfCompartments = 1;
24 m_VariableProjectionEstimationMode =
true;
26 m_UseConstrainedDiffusivity =
false;
27 m_UseConstrainedFreeWaterDiffusivity =
true;
28 m_UseConstrainedIRWDiffusivity =
true;
29 m_UseConstrainedStaniszDiffusivity =
true;
30 m_UseConstrainedStaniszRadius =
true;
31 m_UseConstrainedOrientationConcentration =
false;
32 m_UseConstrainedExtraAxonalFraction =
false;
34 m_UseCommonDiffusivities =
false;
35 m_UseCommonConcentrations =
false;
36 m_UseCommonExtraAxonalFractions =
false;
38 m_AxialDiffusivity = 1.71e-3;
39 m_FreeWaterDiffusivity = 3.0e-3;
40 m_IRWDiffusivity = 7.5e-4;
41 m_StaniszDiffusivity = 1.71e-3;
42 m_RadialDiffusivity1 = 1.9e-4;
43 m_RadialDiffusivity2 = 1.5e-4;
44 m_ExtraAxonalFraction = 0.1;
45 m_OrientationConcentration = 10.0;
51 outputMCM->SetOptimizeWeights(!m_VariableProjectionEstimationMode);
52 outputMCM->SetCommonDiffusivityParameters(m_UseCommonDiffusivities);
53 outputMCM->SetCommonConcentrationParameters(m_UseCommonConcentrations);
54 outputMCM->SetCommonExtraAxonalFractionParameters(m_UseCommonExtraAxonalFractions);
56 double numCompartments = m_ModelWithFreeWaterComponent + m_ModelWithRestrictedWaterComponent +
57 m_ModelWithStaniszComponent + m_ModelWithStationaryWaterComponent + m_NumberOfCompartments;
58 double defaultWeight = 1.0 / numCompartments;
60 if (m_ModelWithFreeWaterComponent)
63 FreeWaterType::Pointer fwComp = FreeWaterType::New();
64 fwComp->SetEstimateAxialDiffusivity(!m_UseConstrainedFreeWaterDiffusivity);
65 fwComp->SetAxialDiffusivity(m_FreeWaterDiffusivity);
67 outputMCM->AddCompartment(defaultWeight,fwComp);
70 if (m_ModelWithStationaryWaterComponent)
73 SWType::Pointer swComp = SWType::New();
75 outputMCM->AddCompartment(defaultWeight,swComp);
78 if (m_ModelWithRestrictedWaterComponent)
81 IRWType::Pointer restComp = IRWType::New();
82 restComp->SetEstimateAxialDiffusivity(!m_UseConstrainedIRWDiffusivity);
83 restComp->SetAxialDiffusivity(m_IRWDiffusivity);
85 outputMCM->AddCompartment(defaultWeight,restComp);
88 if (m_ModelWithStaniszComponent)
91 StaniszType::Pointer restComp = StaniszType::New();
92 restComp->SetEstimateAxialDiffusivity(!m_UseConstrainedStaniszDiffusivity);
93 restComp->SetEstimateTissueRadius(!m_UseConstrainedStaniszRadius);
94 restComp->SetAxialDiffusivity(m_StaniszDiffusivity);
96 outputMCM->AddCompartment(defaultWeight,restComp);
99 for (
unsigned int i = 0;i < m_NumberOfCompartments;++i)
102 bool applyCommonConstraints = (i > 0);
104 switch (m_CompartmentType)
107 this->CreateStickCompartment(tmpPointer,applyCommonConstraints);
111 this->CreateZeppelinCompartment(tmpPointer,applyCommonConstraints);
115 this->CreateTensorCompartment(tmpPointer,applyCommonConstraints);
119 this->CreateNODDICompartment(tmpPointer,applyCommonConstraints);
123 this->CreateDDICompartment(tmpPointer,applyCommonConstraints);
127 throw itk::ExceptionObject(__FILE__, __LINE__,
"Creation of multiple free water compartment model not handled",ITK_LOCATION);
132 tmpPointer->SetOrientationConcentration(m_OrientationConcentration);
134 outputMCM->AddCompartment(defaultWeight,tmpPointer);
140 void MultiCompartmentModelCreator::CreateStickCompartment(
BaseCompartmentPointer &compartmentPointer,
bool applyConstraints)
144 StickType::Pointer stickComp = StickType::New();
145 stickComp->SetEstimateAxialDiffusivity(!m_UseConstrainedDiffusivity);
147 stickComp->SetAxialDiffusivity(m_AxialDiffusivity);
148 stickComp->SetRadialDiffusivity1((m_RadialDiffusivity1 + m_RadialDiffusivity2) / 2.0);
150 if (applyConstraints)
152 if (m_UseCommonDiffusivities)
153 stickComp->SetEstimateAxialDiffusivity(
false);
156 compartmentPointer = stickComp;
159 void MultiCompartmentModelCreator::CreateZeppelinCompartment(
BaseCompartmentPointer &compartmentPointer,
bool applyConstraints)
163 ZeppelinType::Pointer zepComp = ZeppelinType::New();
164 zepComp->SetEstimateDiffusivities(!m_UseConstrainedDiffusivity);
166 zepComp->SetAxialDiffusivity(m_AxialDiffusivity);
167 zepComp->SetRadialDiffusivity1((m_RadialDiffusivity1 + m_RadialDiffusivity2) / 2.0);
169 if (applyConstraints)
171 if (m_UseCommonDiffusivities)
172 zepComp->SetEstimateDiffusivities(
false);
175 compartmentPointer = zepComp;
178 void MultiCompartmentModelCreator::CreateTensorCompartment(
BaseCompartmentPointer &compartmentPointer,
bool applyConstraints)
182 TensorType::Pointer tensComp = TensorType::New();
183 tensComp->SetEstimateDiffusivities(!m_UseConstrainedDiffusivity);
185 tensComp->SetAxialDiffusivity(m_AxialDiffusivity);
186 tensComp->SetRadialDiffusivity1(m_RadialDiffusivity1);
187 tensComp->SetRadialDiffusivity2(m_RadialDiffusivity2);
189 if (applyConstraints)
191 if (m_UseCommonDiffusivities)
192 tensComp->SetEstimateDiffusivities(
false);
195 compartmentPointer = tensComp;
198 void MultiCompartmentModelCreator::CreateNODDICompartment(
BaseCompartmentPointer &compartmentPointer,
bool applyConstraints)
202 NODDIType::Pointer noddiComp = NODDIType::New();
203 noddiComp->SetEstimateAxialDiffusivity(!m_UseConstrainedDiffusivity);
205 noddiComp->SetOrientationConcentration(m_OrientationConcentration);
206 noddiComp->SetExtraAxonalFraction(m_ExtraAxonalFraction);
207 noddiComp->SetAxialDiffusivity(m_AxialDiffusivity);
209 if (applyConstraints)
211 if (m_UseCommonDiffusivities)
212 noddiComp->SetEstimateAxialDiffusivity(
false);
215 noddiComp->SetEstimateOrientationConcentration(
false);
218 noddiComp->SetEstimateExtraAxonalFraction(
false);
221 compartmentPointer = noddiComp;
224 void MultiCompartmentModelCreator::CreateDDICompartment(
BaseCompartmentPointer &compartmentPointer,
bool applyConstraints)
226 std::string error(
"DDI model not implemented in the public version of ANIMA");
227 throw itk::ExceptionObject(__FILE__, __LINE__,error,ITK_LOCATION);
BaseCompartmentType::Pointer BaseCompartmentPointer
bool GetUseCommonExtraAxonalFractions()
MCMPointer GetNewMultiCompartmentModel()
itk::SmartPointer< Self > Pointer
MultiCompartmentModelCreator()
bool GetUseCommonConcentrations()
MCMType::Pointer MCMPointer