dPys / PyNets

A Reproducible Workflow for Structural and Functional Connectome Ensemble Learning
https://pynets.readthedocs.io/en/latest/
122 stars 41 forks source link

UnboundLocalError: local variable 'multimodal' referenced before assignment #177

Closed kelmok closed 5 years ago

kelmok commented 5 years ago

Description

There's a missing assignment of boolean multimodal. Suggest adding to Line 1167 multimodal = False

What I Did

pynets_run.py -func 'PyNets-master/tests/examples/002/fmri/002.nii.gz' -id '002' -a 'coords_dosenbach_2010' -mod 'partcorr' -thr 0.20

Traceback (most recent call last): File "/usr/bin/pynets_run.py", line 1690, in main sys.exit(p.exitcode) SystemExit: 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/bin/pynets_run.py", line 1701, in main() File "/usr/bin/pynets_run.py", line 1694, in main build_workflow(args, retval) File "/usr/bin/pynets_run.py", line 1585, in build_workflow directget, tiss_class, runtime_dict, embed, multi_directget, multimodal) UnboundLocalError: local variable 'multimodal' referenced before assignment

dPys commented 5 years ago

Hi @kelmok ,

Sorry for the delayed response. I've been away for the past week.

Please uninstall pynets, reinstall (from pip or from a fresh git clone https://github.com/dPys/PyNets.git and then run setup.py install). Then confirm you are using version 0.4.81 from the command-line with: python -c "import pynets; print(pynets.__version__)"

Once all these steps are complete, please re-run the test command: pynets_run.py -func 'PyNets-master/tests/examples/002/fmri/002.nii.gz' -id '002' -a 'coords_dosenbach_2010' -mod 'partcorr' -thr 0.20

but I would highly recommend including both a skull-stripped t1w anatomical image (with the -anat flag) in your call. Also, for fmri connectomes, I would highly recommend including a brain mask image in your pynets call using the -m flag. This will ensure that any points/labels outside of the brain are discarded from consideration.

Please let me know if these steps resolve your error.

Thanks, @dPys

dPys commented 5 years ago

Closing this issue for now since this issue should now be fixed, but please feel free to re-open if you continue to encounter errors. Thanks again for reporting!

@dPys