Command Line Interface#
The RedBrick CLI offers a simple interface to quickly import and export your images & annotations, and perform other high-level actions.
usage: redbrick [-h] [-v] [--completion {bash,zsh,tcsh}] {config,init,clone,info,export,upload,report} ...
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.
redbrick config [-h] [--org ORG] [--key KEY] [--url URL] [--profile PROFILE] [--force] {list,set,add,remove,clear,verify} ...
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
redbrick config list [-h]
set#
Set your default credentials profile
redbrick config set [-h] [profile]
Positional Arguments#
- profile
Profile name
add#
Add a new profile
redbrick config add [-h] [--org ORG] [--key KEY] [--url URL] [--profile PROFILE]
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
redbrick config remove [-h] [profile]
Positional Arguments#
- profile
Profile name
clear#
Clear all credentials
redbrick config clear [-h]
verify#
Verify a profile
redbrick config verify [-h] [profile]
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
redbrick init [-h] [--name NAME] [--taxonomy TAXONOMY] [--reviews REVIEWS] [--workspace WORKSPACE] [--sibling-tasks SIBLING_TASKS] [path]
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
.
redbrick clone [-h] [project] [path]
Positional Arguments#
- project
Project ID or Name
- path
Local path of the empty project directory
info#
Get a project’s information
redbrick info [-h] [--get {labelstorage}] [--set {labelstorage}] [path]
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
redbrick export [-h] [--with-files] [--dicom-to-nifti] [--old-format] [--without-masks] [--semantic] [--binary-mask] [--single-mask] [--no-consensus] [--png] [--rt-struct]
[--dicom-seg] [--mhd] [--clear-cache] [--concurrency CONCURRENCY] [--stage STAGE] [--destination DESTINATION]
[type]
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-files
is 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 export
andredbrick export latest
- --destination, -d
Destination directory (Default: current directory)
Default: “.”
upload#
Upload files to a project
redbrick upload [-h] [--as-frames] [--type [{DICOM3D,NIFTI3D,NRRD3D,IMAGE2D,VIDEO,VIDEOFRAMES}]] [--as-study] [--json] [--segment-map SEGMENT_MAP] [--storage STORAGE]
[--label-storage LABEL_STORAGE] [--ground-truth] [--label-validate] [--prune-segmentations] [--rt-struct] [--dicom-seg] [--mhd] [--clear-cache]
[--concurrency CONCURRENCY]
directory
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.
redbrick report [-h] [--concurrency CONCURRENCY] [type]
Positional Arguments#
- type
Export type: (all [default], groundtruth)
Default: “all”
Named Arguments#
- --concurrency, -c
Concurrency value (Default: 10)
Default: 10