yeatmanlab / pyAFQ

Automated Fiber Quantification ... in Python
http://yeatmanlab.github.io/pyAFQ/
BSD 2-Clause "Simplified" License
56 stars 34 forks source link

Non-descriptive error when incomplete derivative dataset is used (i.e. not all subjects have all files) #212

Closed gkiar closed 2 years ago

gkiar commented 4 years ago

While running the tool with the command: pyAFQ demo_config.toml, where the demo_config.toml file only contains a path for my dmriprep directory, I get the following error. I have installed the latest version from pypi and am running on ubuntu14.04

pixdim[0] (qfac) should be 1 (default) or -1; setting qfac to 1
INFO:nibabel.global:pixdim[0] (qfac) should be 1 (default) or -1; setting qfac to 1
Traceback (most recent call last):
  File "/usr/local/bin/pyAFQ", line 172, in <module>
    clean_params=clean_params)
  File "/Users/greg/code/gkiar/pyAFQ/AFQ/api.py", line 935, in __init__
    self.data_frame['seg_file'] = seg_file_list
  File "/usr/local/lib/python3.6/site-packages/pandas/core/frame.py", line 3119, in __setitem__
    self._set_item(key, value)
  File "/usr/local/lib/python3.6/site-packages/pandas/core/frame.py", line 3194, in _set_item
    value = self._sanitize_column(key, value)
  File "/usr/local/lib/python3.6/site-packages/pandas/core/frame.py", line 3391, in _sanitize_column
    value = _sanitize_index(value, self.index, copy=False)
  File "/usr/local/lib/python3.6/site-packages/pandas/core/series.py", line 4001, in _sanitize_index
    raise ValueError('Length of values does not match length of ' 'index')
ValueError: Length of values does not match length of index
gkiar commented 4 years ago

Note: this is because of an incomplete dataset, where not all my subjects have an aparc+aseg file. I.e.:

I'll leave this open as an issue to give a better error message.

├── sub-A00013809
│   └── ses-DS2
│       ├── anat
│       │   └── sub-A00013809_ses-DS2_T1w.nii.gz
│       └── dwi
│           ├── sub-A00013809_ses-DS2_dwi.bval
│           ├── sub-A00013809_ses-DS2_dwi.bvecs
│           └── sub-A00013809_ses-DS2_dwi.nii.gz
├── sub-A00035036
│   └── ses-DS2
│       ├── anat
│       │   ├── sub-A00035036_ses-DS2_T1w.nii.gz
│       │   └── sub-A00035036_ses-DS2_T1w_aparc+aseg.nii.gz
│       └── dwi
│           ├── sub-A00035036_ses-DS2_dwi.bvals
│           ├── sub-A00035036_ses-DS2_dwi.bvecs
│           └── sub-A00035036_ses-DS2_dwi.nii.gz
36000 commented 4 years ago

I should consider this when doing #303