bidsmapper - Man Page

Synopsis

bidsmapper [-h] [-b NAME] [-t NAME] [-p NAME [NAME ...]] [-n PREFIX] [-m PREFIX] [-u PATTERN] [-s] [-a] [-f] [--no-update] sourcefolder bidsfolder

Description

The bidsmapper scans your source data repository to identify different data types by matching them against the run-items in the template bidsmap. Once a match is found, a mapping to BIDS output data types is made and the run-item is added to the study bidsmap. You can check and edit these generated bids-mappings to your needs with the (automatically launched) bidseditor. Re-run the bidsmapper whenever something was changed in your data acquisition protocol and edit the new data type to your needs (your existing bidsmap will be reused).

The bidsmapper uses plugins, as stored in the 'Options' section of the bidsmap, to perform its task and deal with different data modalities and formats.

sourcefolder

The study root folder containing the raw source data folders

bidsfolder

The destination folder with the (future) bids data and the bidsfolder/code/bidscoin/bidsmap.yaml output file

Options

-b NAME, --bidsmap NAME

The study bidsmap file with the mapping heuristics. If the bidsmap filename is just the base name (i.e. no '/' in the name) then it is assumed to be located in the current directory or in bidsfolder/code/bidscoin. Default: bidsmap.yaml

-t NAME, --template NAME

The bidsmap template file with the default heuristics (this could be provided by your institute). If the bidsmap filename is just the base name (i.e. no '/' in the name) then it is assumed to be located in the bidscoin config folder. Default: bidsmap_dccn

-p NAME [NAME ...], --plugins NAME [NAME ...]

List of plugins to be used. Default: the plugin list of the study/template bidsmap

-n PREFIX, --subprefix PREFIX

The prefix common for all the source subject-folders (e.g. 'Pt' is the subprefix if subject folders are named 'Pt018', 'Pt019', ...). Use '*' when your subject folders do not have a prefix. Default: the value of the study/template bidsmap, e.g. 'sub-'

-m PREFIX, --sesprefix PREFIX

The prefix common for all the source session-folders (e.g. 'M_' is the subprefix if session folders are named 'M_pre', 'M_post', ..). Use '*' when your session folders do not have a prefix. Default: the value of the study/template bidsmap, e.g. 'ses-'

-u PATTERN, --unzip PATTERN

Wildcard pattern to unpack tarball/zip-files in the sub/ses sourcefolder that need to be unzipped (in a tempdir) to make the data readable. Default: the value of the study/template bidsmap

-s,  --store

Store newly discovered data samples in the bidsfolder/code/provenance folder (useful for editing e.g. zipped or DICOMDIR datasets)

-a,  --automated

Save the automatically generated bidsmap to disk and without interactively tweaking it with the bidseditor

-f,  --force

Discard the previously saved bidsmap and log file, instead of reusing them (use this option for a fresh start)

--no-update

Do not update any sub-/ses-prefixes in or prepend the sourcefolder name to the <<filepath:regex>> expression that extracts the subject/session labels. This is normally done to make the extraction more robust, but could cause problems for certain use cases

Comments

examples:
 bidsmapper myproject/raw myproject/bids
 bidsmapper myproject/raw myproject/bids -t bidsmap_custom  # Uses a template bidsmap of choice
 bidsmapper myproject/raw myproject/bids -p nibabel2bids    # Uses a plugin of choice
 bidsmapper myproject/raw myproject/bids -n patient- -m '*' # Handles DICOMDIR datasets
 bidsmapper myproject/raw myproject/bids -u '*.tar.gz'      # Unzip tarball source files

Author

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

Info

2025-11-06 bidscoin 4.6.2 Generated Python Manual