Closed matteofrigo closed 4 years ago
When a gradient table is converted from dmipy to dipy format and delta is None or Delta is None, the devoted function gives the following error.
delta is None or Delta is None
In [8]: gtab_dmipy2dipy(gtab_dmipy) None --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-8-89848d3de32f> in <module> ----> 1 gtab_dmipy2dipy(scheme) /home/user/dmipy/dmipy/core/acquisition_scheme.py in gtab_dmipy2dipy(dmipy_gradient_table) 907 elif len(np.unique(delta)) == 1: --> 908 delta = delta[0] 909 910 if len(np.unique(Delta)) > 1: TypeError: 'NoneType' object is not subscriptable
and this happens also at line 911 for Delta.
Delta
A simple hack that fixes this problem is to change the checks in lines 907 and 910 as follows:
elif delta is not None and len(np.unique(delta)) == 1: ... elif Delta is not None and len(np.unique(Delta)) == 1:
I'll put up a PR with this in the close future.
The early bird gets the worm ;-) well spotted @matteofrigo
When a gradient table is converted from dmipy to dipy format and
delta is None or Delta is None
, the devoted function gives the following error.and this happens also at line 911 for
Delta
.A simple hack that fixes this problem is to change the checks in lines 907 and 910 as follows:
I'll put up a PR with this in the close future.