Skip to content

Commit aa60e49

Browse files
committed
address review: revert unrelated changes, keep only core bug fixes
1 parent 0038222 commit aa60e49

4 files changed

Lines changed: 17 additions & 26 deletions

File tree

.gitignore

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,3 @@ phantoms/MR_XCAT_qMRI/*.json
4242
phantoms/MR_XCAT_qMRI/*.txt
4343
tests/IVIMmodels/unit_tests/models
4444
models
45-
46-
# Custom additions for testing & local setups
47-
ivim_test_venv/
48-
venv/
49-
.env/
50-
env/
51-
check_zenodo.py
52-
*test_output*.txt
53-
.vscode/
54-
.DS_Store
55-
Thumbs.db

src/standardized/IAR_LU_segmented_2step.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ def __init__(self, bvalues=None, thresholds=None, bounds=None, initial_guess=Non
6161
bvec = np.zeros((self.bvalues.size, 3))
6262
bvec[:,2] = 1
6363
gtab = gradient_table(self.bvalues, bvec, b0_threshold=0)
64+
bounds = [[self.bounds["S0"][0], self.bounds["f"][0], self.bounds["Dp"][0], self.bounds["D"][0]], \
65+
[self.bounds["S0"][1], self.bounds["f"][1], self.bounds["Dp"][1], self.bounds["D"][1]]]
66+
67+
# Adapt the initial guess to the format needed for the algorithm
68+
initial_guess = [self.initial_guess["S0"], self.initial_guess["f"], self.initial_guess["Dp"], self.initial_guess["D"]]
6469

65-
# Convert dict bounds/initial_guess to list-of-lists as expected by IvimModelSegmented2Step
66-
bounds_list = [[self.bounds["S0"][0], self.bounds["f"][0], self.bounds["Dp"][0], self.bounds["D"][0]],
67-
[self.bounds["S0"][1], self.bounds["f"][1], self.bounds["Dp"][1], self.bounds["D"][1]]]
68-
initial_guess_list = [self.initial_guess["S0"], self.initial_guess["f"], self.initial_guess["Dp"], self.initial_guess["D"]]
69-
70-
self.IAR_algorithm = IvimModelSegmented2Step(gtab, bounds=bounds_list, initial_guess=initial_guess_list, b_threshold=self.thresholds)
70+
self.IAR_algorithm = IvimModelSegmented2Step(gtab, bounds=bounds, initial_guess=initial_guess, b_threshold=self.thresholds)
7171
else:
7272
self.IAR_algorithm = None
7373

@@ -116,4 +116,4 @@ def ivim_fit(self, signals, bvalues, thresholds=None, **kwargs):
116116
results["Dp"] = fit_results.model_params[2]
117117
results["D"] = fit_results.model_params[3]
118118

119-
return results
119+
return results

src/standardized/IAR_LU_subtracted.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,14 @@ def __init__(self, bvalues=None, thresholds=None, bounds=None, initial_guess=Non
6060
bvec[:,2] = 1
6161
gtab = gradient_table(self.bvalues, bvec, b0_threshold=0)
6262

63-
# Convert dict bounds/initial_guess to list-of-lists as expected by IvimModelSubtracted
64-
bounds_list = [[self.bounds["S0"][0], self.bounds["f"][0], self.bounds["Dp"][0], self.bounds["D"][0]],
65-
[self.bounds["S0"][1], self.bounds["f"][1], self.bounds["Dp"][1], self.bounds["D"][1]]]
66-
initial_guess_list = [self.initial_guess["S0"], self.initial_guess["f"], self.initial_guess["Dp"], self.initial_guess["D"]]
67-
68-
self.IAR_algorithm = IvimModelSubtracted(gtab, bounds=bounds_list, initial_guess=initial_guess_list)
63+
# Adapt the bounds to the format needed for the algorithm
64+
bounds = [[self.bounds["S0"][0], self.bounds["f"][0], self.bounds["Dp"][0], self.bounds["D"][0]], \
65+
[self.bounds["S0"][1], self.bounds["f"][1], self.bounds["Dp"][1], self.bounds["D"][1]]]
66+
67+
# Adapt the initial guess to the format needed for the algorithm
68+
initial_guess = [self.initial_guess["S0"], self.initial_guess["f"], self.initial_guess["Dp"], self.initial_guess["D"]]
69+
70+
self.IAR_algorithm = IvimModelSubtracted(gtab, bounds=bounds, initial_guess=initial_guess)
6971
else:
7072
self.IAR_algorithm = None
7173

@@ -111,4 +113,4 @@ def ivim_fit(self, signals, bvalues, **kwargs):
111113
results["Dp"] = fit_results.model_params[2]
112114
results["D"] = fit_results.model_params[3]
113115

114-
return results
116+
return results

src/standardized/PV_MUMC_biexp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def ivim_fit(self, signals, bvalues=None):
8181
self.thresholds = 200
8282

8383
# Default fallback parameters (D, f, Dp) used if the optimizer fails
84-
DEFAULT_PARAMS = [0.001, 0.1, 0.01]
84+
DEFAULT_PARAMS = [0.003, 0.1, 0.05]
8585

8686
try:
8787
fit_results = self.PV_algorithm(bvalues, signals, bounds=bounds, cutoff=self.thresholds)

0 commit comments

Comments
 (0)