AthenaEPI / dmipy

The open source toolbox for reproducible diffusion MRI-based microstructure estimation
MIT License
96 stars 30 forks source link

median_otsu misused in three_tissue_response_dhollander16 #76

Closed matteofrigo closed 4 years ago

matteofrigo commented 4 years ago

The median_otsu method from dipy takes as input the variable vol_idx which must be an iterable. In the three_tissue_response_dhollander16 function this parameter is passed as a scalar.

I'll fix it and push a PR, but we should be aware of the fact that this could be happening somewhere else. It may be due to the recent dipy update (v1.0) but again, I'm not sure and this must be checked.

matteofrigo commented 4 years ago

The old syntax is

median_otsu(input_volume, median_radius=4, numpass=4,
autocrop=False, vol_idx=None, dilate=None):

The new one is

median_otsu(input_volume, vol_idx=None, median_radius=4, numpass=4,
autocrop=False, dilate=None):
heejong-kim commented 4 years ago

Hi @matteofrigo, "b0_mask, mask = median_otsu(data, 2, 1)" still makes the problem of iteration. I am guessing that the median_otsu line is based on dipy example. You may want to update three_tissue_response.py median_otsu line to: b0_mask, mask = median_otsu(data, median_radius=2, numpass=1)

rutgerfick commented 4 years ago

Hi @heejong-kim, following your comment I just updated the usage of the median_otsu function as suggested. Things should work now as expected!