brainlife / app-dipy-workflows

Brainlife wrapper app for Dipy workflows.
0 stars 7 forks source link

dipy_fit_dki failing with "Mask is not the same shape as data." #16

Open soichih opened 5 years ago

soichih commented 5 years ago
/usr/local/lib/python2.7/dist-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
INFO:Computing DKI metrics for ../5be5b88880ce40002a61b79c/5967bffa9b45c212bbec8956/dwi.nii.gz
INFO:Diffusion kurtosis estimation...
Traceback (most recent call last):
  File "/usr/local/bin/dipy_fit_dki", line 9, in <module>
    run_flow(ReconstDkiFlow())
  File "/usr/local/lib/python2.7/dist-packages/dipy/workflows/flow_runner.py", line 82, in run_flow
    return flow.run(**args)
  File "/usr/local/lib/python2.7/dist-packages/dipy/workflows/reconst.py", line 813, in run
    b0_threshold)
  File "/usr/local/lib/python2.7/dist-packages/dipy/workflows/reconst.py", line 908, in get_fitted_tensor
    dkfit = dkmodel.fit(data, mask)
  File "/usr/local/lib/python2.7/dist-packages/dipy/reconst/dki.py", line 1328, in fit
    raise ValueError("Mask is not the same shape as data.")
ValueError: Mask is not the same shape as data.

I am feeding white matter mask generated by "White Matter Mask " App > https://brainlife.io/app/5a28180e67007b77e4d51cce

Is it not expected to work with this mask?

skoudoro commented 5 years ago

yes, if both data have the same shape, it should work. Can you check this point? if they are the same, can you send/point me to the data?

thanks

soichih commented 5 years ago

The input dwi is .. and the mask is 256x256x256. The mask comes from the Freesurfer so that's why it has 256^3 I think.

I am guessing there is no way to resize using the affine information on the mask?

skoudoro commented 5 years ago

whatever the way of resizing this mask, it should be done before using this app.

I suppose you can modify this point on Freesurfer side. I will be surprised if it is a static value.

skoudoro commented 5 years ago

Hi @soichih, Any news concerning mask resizing? Are there any other apps generating a mask? I tried with a DIPY mask and it works as you can see here

Should I close this issue?

soichih commented 5 years ago

We can't resize on freesurfer side because it doesn't know what size it needs to be resized to later on.. I think app-dipy-workflows should try to resize it to the dwi input file size, and give warning to the user that file was resized due to mismatch... ? I am not sure how common that user would feed mask with wrong file size though.. If it's rare, we can just abort the App with some clear error message, I think.