diff --git a/src/original/OGC_AmsterdamUMC/LSQ_fitting.py b/src/original/OGC_AmsterdamUMC/LSQ_fitting.py index ce9d3f9..11d397f 100644 --- a/src/original/OGC_AmsterdamUMC/LSQ_fitting.py +++ b/src/original/OGC_AmsterdamUMC/LSQ_fitting.py @@ -519,7 +519,37 @@ def neg_log_prior(p): return neg_log_prior +def flat_neg_log_prior(Dt_range, Fp_range, Dp_range, S0_range=None): + """ + This function determines the negative of the log of the empirical prior probability of the IVIM parameters + :param Dt0: 1D Array with the initial D estimates + :param Dt0: 1D Array with the initial f estimates + :param Dt0: 1D Array with the initial D* estimates + :param Dt0: 1D Array with the initial S0 estimates (optional) + """ + def neg_log_prior(p): + # depends on whether S0 is fitted or not + if len(p) == 4: + Dt, Fp, Dp, S0 = p[0], p[1], p[2], p[3] + else: + Dt, Fp, Dp = p[0], p[1], p[2] + # make D*