Пример #1
0
    res_robust = least_squares(_loss_gaussian_citrate_4_dof,
                               popt_default,
                               loss='huber',
                               f_scale=1.,
                               bounds=param_bounds,
                               args=(ppm_interp, f(ppm_interp)))

    return res_robust.x


path_mrsi = '/data/prostate/experiments/Patient 1036/MRSI/CSI_SE_3D_140ms_16c.rda'

rda_mod = RDAModality(1250.)
rda_mod.read_data_from_path(path_mrsi)

phase_correction = MRSIPhaseCorrection(rda_mod)
rda_mod = phase_correction.transform(rda_mod)

freq_correction = MRSIFrequencyCorrection(rda_mod)
rda_mod = freq_correction.fit(rda_mod).transform(rda_mod)

baseline_correction = MRSIBaselineCorrection(rda_mod)
rda_mod = baseline_correction.fit(rda_mod).transform(rda_mod)

# x = 0
# y = 0
# z = 0

# out = _citrate_fitting(rda_mod.bandwidth_ppm[:, 5, 9, 5],
#                        np.real(rda_mod.data_[:, 5, 9, 5]))
Пример #2
0
                     np.inf, delta_2_bounds[1], 8*10e-2,
                     np.inf, delta_3_bounds[1], 8*10e-2])

    res_robust = least_squares(_loss_gaussian_citrate_4_dof, popt_default,
                               loss='huber', f_scale=1.,
                               bounds=param_bounds,
                               args=(ppm_interp, f(ppm_interp)))

    return res_robust.x

path_mrsi = '/data/prostate/experiments/Patient 1036/MRSI/CSI_SE_3D_140ms_16c.rda'

rda_mod = RDAModality(1250.)
rda_mod.read_data_from_path(path_mrsi)

phase_correction = MRSIPhaseCorrection(rda_mod)
rda_mod = phase_correction.transform(rda_mod)

freq_correction = MRSIFrequencyCorrection(rda_mod)
rda_mod = freq_correction.fit(rda_mod).transform(rda_mod)

baseline_correction = MRSIBaselineCorrection(rda_mod)
rda_mod = baseline_correction.fit(rda_mod).transform(rda_mod)

# x = 0
# y = 0
# z = 0

# out = _citrate_fitting(rda_mod.bandwidth_ppm[:, 5, 9, 5],
#                        np.real(rda_mod.data_[:, 5, 9, 5]))