RAWMAPPER(1)
π RAWMAPPER(1) π
okay bestie, gather round, because we're about to talk about rawmapper β it's a lil command from the Generated Python Manual crew and honestly? it's giving organizational queen. π
β¨ NAME β¨
rawmapper β she maps DICOM attribute values across your whole raw dataset and then, if you want, she renames your folders with them. iconic behaviour, no notes. π
πΈ SYNOPSIS πΈ
rawmapper [-h] [-s SESSION [SESSION ...]] [-f NAME [NAME ...]] [-w
PATTERN] [-o FOLDER] [-r] [-c] [-n PREFIX] [-m [PREFIX]] [-d] FOLDER
π¦ DESCRIPTION π¦
So here's the vibe: rawmapper goes through every single subject in the sourcefolder, maps out the value of a DICOM attribute for each one, and saves the whole result into a mapper-file. And then β and then β if you want, it can take those DICOM values and use them to rename the sub-/ses- id's of your subfolders. π€―
When is that even useful, you ask? Picture this: at the scanner console, during subject registration, somebody typed an alternative subject id into the [Additional info] field. That data lives in the DICOM attribute called 'PatientComments', bestie. So if your folder names are a mess and your DICOM knows the truth, rawmapper can fix your whole life. periodt. β¨
- FOLDER β the source folder holding the raw data, organized as
sub-#/ses-#/series. that's the layout, that's the law. π
π OPTIONS π
-sSESSION [SESSION ...],--sessionsSESSION [SESSION ...] β a space separated list of the specificsub-#/ses-#names/folders you wanna process. don't pass this and she'll just do all the sessions in the bidsfolder, because she's generous like that. π-fNAME [NAME ...],--fieldNAME [NAME ...] β the fieldname(s) of the DICOM attribute(s) she uses to rename or map thesubid/sesidfoldernames. yes, plural, she can handle more than one. multi-talented. π-wPATTERN,--wildcardPATTERN β the Unix style pathname pattern expansion used to select which series folders the dicomfield gets mapped from. and yup, it can contain wildcards. go feral. π-oFOLDER,--outfolderFOLDER β normally the mapper-file gets saved in sourcefolder, but pass this and she'll drop it in outfolder instead. relocation era. π§-r,--renameβ the main event, the glow-up: rename thesub-subid/ses-sesiddirectories in the sourcefolder tosub-dcmval/ses-dcmval. π«-c,--clobberβ rename those sub/ses directories even if the target-directory already exists. like, yes bestie, we're bulldozing. tread carefully. π-nPREFIX,--subprefixPREFIX β the prefix that's common to all the source subject-folders. if there's no prefix at all, use a'*'wildcard. she's flexible. πΈ-m[PREFIX],--sesprefix[PREFIX] β the prefix common to all the source session-folders. use a'*'wildcard if there's no prefix, or an empty value if there are, like, no sessions whatsoever. whatever your situation is, she's got you. π«Ά-d,--dryrunβ dryrun (test) the mapping or renaming of thesub-subid/ses-sesiddirectories. meaning: nothing is stored on disk and directory names are not actually changed. it's a rehearsal, not the performance. π
π COMMENTS π
okay here come the examples, and honestly this is the part where it all clicks:
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
and then this line:
--dryrun
followed by even more examples, because she spoils you:
rawmapper myproject/raw -r -s sub-1*/* sub-2*/ses-mri01 --dryrun
rawmapper -f EchoTime -w *fMRI* myproject/raw
look at that wildcard usage in the last two. chef's kiss. π§βπ³π
π AUTHOR π
Marcel Zwiers <m.zwiers@donders.ru.nl> β the legend herself, well, himself, but the energy is immaculate. π
and that's the whole page, bestie!! π this gorgeous thing shipped with bidscoin 4.6.2 on 2025-11-06 β so go forth, map those DICOM values, rename those folders, and remember: run --dryrun first, because the target-directory clobbering is not a joke. mwah. πβ¨π¦
π¦ where this page comes from
- fedora 43: bidscoin 4.6.2-1.fc43 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms