-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: Nipype-less implementation (refactor) #16
Merged
Merged
Commits on Apr 7, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 3c443aa - Browse repository at this point
Copy the full SHA 3c443aaView commit details -
Apply suggestions from code review
Co-authored-by: Ariel Rokem <arokem@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for dd5bf48 - Browse repository at this point
Copy the full SHA dd5bf48View commit details -
Configuration menu - View commit details
-
Copy full SHA for 335c701 - Browse repository at this point
Copy the full SHA 335c701View commit details -
Configuration menu - View commit details
-
Copy full SHA for acf01e0 - Browse repository at this point
Copy the full SHA acf01e0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6fc609b - Browse repository at this point
Copy the full SHA 6fc609bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 816599c - Browse repository at this point
Copy the full SHA 816599cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 98e1289 - Browse repository at this point
Copy the full SHA 98e1289View commit details -
fix: streamlining registration
I'm making progress on the integration with DIPY's regitration. However, I'm hitting the following issue: ```Python >>> EddyMotionEstimator.fit(data) Optimizing level 0 [max iter: 100] --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-35-e34da2fc4915> in <module> ----> 1 EddyMotionEstimator.fit(data) ~/workspace/EddyMotionCorrection/emc/estimator.py in fit(dwdata, n_iter, align_kwargs, model, seed, **kwargs) 99 100 init_affine = dwdata.em_affines[i] if dwdata.em_affines else np.eye(4) --> 101 xform = registration.optimize( 102 predicted, # fixed 103 data_test[0], # moving ~/.anaconda/lib/python3.8/site-packages/dipy/align/imaffine.py in optimize(***failed resolving arguments***) 1099 self.options['maxiter'] = max_iter 1100 -> 1101 opt = Optimizer(self.metric.distance_and_gradient, 1102 self.params0, 1103 method=self.method, jac=True, ~/.anaconda/lib/python3.8/site-packages/dipy/core/optimize.py in __init__(self, fun, x0, args, method, jac, hess, hessp, bounds, constraints, tol, callback, options, evolution) 127 else: 128 --> 129 res = minimize(fun, x0, args, method, jac, hess, hessp, bounds, 130 constraints, tol, callback, options) 131 ~/.anaconda/lib/python3.8/site-packages/scipy/optimize/_minimize.py in minimize(fun, x0, args, method, jac, hess, hessp, bounds, constraints, tol, callback, options) 615 **options) 616 elif meth == 'l-bfgs-b': --> 617 return _minimize_lbfgsb(fun, x0, args, jac, bounds, 618 callback=callback, **options) 619 elif meth == 'tnc': ~/.anaconda/lib/python3.8/site-packages/scipy/optimize/lbfgsb.py in _minimize_lbfgsb(fun, x0, args, jac, bounds, disp, maxcor, ftol, gtol, eps, maxfun, maxiter, iprint, callback, maxls, finite_diff_rel_step, **unknown_options) 304 iprint = disp 305 --> 306 sf = _prepare_scalar_function(fun, x0, jac=jac, args=args, epsilon=eps, 307 bounds=new_bounds, 308 finite_diff_rel_step=finite_diff_rel_step) ~/.anaconda/lib/python3.8/site-packages/scipy/optimize/optimize.py in _prepare_scalar_function(fun, x0, jac, args, bounds, epsilon, finite_diff_rel_step, hess) 259 # ScalarFunction caches. Reuse of fun(x) during grad 260 # calculation reduces overall function evaluations. --> 261 sf = ScalarFunction(fun, x0, args, grad, hess, 262 finite_diff_rel_step, bounds, epsilon=epsilon) 263 ~/.anaconda/lib/python3.8/site-packages/scipy/optimize/_differentiable_functions.py in __init__(self, fun, x0, args, grad, hess, finite_diff_rel_step, finite_diff_bounds, epsilon) 74 75 self._update_fun_impl = update_fun ---> 76 self._update_fun() 77 78 # Gradient evaluation ~/.anaconda/lib/python3.8/site-packages/scipy/optimize/_differentiable_functions.py in _update_fun(self) 164 def _update_fun(self): 165 if not self.f_updated: --> 166 self._update_fun_impl() 167 self.f_updated = True 168 ~/.anaconda/lib/python3.8/site-packages/scipy/optimize/_differentiable_functions.py in update_fun() 71 72 def update_fun(): ---> 73 self.f = fun_wrapped(self.x) 74 75 self._update_fun_impl = update_fun ~/.anaconda/lib/python3.8/site-packages/scipy/optimize/_differentiable_functions.py in fun_wrapped(x) 68 def fun_wrapped(x): 69 self.nfev += 1 ---> 70 return fun(x, *args) 71 72 def update_fun(): ~/.anaconda/lib/python3.8/site-packages/scipy/optimize/optimize.py in __call__(self, x, *args) 72 def __call__(self, x, *args): 73 """ returns the the function value """ ---> 74 self._compute_if_needed(x, *args) 75 return self._value 76 ~/.anaconda/lib/python3.8/site-packages/scipy/optimize/optimize.py in _compute_if_needed(self, x, *args) 66 if not np.all(x == self.x) or self._value is None or self.jac is None: 67 self.x = np.asarray(x).copy() ---> 68 fg = self.fun(x, *args) 69 self.jac = fg[1] 70 self._value = fg[0] ~/.anaconda/lib/python3.8/site-packages/dipy/align/imaffine.py in distance_and_gradient(self, params) 783 """ 784 try: --> 785 self._update_mutual_information(params, True) 786 except (AffineInversionError, AffineInvalidValuesError): 787 return np.inf, 0 * self.metric_grad ~/.anaconda/lib/python3.8/site-packages/dipy/align/imaffine.py in _update_mutual_information(self, params, update_gradient) 670 671 # Update the histogram with the current joint intensities --> 672 static_values, moving_values = self._update_histogram() 673 674 H = self.histogram # Shortcut to `self.histogram` ~/.anaconda/lib/python3.8/site-packages/dipy/align/imaffine.py in _update_histogram(self) 631 pts = sp_to_moving.dot(self.samples.T).T # Points on moving grid 632 pts = pts[..., :self.dim] --> 633 self.moving_vals, inside = self.interp_method(self.moving, pts) 634 self.moving_vals = np.array(self.moving_vals) 635 static_values = self.static_vals dipy/core/interpolation.pyx in dipy.core.interpolation.__pyx_fused_cpdef() TypeError: No matching signature found ```
Configuration menu - View commit details
-
Copy full SHA for eece6ae - Browse repository at this point
Copy the full SHA eece6aeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 96f8be2 - Browse repository at this point
Copy the full SHA 96f8be2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9217b8f - Browse repository at this point
Copy the full SHA 9217b8fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3745146 - Browse repository at this point
Copy the full SHA 3745146View commit details -
Configuration menu - View commit details
-
Copy full SHA for e2a6026 - Browse repository at this point
Copy the full SHA e2a6026View commit details -
Configuration menu - View commit details
-
Copy full SHA for f944412 - Browse repository at this point
Copy the full SHA f944412View commit details -
Configuration menu - View commit details
-
Copy full SHA for bfbcac8 - Browse repository at this point
Copy the full SHA bfbcac8View commit details -
Configuration menu - View commit details
-
Copy full SHA for e242aa4 - Browse repository at this point
Copy the full SHA e242aa4View commit details -
Configuration menu - View commit details
-
Copy full SHA for b324622 - Browse repository at this point
Copy the full SHA b324622View commit details -
Configuration menu - View commit details
-
Copy full SHA for cfeb543 - Browse repository at this point
Copy the full SHA cfeb543View commit details -
Configuration menu - View commit details
-
Copy full SHA for 481bd7b - Browse repository at this point
Copy the full SHA 481bd7bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 203b69b - Browse repository at this point
Copy the full SHA 203b69bView commit details -
Configuration menu - View commit details
-
Copy full SHA for da92244 - Browse repository at this point
Copy the full SHA da92244View commit details -
Configuration menu - View commit details
-
Copy full SHA for c95ab36 - Browse repository at this point
Copy the full SHA c95ab36View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.