Select sidecar file based on time without resorting to name in dcm2bids?

I am setting up my config JSON file for dcm2bids and face the following issue: If possible, I’d like to not select scans based on SidecarFilename or SeriesNumber as this takes away some flexibility (my functional run includes the collection of eye-tracking data, so it happen that we reposition the participant for better eye-tracking so we re-run head scout which changes the counter–which is also reflected in the DICOM file name).

My experiment includes two runs which are separated by a break (but recorded in the same session). Both runs, of course, use the same sequences (fieldmap + functional).

My question now is whether there is an easy or straightforward way to select the correct Sidecar file for each run based on time? Given that all other parameters for the scans are equal, the only difference seems to be SeriesNumber (but this may change, as explained above) and AcquisitionTime. (and the first run of course always precedes the second).

Is anyone familar with an easy way of doing this in dcm2bids? Or do I have to resort to hard-coding file names in cases were SeriesNumber deviates from the expected default?

Hi @trettenbrein and welcome to Neurostars!

Hard to know exactly without seeing some example JSON information (there might be other unique fields we can look at), but here is what I would say based on what you’ve said: You can have multiple criteria in your configuration file, even if they don’t work for all subjects. So let’s say for some subjects, you have a scan that is SeriesDescription: ThisScan and SeriesNumber: X. For other subjects, they have SeriesDescription: ThisScan and SeriesNumber: X+1. If you put both of these sets of criteria in your config file, and either of these criteria are met, then it will produce the nifti files. Of course, since SeriesNumber is unique, there is no way a subject can match both of them. Does this help?

Best,
Steven