brainlife / app-noddi-amico

This app will fit the Neurite Orientation Dispersion and Density Imaging (NODDI; Zhang et al, 2012) model to multi-shell, normalized DWI data using the Accelerated Microstructure Imaging via Convex Optimization (AMICO; Daducci et al, 2015) toolbox. Requires normalized, multi-shell DWI data (including bvals and bvecs) and an optional brainmask of the DWI. Will output the four NODDI output files: neurite density index (ndi), orientation dispersion index (odi), isotropic volume fraction (isovf), and the directions (dirs).
3 stars 1 forks source link

fails to load bvals? #8

Open soichih opened 4 years ago

soichih commented 4 years ago

I came across this error message.

Traceback (most recent call last):
  File "/export/prod/5edef4a0529ab4060c85bcfc/5edef4a1529ab469fe85bcff/NODDI.py", line 33, in <module>
    amico.util.fsl2scheme("./NODDI/dwi.bvals",bvecs)
  File "/usr/local/lib/python3.6/dist-packages/amico/util.py", line 47, in fsl2scheme
    bvecs = np.loadtxt( bvecsFilename, delimiter=delimiter)
  File "/usr/lib/python3/dist-packages/numpy/lib/npyio.py", line 1024, in loadtxt
    items = [conv(val) for (conv, val) in zip(converters, vals)]
  File "/usr/lib/python3/dist-packages/numpy/lib/npyio.py", line 1024, in <listcomp>
    items = [conv(val) for (conv, val) in zip(converters, vals)]
  File "/usr/lib/python3/dist-packages/numpy/lib/npyio.py", line 725, in floatconv
    return float(x)
ValueError: could not convert string to float: b'0.54024,-0.39167,0.71036,0.59361,-0.26425,0.97872,0.54024,-0.41508,-0.19579,0.29504,0.79842,0.86116,0.54024,-0.62881,-0.23247,-0.017706,0.25646,0.79819,0.54024,0.94724,0.16331,0.43109,0.66858,0.76285,0.54024,0.60428,-0.052004,-0.41524,0.74771,-0.11553,0.36138,0.54024,0.92646,0.54935,0.1706,0.54024,-0.951,0.50623,-0.84164,0.16081,-0.060029,-0.4463,0.54024,0.81213,-0.51425,0.54289,0.47106,0.97201,0.54024,0.018745,-0.11985,0.33334,-0.7793,0.22355,0.54024,-0.6805,-0.5312,0.60038,-0.15092,0.85462,0.54024,0.62494,-0.89916,0.27879,0.43328,0.10018,0.54024,0.23459,0.35873,-0.9262,-0.63347,0.54024,-0.87358,0.73227,0.005731,-0.71933,-0.17693,-0.7244,0.54024,-0.0208,-0.48079,0.99729,-0.43062,-0.64902,0.54024,-0.052115,0.28038,0.29042,0.56245,-0.85586,0.54024,-0.71694,-0.36728,-0.76333,-0.37987,0.75945,0.54024,-0.8938,-0.35732,0.58208,0.32367,-0.45453,0.54024,0.16003,0.85398,0.25579,0.28748,0.98485'
Undefined function or variable 'fileNameExtended'.

The input bvecs are delimited by comma

image

dwi validator should normalize the comma delimited bvecs/bvals to space delimited format, but I guess old data, or data that comes from Datasets page (through datalad) might be delimited in comma.

If Amico doesn't handle non-FSL format, then we might need to open the bvecs/bvals with dipy.io import read_bvals_bvecs and convert them to FSL format like validator-neuro-dwi does.