Commit 89d3828a authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

BUG: pass on `nsim` to other param_evaluator

parent 75ddb658
Pipeline #5299 failed with stage
in 10 minutes and 5 seconds
......@@ -523,7 +523,7 @@ class SumBase(UserList):
self._fixed = {}
def param_evaluator(self, parameters, method=None, extent=0):
def param_evaluator(self, parameters, method=None, extent=0, nsim=2**12):
"""Returns a function that evaluates the basis function for arbitrary positions given a fixed parameter array
Used to __call__ streamlines
......@@ -531,16 +531,17 @@ class SumBase(UserList):
:param parameters: (nparams, ) array defining the parameters for which the field will be evaluated
:param method: Algorithm used to __call__ the basis functions
:param extent: maximum extent of request to accept (keep at zero for tractography)
:param nsim: maximum number of positions to evaluate simultaneously
:return: function that maps positions to vector field
funcs = []
idx_param = 0
for idx_elem, elem in enumerate(self):
if idx_elem in self._fixed:
funcs.append(elem.param_evaluator(self._fixed[idx_elem], extent=extent, method=method))
funcs.append(elem.param_evaluator(self._fixed[idx_elem], extent=extent, method=method, nsim=nsim))
funcs.append(elem.param_evaluator(parameters[idx_param:idx_param + elem.nparams],
extent=extent, method=method))
extent=extent, method=method, nsim=nsim))
idx_param += elem.nparams
def evaluate(positions):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment