Skip to content

Commit 155eb5f

Browse files
committed
Dictionary update for use_bounds and use_initial_guess, and added default b-value threshold
1 parent 0eafe9d commit 155eb5f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/wrappers/OsipiBase.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ def __init__(self, bvalues=None, thresholds=None, bounds=None, initial_guess=Non
108108
self.thresholds = np.asarray(thresholds) if thresholds is not None else None
109109
self.bounds = bounds if bounds is not None else None
110110
self.initial_guess = initial_guess if initial_guess is not None else None
111-
self.use_bounds = True
112-
self.use_initial_guess = True
111+
self.use_bounds = {"f" : False, "D" : False, "Dp" : False, "S0" : False} # Default to False. These are more specifically set by each algorithm subclass
112+
self.use_initial_guess = {"f" : False, "D" : False, "Dp" : False, "S0" : False} # Default to False. These are more specifically set by each algorithm subclass
113113
self.deep_learning = False
114114
self.supervised = False
115115
self.stochastic = False
@@ -119,16 +119,17 @@ def __init__(self, bvalues=None, thresholds=None, bounds=None, initial_guess=Non
119119
print('warning, no bounds were defined, so default bounds are used of [0, 0, 0.005, 0.7],[0.005, 1.0, 0.2, 1.3]')
120120
self.bounds = {"S0" : [0.7, 1.3], "f" : [0, 1.0], "Dp" : [0.005, 0.2], "D" : [0, 0.005]} # These are defined as [lower, upper]
121121
self.forced_default_bounds = True
122-
self.use_bounds = True
123122

124123
if self.initial_guess is None:
125124
print('warning, no initial guesses were defined, so default bounds are used of [0.001, 0.001, 0.01, 1]')
126125
self.initial_guess = {"S0" : 1, "f" : 0.1, "Dp" : 0.01, "D" : 0.001}
127126
self.forced_default_initial_guess = True
128-
self.use_initial_guess = True
129127

130-
self.osipi_bounds = self.bounds # self.bounds will change form, store it in the osipi format here
131-
self.osipi_initial_guess = self.initial_guess # self.initial_guess will change form, store it in the osipi format here
128+
if self.thresholds is None:
129+
self.thresholds = np.array([200])
130+
131+
self.osipi_bounds = self.bounds # Variable that stores the original bounds before they are passed to the algorithm
132+
self.osipi_initial_guess = self.initial_guess # Variable that stores the original initial guesses before they are passed to the algorithm
132133

133134
# If the user inputs an algorithm to OsipiBase, it is intereprete as initiating
134135
# an algorithm object with that name.

0 commit comments

Comments
 (0)