Open JulianGaviriaL opened 2 weeks ago
Mhhh, it seems okay to me. We always have a prefix in the center where I work, so your use case is less well-tested. I do test it (see here), but apparently, not well enough. I assume that in your raw -> anat, etc folder you have .nii.gz
files?
Perhaps it helps if you also specify an empty ses-prefix, i.e. -m ""
?
Thanks marcel for replying:
Yes, I have .nii.gz files in the "raw -> anat", "raw -> func" folders.
trial 1:
(bidscoin) D:\software\pyproj\proj_name>bidsmapper raw BIDS -n '*' -m '*' -p nibabel2bids
trial 2:
((bidscoin) D:\software\pyproj\proj_name>bidsmapper raw BIDS -n '*' -m"" -p nibabel2bids
db type could not be determined warnings.warn(f"Please report the following error to the developers:\n{shelveerror}", RuntimeWarning) INFO | INFO | -------------- START BIDSmapper ------------ INFO | >>> bidsmapper sourcefolder=D:\software\pyproj\proj_name\raw bidsfolder=D:\software\pyproj\proj_name\BIDS bidsmap=bidsmap.yaml template=C:\Users\Julian.bidscoin\4.4.0\templates\bidsmap_dccn.yaml plugins=['nibabel2bids'] subprefix='' sesprefix='' store=False force=False INFO | Reading: D:\software\pyproj\proj_name\BIDS\code\bidscoin\bidsmap.yaml INFO | Checking the bidsmap run-items: INFO | Reading: C:\Users\Julian.bidscoin\4.4.0\templates\bidsmap_dccn.yaml INFO | Adding default bidsmap options from the nibabel2bids plugin INFO | Checking the bidsmap run-items: SUCCESS | All datatypes and options in the template bidsmap are valid WARNING | No subjects found in: D:\software\pyproj\proj_name\raw\'' INFO | Opening the bidseditor INFO | -------------- FINISHED! -------------------
Step1:
(bidscoin) D:\software\pyproj\proj_name>bidsmapper raw BIDS -n "s"
It did not recognize the subjects in the nibabel window:
However, the data is well read in the "data browser" window:
Step2. I saved a template (bidsmap.yaml) with the nibabel2bids plugin. I ran again the editor with the nibabel2bids plugin: It now reads the .nii files only from the first subject in "the nibabel mapping" window.
However, the second subject seems recognized. see console lines:
(bidscoin) D:\software\pyproj\proj_name>bidsmapper raw BIDS -n "s" D:\software\pyproj\bidscoin\Lib\site-packages\bidscoin__init__.py:201: RuntimeWarning: Please report the following error to the developers: db type could not be determined warnings.warn(f"Please report the following error to the developers:\n{shelveerror}", RuntimeWarning) INFO | INFO | -------------- START BIDSmapper ------------ INFO | >>> bidsmapper sourcefolder=D:\software\pyproj\proj_name\raw bidsfolder=D:\software\pyproj\proj_name\BIDS bidsmap=bidsmap.yaml template=C:\Users\Julian.bidscoin\4.4.0\templates\bidsmap_dccn.yaml plugins=[] subprefix=s sesprefix=None store=False force=False INFO | Reading: D:\software\pyproj\proj_name\BIDS\code\bidscoin\bidsmap.yaml INFO | Checking the bidsmap run-items: INFO | Reading: C:\Users\Julian.bidscoin\4.4.0\templates\bidsmap_dccn.yaml INFO | Checking the bidsmap run-items: SUCCESS | All datatypes and options in the template bidsmap are valid WARNING | Could not update the bidsmap session label expression: <<filepath:/raw/s.?/ses-(.?)/>> WARNING | Could not update the bidsmap session label expression: <<filepath:/raw/s.?/ses-(.?)/>> WARNING | Could not update the bidsmap session label expression: <<filepath:/raw/s.?/ses-(.?)/>> WARNING | Could not update the bidsmap session label expression: <<filepath:/raw/s.?/ses-(.?)/>> WARNING | Could not update the bidsmap session label expression: <<filepath:/raw/s.?/ses-(.?)/>> WARNING | Could not update the bidsmap session label expression: <<filepath:/raw/s.?/ses-(.?)/>> INFO | Mapping: D:\software\pyproj\proj_name\raw\s100101\anat (subject 1/2) VERBOSE | Executing plugin: nibabel2bids -> D:\software\pyproj\proj_name\raw\s100101\anat 0%| | 0/2 [00:00<?, ?subject/s]D:\software\pyproj\bidscoin\Lib\site-packages\bidscoin__init__.py:201: RuntimeWarning: Please report the following error to the developers: db type could not be determined warnings.warn(f"Please report the following error to the developers:\n{shelveerror}", RuntimeWarning) INFO | Discovered sample: [Nibabel] D:\software\pyproj\proj_name\raw\s100101\anat\100101_1_T1.nii.gz INFO | Mapping: D:\software\pyproj\proj_name\raw\s100101\func (subject 1/2) VERBOSE | Executing plugin: nibabel2bids -> D:\software\pyproj\proj_name\raw\s100101\func INFO | Discovered sample: [Nibabel] D:\software\pyproj\proj_name\raw\s100101\func\100101_1_rs.nii.gz INFO | Mapping: D:\software\pyproj\proj_name\raw\s110520\anat (subject 2/2) VERBOSE | Executing plugin: nibabel2bids -> D:\software\pyproj\proj_name\raw\s110520\anat INFO | Mapping: D:\software\pyproj\proj_name\raw\s110520\func (subject 2/2) VERBOSE | Executing plugin: nibabel2bids -> D:\software\pyproj\proj_name\raw\s110520\func INFO | Opening the bidseditor WARNING | Required "task" value is missing (func/*_bold -> D:\software\pyproj\proj_name\raw\s100101\func\100101_1_rs.nii.gz) INFO | Checking the bidsmap run-items: SUCCESS | All run-items in the bidsmap are valid INFO | Saving bidsmap in: D:\software\pyproj\proj_name\BIDS\code\bidscoin\bidsmap.yaml
Sorry for my slow response, but in your last email you are showing two different windows, i.e. in the first there is no Nibabel mappings
tab, but in the second (where you are showing the file browser) there is. So I'm not sure what is going on, but my guess is that by re-running the bidsmapper you got it to work, right? Your question about the second subject is nothing to be worried about, in fact it is a future: in BIDScoin you only specify the mapping per unique datatype, not per subject (which can become incredibly long)
Unfortunately, I cannot be of much assistance because I'll be away for the coming three weeks....
As for your update warning, you can use the --no-update
flag to avoid that
What is missing in the following code line to convert NIFTI to BIDS with multiple subjects in one session? D:\software\pyproj\proj_name>
bidsmapper raw BIDS -n '*' -p nibabel2bids
OS: windows 10 pro Python: 3.12.6 BIDSCOIN: 4.4.0
Folder structure:
output: D:\software\pyproj\bidscoin\Lib\site-packages\bidscoin__init__.py:201: RuntimeWarning: Please report the following error to the developers: db type could not be determined warnings.warn(f"Please report the following error to the developers:\n{shelveerror}", RuntimeWarning) INFO | INFO | -------------- START BIDSmapper ------------ INFO | >>> bidsmapper sourcefolder=D:\software\pyproj\proj_name\raw bidsfolder=D:\software\pyproj\proj_name\BIDS bidsmap=bidsmap.yaml template=C:\Users\Julian.bidscoin\4.4.0\templates\bidsmap_dccn.yaml plugins=['nibabel2bids'] subprefix='*' sesprefix=None store=False force=False INFO | No bidsmap file found: D:\software\pyproj\proj_name\BIDS\code\bidscoin\bidsmap.yaml INFO | Reading: C:\Users\Julian.bidscoin\4.4.0\templates\bidsmap_dccn.yaml INFO | Adding default bidsmap options from the nibabel2bids plugin INFO | Checking the bidsmap run-items: SUCCESS | All datatypes and options in the template bidsmap are valid WARNING | **No subjects found in: D:\software\pyproj\proj_name\raw\'**' INFO | Opening the bidseditor INFO | INFO | Checking the bidsmap run-items: INFO | INFO | bids-validator 1.14.7.post0 test results (* = in .bidsignore): SUCCESS | All generated bidsnames are BIDS-valid