rawmapper - Man Page

Synopsis

rawmapper [-h] [-s SESSION [SESSION ...]] [-f NAME [NAME ...]] [-w PATTERN] [-o FOLDER] [-r] [-c] [-n PREFIX] [-m [PREFIX]] [-d] FOLDER

Description

Maps out the values of a DICOM attribute of all subjects in the sourcefolder, saves the result in a mapper-file and, optionally, uses the DICOM values to rename the sub-/ses-id's of the subfolders. This latter option can be used, e.g. when an alternative subject id was entered in the [Additional info] field during subject registration at the scanner console (i.e. this data is stored in the DICOM attribute named 'PatientComments')

FOLDER

The source folder with the raw data in sub-#/ses-#/series organization

Options

-s SESSION [SESSION ...], --sessions SESSION [SESSION ...]

Space separated list of selected sub-#/ses-# names/folders to be processed. Otherwise all sessions in the bidsfolder will be processed

-f NAME [NAME ...], --field NAME [NAME ...]

The fieldname(s) of the DICOM attribute(s) used to rename or map the subid/sesid foldernames

-w PATTERN, --wildcard PATTERN

The Unix style pathname pattern expansion that is used to select the series folders from which the dicomfield is being mapped (can contain wildcards)

-o FOLDER, --outfolder FOLDER

The mapper-file is normally saved in sourcefolder or, when using this option, in outfolder

-r,  --rename

Rename sub-subid/ses-sesid directories in the sourcefolder to sub-dcmval/ses-dcmval

-c,  --clobber

Rename the sub/ses directories, even if the target-directory already exists

-n PREFIX, --subprefix PREFIX

The prefix common for all the source subject-folders. Use a '*' wildcard if there is no prefix

-m [PREFIX], --sesprefix [PREFIX]

The prefix common for all the source session-folders. Use a '*' wildcard if there is no prefix or an empty value if there are no sessions

-d,  --dryrun

Dryrun (test) the mapping or renaming of the sub-subid/ses-sesid directories (i.e. nothing is stored on disk and directory names are not actually changed))

Comments

examples:
 rawmapper myproject/raw
 rawmapper myproject/raw -f AcquisitionDate
 rawmapper myproject/raw -s sub-100/ses-mri01 sub-126/ses-mri01
 rawmapper myproject/raw -r -f ManufacturerModelName AcquisitionDate --dryrun
 rawmapper myproject/raw -r -s sub-1*/* sub-2*/ses-mri01 --dryrun
 rawmapper -f EchoTime -w *fMRI* myproject/raw

Author

Marcel Zwiers <m.zwiers@donders.ru.nl>

Info

2025-11-06 bidscoin 4.6.2 Generated Python Manual