jmtyszka / bidskit

Utility functions for working with DICOM and BIDS neuroimaging data
MIT License
61 stars 41 forks source link

Error when using --no-sessions option and only one subject is converted #118

Closed gauvinalexandre closed 1 year ago

gauvinalexandre commented 1 year ago

When running the command bidskit --no-sessions , I get the following error:

Traceback (most recent call last):
  File "/home/algo/Work/python-venv/neuro/bin/bidskit", line 8, in <module>
    sys.exit(main())
  File "/home/algo/Work/python-venv/neuro/lib/python3.10/site-packages/bidskit/__main__.py", line 306, in main
    ses_clean,
UnboundLocalError: local variable 'ses_clean' referenced before assignment

I have no problem running the default command without --no-sessions with this particular file tree:

dataset
├── sourcedata
│   ├── SUBJECT1
│   │   └── first
│   │       ├── DICOM
│   │       │   ├── IM_0001
│   │       │   ├── IM_0002
│   │       │   ├── ...
│   │       │   └── XX_0190
│   │       └── DICOMDIR
│   ├── SUBJECT2
│   │   └── first
│   │       ├── DICOM
│   │       │   ├── IM_0001
│   │       │   ├── IM_0002
│   │       │   ├── ...
│   │       │   └── XX_0190
│   │       └── DICOMDIR
│   ├── ...
│   └── SUBJECT9
│       └── first
│           ├── DICOM
│           │   ├── IM_0002
│           │   ├── IM_0003
│           │   ├── ...
│           │   └── XX_0190
│           └── DICOMDIR

Desktop:

jmtyszka commented 1 year ago

Latest version (2023.2.16) should fix this. Let me know.

gauvinalexandre commented 1 year ago

Hi Mike! It seems to work. Thank you!