@@ -42,31 +42,32 @@ def osipi_initiate_algorithm(self, algorithm, **kwargs):
42
42
self .__class__ = getattr (importlib .import_module (import_path ), algorithm )
43
43
self .__init__ (** kwargs )
44
44
45
- def osipi_fit (self , data = None , bvalues = None , thresholds = None , bounds = None , initial_guess = None , ** kwargs ):
45
+ #def osipi_fit(self, data=None, bvalues=None, thresholds=None, bounds=None, initial_guess=None, **kwargs):
46
+ def osipi_fit (self , data , bvalues , ** kwargs ):
46
47
"""Fits the data with the bvalues
47
48
Returns [S0, f, Dstar, D]
48
49
"""
49
50
50
51
# We should first check whether the attributes in the __init__ are not None
51
52
# Then check if they are input here, if they are, these should overwrite the attributes
52
53
use_bvalues = bvalues if bvalues is not None else self .bvalues
53
- use_thresholds = thresholds if self .bvalues is None else self .thresholds
54
- use_bounds = bounds if self .bounds is None else self .bounds
55
- use_initial_guess = initial_guess if self .initial_guess is None else self .initial_guess
54
+ # use_thresholds = thresholds if self.thresholds is None else self.thresholds
55
+ # use_bounds = bounds if self.bounds is None else self.bounds
56
+ # use_initial_guess = initial_guess if self.initial_guess is None else self.initial_guess
56
57
57
58
# Make sure we don't make arrays of None's
58
59
if use_bvalues is not None : use_bvalues = np .asarray (use_bvalues )
59
- if use_thresholds is not None : use_thresholds = np .asarray (use_thresholds )
60
- if use_bounds is not None : use_bounds = np .asarray (use_bounds )
61
- if use_initial_guess is not None : use_initial_guess = np .asarray (use_initial_guess )
62
- kwargs ["bvalues" ] = use_bvalues
60
+ # if use_thresholds is not None: use_thresholds = np.asarray(use_thresholds)
61
+ # if use_bounds is not None: use_bounds = np.asarray(use_bounds)
62
+ # if use_initial_guess is not None: use_initial_guess = np.asarray(use_initial_guess)
63
+ # kwargs["bvalues"] = use_bvalues
63
64
64
65
#args = [data, use_bvalues, use_thresholds]
65
- args = [data , use_thresholds ]
66
- if self .required_bounds or self .required_bounds_optional :
67
- args .append (use_bounds )
68
- if self .required_initial_guess or self .required_initial_guess_optional :
69
- args .append (use_initial_guess )
66
+ args = [data , use_bvalues ]
67
+ # if self.required_bounds or self.required_bounds_optional:
68
+ # args.append(use_bounds)
69
+ # if self.required_initial_guess or self.required_initial_guess_optional:
70
+ # args.append(use_initial_guess)
70
71
71
72
# Run a check_requirements method that makes sure that these inputs fulfil the requirements
72
73
@@ -76,7 +77,7 @@ def osipi_fit(self, data=None, bvalues=None, thresholds=None, bounds=None, initi
76
77
# Then we pass everything into the ivim_fit method which performs the fit according to the algorithm
77
78
78
79
#args = [data, use_bvalues, use_initial_guess, use_bounds, use_thresholds]
79
- args = [arg for arg in args if arg is not None ]
80
+ # args = [arg for arg in args if arg is not None]
80
81
results = self .ivim_fit (* args , ** kwargs )
81
82
82
83
#self.parameter_estimates = self.ivim_fit(data, bvalues)
0 commit comments