Closed milaurose closed 2 years ago
According to the BIDS spec, incrementing run values for the same scan type should be allowed/supported
Run - an uninterrupted repetition of data acquisition that has the same acquisition parameters and task (however events can change from run to run due to different subject response or randomized nature of the stimuli). Run is a synonym of a data acquisition. Note that "uninterrupted" may look different by modality due to the nature of the recording. For example, in MRI or [MEG] (04-modality-specific-files/02-magnetoencephalography.md), if a subject leaves the scanner, the acquisition must be restarted. For some types of PET acquisitions, a subject may leave and re-enter the scanner without interrupting the scan.
@milaurose Sorry for the delayed response, I think the commit 600a529e6b3e09d02c9b88de52c8df6e99944bac had solved this issue. The issue was happened due to the missing 'f' option on the string, now it will work normally. The latest version is now 0.3.8-rc1
Thank you!
Describe the bug When the dataset includes multiple runs of the same modality, running
brkraw bids_convert
gives a conflict error saying that the run index must be unique. This occurs even when a unique run number has been entered into the datasheet. It appears as though the code is not actually checking the run value, may be an indentation bug (in https://github.com/BrkRaw/brkraw/blob/main/brkraw/scripts/brkraw.py#L397-L414)?To Reproduce Steps to reproduce the behavior:
brkraw bids_helper ./dataset/ ./bids_datasheet.xlsx -j
brkraw bids_convert /data/scratch/mila/dataset/ /data/scratch/mila/bids_datasheet_modified.xlsx -o /data/scratch/mila/outputs/
sub-PHG001/fmap/{sub_row.FileName}_run-{str(sub_row.run).zfill(2)}_fieldmap.nii.gz
Additional testing
brkraw bids_convert /data/scratch/mila/dataset/ /data/scratch/mila/bids_datasheet_modified_without_two_fieldmaps.xlsx -o /data/scratch/mila/outputs_without_two_fieldmaps/
sub-PHG001/fmap/sub-PHG001_acq-B0map_fieldmap.nii.gz
,sub-PHG001/func/sub-PHG001_task-rest_acq-EPI_bold.nii.gz
,sub-PHG001/func/sub-PHG001_task-stim_acq-EPI_bold.nii.gz
,sub-PHG001/anat/sub-PHG001_acq-RARE_T2w.nii.gz
Expected behavior I would expect it to produce 5 files titled with the run numbers specified:
sub-PHG001/fmap/sub-PHG001_acq-B0map_run-1_fieldmap.nii.gz
,sub-PHG001/fmap/sub-PHG001_acq-B0map_run-2_fieldmap.nii.gz
,sub-PHG001/func/sub-PHG001_task-rest_acq-EPI_run-1_bold.nii.gz
,sub-PHG001/func/sub-PHG001_task-stim_acq-EPI_run-2_bold.nii.gz
,sub-PHG001/anat/sub-PHG001_acq-RARE_T2w.nii.gz
Screenshots The original datasheet created by bids_helper:
The modified datasheet with run information manually specified:
Versions bruker==0.3.7 Python 3.7.3
Thanks so much!