Command Line Interface#
The RedBrick CLI offers a simple interface to quickly import and export your images & annotations, and perform other high-level actions.
[1;34musage: [0m[1;35mredbrick[0m [[32m-h[0m] [[32m-v[0m] [[36m--completion [33m{bash,zsh,tcsh}[0m] [32m{config,init,clone,info,export,upload,report} ...[0m
Named Arguments#
- -v, --version
show program’s version number and exit
- --completion
Possible choices: bash, zsh, tcsh
print shell completion script
Commands#
- command
Possible choices: config, init, clone, info, export, upload, report
Sub-commands#
config#
Setup the credentials for your CLI.
[1;34m[0m[1;35mredbrick config[0m [[32m-h[0m] [[36m--org [33mORG[0m] [[36m--key [33mKEY[0m] [[36m--url [33mURL[0m] [[36m--profile [33mPROFILE[0m] [[36m--force[0m] [32m{list,set,add,remove,clear,verify} ...[0m
Positional Arguments#
- sub_command
Possible choices: list, set, add, remove, clear, verify
Named Arguments#
- --org, -o
Org ID
- --key, -k
API Key
- --url, -u
Endpoint URL, should default to https://api.redbrickai.com.
- --profile, -p
Profile name
- --force, -f
Force create new credentials
Default: False
Sub-commands#
list#
List all credential profiles
[1;34m[0m[1;35mredbrick config list[0m [[32m-h[0m]
set#
Set your default credentials profile
[1;34m[0m[1;35mredbrick config set[0m [[32m-h[0m] [32m[profile][0m
Positional Arguments#
- profile
Profile name
add#
Add a new profile
[1;34m[0m[1;35mredbrick config add[0m [[32m-h[0m] [[36m--org [33mORG[0m] [[36m--key [33mKEY[0m] [[36m--url [33mURL[0m] [[36m--profile [33mPROFILE[0m]
Named Arguments#
- --org, -o
Org ID
- --key, -k
Add your API Key.
- --url, -u
Endpoint URL, should default to https://api.redbrickai.com.
- --profile, -p
Define a name for your authentication profile.
remove#
Remove a profile
[1;34m[0m[1;35mredbrick config remove[0m [[32m-h[0m] [32m[profile][0m
Positional Arguments#
- profile
Profile name
clear#
Clear all credentials
[1;34m[0m[1;35mredbrick config clear[0m [[32m-h[0m]
verify#
Verify a profile
[1;34m[0m[1;35mredbrick config verify[0m [[32m-h[0m] [32m[profile][0m
Positional Arguments#
- profile
Profile name
init#
Create a new project. We recommend creating a new directory and naming it after your project, initializing your project within the new directory.
$ mkdir new-project
$ cd new-project
$ redbrick init
[1;34m[0m[1;35mredbrick init[0m [[32m-h[0m] [[36m--name [33mNAME[0m] [[36m--taxonomy [33mTAXONOMY[0m] [[36m--reviews [33mREVIEWS[0m] [[36m--workspace [33mWORKSPACE[0m] [[36m--sibling-tasks [33mSIBLING_TASKS[0m] [32m[path][0m
Positional Arguments#
- path
Local path of the empty project directory
Default: “.”
Named Arguments#
- --name, -n
Project name
- --taxonomy, -t
Taxonomy name
- --reviews, -r
Number of review stages
- --workspace, -w
The workspace that you want to add this project to
- --sibling-tasks
Number of tasks created for each uploaded datapoint
clone#
The project will be cloned to a local directory named after your project name.
[1;34m[0m[1;35mredbrick clone[0m [[32m-h[0m] [32m[project][0m [32m[path][0m
Positional Arguments#
- project
Project ID or Name
- path
Local path of the empty project directory
info#
Get a project’s information
[1;34m[0m[1;35mredbrick info[0m [[32m-h[0m] [[36m--get [33m{labelstorage}[0m] [[36m--set [33m{labelstorage}[0m] [32m[path][0m
Positional Arguments#
- path
Path of project (Default: current directory)
Default: “.”
Named Arguments#
- --get, -g
Possible choices: labelstorage
Get a project’s setting information
- --set, -s
Possible choices: labelstorage
Set a project setting
export#
Export data for a project
[1;34m[0m[1;35mredbrick export[0m [[32m-h[0m] [[36m--with-files[0m] [[36m--dicom-to-nifti[0m] [[36m--old-format[0m] [[36m--without-masks[0m] [[36m--semantic[0m] [[36m--binary-mask[0m] [[36m--single-mask[0m] [[36m--no-consensus[0m] [[36m--png[0m] [[36m--rt-struct[0m]
[[36m--dicom-seg[0m] [[36m--mhd[0m] [[36m--clear-cache[0m] [[36m--concurrency [33mCONCURRENCY[0m] [[36m--stage [33mSTAGE[0m] [[36m--destination [33mDESTINATION[0m]
[32m[type][0m
Positional Arguments#
- type
Export type: (latest [default], groundtruth,
) Default: “latest”
Named Arguments#
- --with-files
Export with files (e.g. images/video frames)
Default: False
- --dicom-to-nifti
Convert DICOM images to NIfTI. Applicable when
--with-filesis set.Default: False
- --old-format
Whether to export tasks in old format. (Default: False)
Default: False
- --without-masks
Exports only tasks JSON without downloading any segmentation masks. Note: This is not recommended for tasks with overlapping labels.
Default: False
- --semantic
Whether to export all segmentations as semantic_mask. This will create one segmentation file per class. If this is set to True and a task has multiple instances per class, then attributes belonging to each instance will not be exported.
Default: False
- --binary-mask
Whether to export all segmentations as binary masks. This will create one segmentation file per instance.
Default: False
- --single-mask
Whether to export all segmentations in a single file. Binary mask will be considered if both binary_mask and single_mask are set.
Default: False
- --no-consensus
Whether to export tasks without consensus info. If None, will default to export with consensus info, if it is enabled for the given project.
Default: False
- --png
Export labels as PNG masks
Default: False
- --rt-struct
Export labels as DICOM RT-Struct. (Only for DICOM images)
Default: False
- --dicom-seg
Export labels as DICOM SEG. (Only for DICOM images)
Default: False
- --mhd
Export segmentation masks in MHD format.
Default: False
- --clear-cache
Clear local cache
Default: False
- --concurrency, -c
Concurrency value (Default: 10)
Default: 10
- --stage, -s
Export tasks that are currently in the given stage. Applicable only with
redbrick exportandredbrick export latest- --destination, -d
Destination directory (Default: current directory)
Default: “.”
upload#
Upload files to a project
[1;34m[0m[1;35mredbrick upload[0m [[32m-h[0m] [[36m--as-frames[0m] [[36m--type [33m[{DICOM3D,NIFTI3D,NRRD3D,IMAGE2D,VIDEO,VIDEOFRAMES}][0m] [[36m--as-study[0m] [[36m--json[0m] [[36m--segment-map [33mSEGMENT_MAP[0m] [[36m--storage [33mSTORAGE[0m]
[[36m--label-storage [33mLABEL_STORAGE[0m] [[36m--ground-truth[0m] [[36m--label-validate[0m] [[36m--prune-segmentations[0m] [[36m--rt-struct[0m] [[36m--dicom-seg[0m] [[36m--mhd[0m] [[36m--clear-cache[0m]
[[36m--concurrency [33mCONCURRENCY[0m]
[32mdirectory[0m
Positional Arguments#
- directory
The directory containing files to upload to the project
Named Arguments#
- --as-frames
Upload video from image frames
Default: False
- --type, -t
Possible choices: DICOM3D, NIFTI3D, NRRD3D, IMAGE2D, VIDEO, VIDEOFRAMES
Import file type [’
DICOM3D’, ‘NIFTI3D’, ‘NRRD3D’, ‘IMAGE2D’, ‘VIDEO’, ‘VIDEOFRAMES’]Please refer to our documentation, to understand the required folder structure and supported file types.
Default: “DICOM3D”
- --as-study
Group files by study
Default: False
- --json
Upload json files with list of task objects
Default: False
- --segment-map, -m
Segmentation mapping file path
- --storage, -s
Storage method: (redbrick [default], public,
) Default: “redbrick”
- --label-storage
Label Storage method: (same as items storage
--storage[default], redbrick, public,) - --ground-truth
Upload tasks directly to ground truth.
Default: False
- --label-validate
Validate NIfTI label instances and segmentMap. By default, the uploaded NIfTI files are not validated during upload, which can result in invalid files being uploaded. Using this argument validates the files before upload, but may increase the upload time.
Default: False
- --prune-segmentations
Prune segmentations that are not part of the series.
Default: False
- --rt-struct
Upload segmentations from DICOM RT-Struct files.
Default: False
- --dicom-seg
Upload segmentations from DICOM SEG files.
Default: False
- --mhd
Upload segmentations from MHD files.
Default: False
- --clear-cache
Clear local cache
Default: False
- --concurrency, -c
Concurrency value (Default: 10)
Default: 10
report#
Generate an audit report for a project. Exports a JSON file containing all actions & events associated with every task, including:
Who annotated the task
Who uploaded the data
Who reviewed the task
and more.
[1;34m[0m[1;35mredbrick report[0m [[32m-h[0m] [[36m--concurrency [33mCONCURRENCY[0m] [32m[type][0m
Positional Arguments#
- type
Export type: (all [default], groundtruth)
Default: “all”
Named Arguments#
- --concurrency, -c
Concurrency value (Default: 10)
Default: 10