Command Line Interface

cubids --help

This will print the instructions for using the command line interface in your command line.

usage: cubids [-h] [-v]
              {validate,sidecar-merge,group,apply,purge,add-nifti-info,copy-exemplars,undo,datalad-save,print-metadata-fields,remove-metadata-fields}
              ...

Named Arguments

-v, --version

show program’s version number and exit

Sub-commands

validate

cubids-validate: Wrapper around the official BIDS Validator

cubids validate [-h] [--sequential] [--container CONTAINER]
                [--ignore_nifti_headers]
                [--sequential-subjects SEQUENTIAL_SUBJECTS [SEQUENTIAL_SUBJECTS ...]]
                bids_dir output_prefix

Positional Arguments

bids_dir

the root of a BIDS dataset. It should contain sub-X directories and dataset_description.json

output_prefix

file prefix to which tabulated validator output is written. If users pass in just a filename prefix e.g. V1, then CuBIDS will put the validation output in bids_dir/code/CuBIDS. If the user specifies a path (e.g. /Users/scovitz/BIDS/V1) then output files will go to the specified location.

Named Arguments

--sequential

Run the BIDS validator sequentially on each subject.

Default: False

--container

Docker image tag or Singularity image file.

--ignore_nifti_headers

Disregard NIfTI header content during validation

Default: False

--sequential-subjects

List: Filter the sequential run to only include the listed subjects. e.g. –sequential-subjects sub-01 sub-02 sub-03

sidecar-merge

bids-sidecar-merge: merge critical keys from one sidecar to another

cubids sidecar-merge [-h] from_json to_json

Positional Arguments

from_json

Source json file.

to_json

destination json. This file will have data from from_json copied into it.

group

cubids-group: find key and parameter groups in BIDS

cubids group [-h] [--container CONTAINER]
             [--acq-group-level {subject,session}] [--config CONFIG]
             bids_dir output_prefix

Positional Arguments

bids_dir

the root of a BIDS dataset. It should contain sub-X directories and dataset_description.json

output_prefix

file prefix to which a _summary.tsv, _files.tsv _AcqGrouping.tsv, and _AcqGroupInfo.txt, are written. If users pass in just a filename prefix e.g. V1, then CuBIDS will put the four grouping outputs in bids_dir/code/CuBIDS. If the user specifies a path (e.g. /Users/scovitz/BIDS/V1 then output files will go to the specified location.

Named Arguments

--container

Docker image tag or Singularity image file.

--acq-group-level

Possible choices: subject, session

Level at which acquisition groups are created options: ‘subject’ or ‘session’

Default: “subject”

--config

Path to a config file for grouping. If not provided, then the default config file from CuBIDS will be used.

apply

cubids-apply: apply the changes specified in a tsv to a BIDS directory

cubids apply [-h] [--use-datalad] [--container CONTAINER]
             [--acq-group-level {subject,session}] [--config CONFIG]
             bids_dir edited_summary_tsv files_tsv new_tsv_prefix

Positional Arguments

bids_dir

the root of a BIDS dataset. It should contain sub-X directories and dataset_description.json

edited_summary_tsv

path to the _summary.tsv that has been edited in the MergeInto and RenameKeyGroup columns. If the summary table is located in the code/CuBIDS directory, then users can just pass the summary tsv filename instead of the full path to the tsv

files_tsv

path to the _files.tsv that has been edited in the MergeInto and RenameKeyGroup columns. If the files table is located in the code/CuBIDS directory, then users can just pass the files tsv filename instead of the full path to the tsv

new_tsv_prefix

file prefix for writing the post-apply grouping outputs. If users pass in just a filename prefix e.g. V2, then CuBIDS will put the four grouping outputs in bids_dir/code/CuBIDS. If the user specifies a path (e.g. /Users/scovitz/BIDS/V2 then output files will go to the specified location.

Named Arguments

--use-datalad

ensure that there are no untracked changes before finding groups

Default: False

--container

Docker image tag or Singularity image file.

--acq-group-level

Possible choices: subject, session

Level at which acquisition groups are created options: ‘subject’ or ‘session’

Default: “subject”

--config

Path to a config file for grouping. If not provided, then the default config file from CuBIDS will be used.

purge

cubids-purge: purge associations from the dataset

cubids purge [-h] [--use-datalad] [--container CONTAINER] bids_dir scans

Positional Arguments

bids_dir

path to the root of a BIDS dataset. It should contain sub-X directories and dataset_description.json.

scans

path to the txt file of scans whose associations should be purged.

Named Arguments

--use-datalad

ensure that there are no untracked changes before finding groups

Default: False

--container

Docker image tag or Singularity image file.

add-nifti-info

cubids-add-nifti-info: Add information from niftifiles to the sidecars of each dataset

cubids add-nifti-info [-h] [--use-datalad] [--force-unlock]
                      [--container CONTAINER]
                      bids_dir

Positional Arguments

bids_dir

absolute path to the root of a BIDS dataset. It should contain sub-X directories and dataset_description.json.

Named Arguments

--use-datalad

ensure that there are no untracked changes before finding groups

Default: False

--force-unlock

unlock dataset before adding nifti info

Default: False

--container

Docker image tag or Singularity image file.

copy-exemplars

cubids-copy-exemplars: create and save a directory with one subject from each Acquisition Group in the BIDS dataset

cubids copy-exemplars [-h] [--use-datalad] [--min-group-size MIN_GROUP_SIZE]
                      [--container CONTAINER]
                      bids_dir exemplars_dir exemplars_tsv

Positional Arguments

bids_dir

path to the root of a BIDS dataset. It should contain sub-X directories and dataset_description.json.

exemplars_dir

absolute path to the root of a BIDS dataset containing one subject from each Acquisition Group. It should contain sub-X directories and dataset_description.json.

exemplars_tsv

absolute path to the .tsv file that lists one subject from each Acquisition Group (*_AcqGrouping.tsv from the cubids-group output)

Named Arguments

--use-datalad

check exemplar dataset into DataLad

Default: False

--min-group-size

minimum number of subjects an Acquisition Group must have in order to be included in the exemplar dataset

Default: 1

--container

Docker image tag or Singularity image file.

undo

cubids-undo: revert most recent commit

cubids undo [-h] [--container CONTAINER] bids_dir

Positional Arguments

bids_dir

the root of a BIDS dataset. It should contain sub-X directories and dataset_description.json

Named Arguments

--container

Docker image tag or Singularity image file.

datalad-save

cubids-datalad-save: perform a DataLad save on a BIDS directory

cubids datalad-save [-h] [-m M] [--container CONTAINER] bids_dir

Positional Arguments

bids_dir

the root of a BIDS dataset. It should contain sub-X directories and dataset_description.json

Named Arguments

-m

message for this commit

--container

Docker image tag or Singularity image file.

remove-metadata-fields

cubids-remove-metadata-fields: delete fields from metadata

cubids remove-metadata-fields [-h] [--fields FIELDS [FIELDS ...]]
                              [--container CONTAINER]
                              bids_dir

Positional Arguments

bids_dir

the root of a BIDS dataset. It should contain sub-X directories and dataset_description.json

Named Arguments

--fields

space-separated list of metadata fields to remove.

Default: []

--container

Docker image tag or Singularity image file.