Skip to content

Commit 206d920

Browse files
committed
setup triexp testing step 1: adding algorithm to json and slightly changing the code to work with bounds
1 parent fb2bf95 commit 206d920

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

src/original/PV_MUMC/triexp_fitting_algorithms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ def monofit(bvalues, Dpar, Fp):
104104

105105
else:
106106
if not fitS0:
107-
bounds = ([bounds[0][1] , bounds[0][2] , bounds[0][3] , bounds[0][4] , bounds[0][5] ],
107+
newbounds = ([bounds[0][1] , bounds[0][2] , bounds[0][3] , bounds[0][4] , bounds[0][5] ],
108108
[Dpar1 , bounds[1][2] , bounds[1][3] , bounds[1][4] , bounds[1][5] ])
109-
params, _ = curve_fit(tri_expN_noS0, bvalues, dw_data, p0=[Dpar1, 0.0, (bounds[0][3]+bounds[1][3])/2, 0.05, (bounds[0][5]+bounds[1][5])/2], bounds=bounds)
109+
params, _ = curve_fit(tri_expN_noS0, bvalues, dw_data, p0=[Dpar1, 0.0, (bounds[0][3]+bounds[1][3])/2, 0.05, (bounds[0][5]+bounds[1][5])/2], bounds=newbounds)
110110
Dpar, Fint, Dint, Fmv, Dmv = params[0], params[1], params[2], params[3], params[4]
111111
#when the fraction of a compartment equals zero (or very very small), the corresponding diffusivity is non-existing (=NaN)
112112

src/standardized wip/PV_MUMC_triexp.py renamed to src/standardized/PV_MUMC_triexp.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ def ivim_fit(self, signals, bvalues=None):
4545
Returns:
4646
_type_: _description_
4747
"""
48-
4948

5049
fit_results = self.PV_algorithm(bvalues, signals)
5150
Dpar, Fint, Dint, Fmv, Dmv = fit_results

tests/IVIMmodels/unit_tests/algorithms.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"OGC_AmsterdamUMC_biexp_segmented",
1212
"OGC_AmsterdamUMC_biexp",
1313
"PV_MUMC_biexp",
14+
"PV_MUMC_triexp",
1415
"PvH_KB_NKI_IVIMfit"
1516
],
1617
"IAR_LU_biexp": {
@@ -162,5 +163,23 @@
162163
"Dp": 1e-1
163164
}
164165
}
166+
},
167+
"PV_MUMC_triexp": {
168+
"tolerances": {
169+
"rtol": {
170+
"Dpar": 5,
171+
"Fint": 5,
172+
"Dint": 25,
173+
"Fmv": 25,
174+
"Dmv": 25
175+
},
176+
"atol": {
177+
"Dpar": 1e-2,
178+
"Fint": 1e-2,
179+
"Dint": 1e-1,
180+
"Fmv": 1e-1,
181+
"Dmv": 1e-1
182+
}
183+
}
165184
}
166185
}

0 commit comments

Comments
 (0)