edickie / ciftify

The tools of the Human Connectome Project (HCP) adapted for working with non-HCP datasets
https://edickie.github.io/ciftify/
MIT License
111 stars 156 forks source link

[FIX] Update ciftify_clean_img.py to catch use cases without confound_signals #169

Open marcelzwiers opened 2 years ago

marcelzwiers commented 2 years ago

If confounds are not given then an error occurs. The PR is a minimal patch for this

Traceback (most recent call last):
  File "/home/mrphys/marzwi/.conda/envs/ciftify/bin/ciftify_clean_img", line 8, in <module>
    sys.exit(main())
  File "/home/mrphys/marzwi/.conda/envs/ciftify/lib/python3.9/site-packages/ciftify/bin/ciftify_clean_img.py", line 376, in main
    ret = run_ciftify_clean_img(arguments, tmpdir)
  File "/home/mrphys/marzwi/.conda/envs/ciftify/lib/python3.9/site-packages/ciftify/bin/ciftify_clean_img.py", line 254, in run_ciftify_clean_img
    clean_output = clean_image_with_nilearn(trimmed_nifti, confound_signals, settings)
  File "/home/mrphys/marzwi/.conda/envs/ciftify/lib/python3.9/site-packages/ciftify/bin/ciftify_clean_img.py", line 345, in clean_image_with_nilearn
    confounds=confound_signals.values,
AttributeError: 'NoneType' object has no attribute 'values'
[..]