RAWMAPPER(1)

πŸ“¦
version 4.6.2 Β· 2 versions
, in fedora 43

πŸ’– 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 πŸ’…

  • -s SESSION [SESSION ...], --sessions SESSION [SESSION ...] β€” a space separated list of the specific sub-#/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. πŸ’–
  • -f NAME [NAME ...], --field NAME [NAME ...] β€” the fieldname(s) of the DICOM attribute(s) she uses to rename or map the subid/sesid foldernames. yes, plural, she can handle more than one. multi-talented. πŸ‘‘
  • -w PATTERN, --wildcard PATTERN β€” 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. 🌈
  • -o FOLDER, --outfolder FOLDER β€” 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 the sub-subid/ses-sesid directories in the sourcefolder to sub-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. πŸ’€
  • -n PREFIX, --subprefix PREFIX β€” 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 the sub-subid/ses-sesid directories. 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