9 m_T2Value = parameters[0];
11 double residualValue = 0;
12 unsigned int numT2Signals = m_T2RelaxometrySignals.size();
14 std::vector <double> simulatedT2Values(numT2Signals,0.0);
16 for(
unsigned int i = 0;i < numT2Signals;++i)
18 double echo = (i + 1) * m_T2EchoSpacing;
19 simulatedT2Values[i] = std::exp(- echo / m_T2Value) / (1.0 - std::exp(- m_TRValue / m_T1Value));
22 double sumSignals = 0;
23 double sumSimulatedSignals = 0;
24 for (
unsigned int i = 0;i < numT2Signals;++i)
26 sumSignals += m_T2RelaxometrySignals[i];
27 sumSimulatedSignals += simulatedT2Values[i];
30 m_M0Value = sumSignals / sumSimulatedSignals;
32 for (
unsigned int i = 0;i < numT2Signals;++i)
33 residualValue += (m_M0Value * simulatedT2Values[i] - m_T2RelaxometrySignals[i]) * (m_M0Value * simulatedT2Values[i] - m_T2RelaxometrySignals[i]);
virtual MeasureType GetValue(const ParametersType ¶meters) const ITK_OVERRIDE
Superclass::MeasureType MeasureType
Superclass::ParametersType ParametersType