The nibabel2bids plugin in BIDScoin can't process multiple subjects together

summary of what happened

I am utilizing the nibabel plugin from BIDScoin to convert NIfTI datasets to BIDS format. The process works smoothly when I place only one subject in the designated data folder for conversion. However, problems arise when I attempt to include all of my subjects in the same folder for conversion.

Command used

bidsmapper ~/raw_data ~/bids -n '*' -m '*' -p nibabel2bids

Version:

BIDScoin-4.3.2

Environment:

Python

Data formatted:

image

Relevant log outputs (up to 20 lines):

Traceback (most recent call last):                                                                                                                                         
  File "~/anaconda3/envs/bidscoin/bin/bidsmapper", line 8, in <module>
    sys.exit(main())
  File "~/anaconda3/envs/bidscoin/lib/python3.10/site-packages/bidscoin/bidsmapper.py", line 251, in main
    bidsmapper(rawfolder    = args.sourcefolder,
  File "~/anaconda3/envs/bidscoin/lib/python3.10/site-packages/bidscoin/bidsmapper.py", line 141, in bidsmapper
    module.bidsmapper_plugin(sesfolder, bidsmap_new, bidsmap_old, template, store)
  File "~/anaconda3/envs/bidscoin/lib/python3.10/site-packages/bidscoin/plugins/nibabel2bids.py", line 158, in bidsmapper_plugin
    LOGGER.bcdebug(f"Existing/duplicate '{datasource.datatype}' {dataformat} sample: {sourcefile}")
NameError: name 'dataformat' is not defined

Screenshots / relevant information:


You do not have session folders, yet you are passing a -m '*' argument to bidsmapper, telling it to take any folder below the subject folder as a session folder. Can you try:

bidsmapper ~/raw_data ~/bids -n '*' -p nibabel2bids
1 Like

still the same output, and this is my image data organization:

my main concern is that bidsmapper can not process the second subject after the first subject is done, I am not sure if it is related to the session argument

That bug was fixed (see here for details), it should go away when you ugrade to the latest version

1 Like

I upgrade to 4.3.3, it works, thank you so much!