9 double residualValue = 0;
10 unsigned int numT2Signals = m_T2RelaxometrySignals.size();
11 unsigned int numValues = m_T2WorkingValues.size();
12 unsigned int numDistributions = m_T2DistributionSamples.size();
18 m_SimulatedEPGValues.resize(numValues);
19 m_SimulatedSignalValues.resize(numT2Signals);
20 std::fill(m_SimulatedSignalValues.begin(),m_SimulatedSignalValues.end(),0.0);
22 for (
unsigned int i = 0;i < numValues;++i)
23 m_SimulatedEPGValues[i] = m_T2SignalSimulator.
GetValue(m_T1Value,m_T2WorkingValues[i],parameters[0] * m_T2FlipAngles[0],m_M0Value);
25 for (
unsigned int i = 0;i < numDistributions;++i)
27 if (m_T2Weights[i] <= 0)
30 unsigned int numSamples = m_T2DistributionSamples[i].size();
31 for (
unsigned int j = 0;j < numT2Signals;++j)
33 double integralValue = m_T2DistributionSamples[i][0] * m_SimulatedEPGValues[m_DistributionSamplesT2Correspondences[i][0]][j] * m_T2IntegrationStep / 2.0;
34 for (
unsigned int k = 1;k < numSamples;++k)
35 integralValue += m_T2DistributionSamples[i][k] * m_SimulatedEPGValues[m_DistributionSamplesT2Correspondences[i][k]][j] * m_T2IntegrationStep;
37 m_SimulatedSignalValues[j] += m_T2Weights[i] * integralValue;
41 for (
unsigned int i = 0;i < numT2Signals;++i)
42 residualValue += (m_SimulatedSignalValues[i] - m_T2RelaxometrySignals[i]) * (m_SimulatedSignalValues[i] - m_T2RelaxometrySignals[i]);
Superclass::ParametersType ParametersType
virtual MeasureType GetValue(const ParametersType ¶meters) const ITK_OVERRIDE
void SetEchoSpacing(double val)
void SetExcitationFlipAngle(double val)
Superclass::MeasureType MeasureType
RealVectorType & GetValue(double t1Value, double t2Value, double flipAngle, double m0Value)
Get EPG values at given point.
void SetNumberOfEchoes(unsigned int val)