Command Line Interface#
T h e R e d B r i c k C L I o f f e r s a s i m p l e i n t e r f a c e t o q u i c k l y i m p o r t a n d e x p o r t y o u r i m a g e s & a n n o t a t i o n s , a n d p e r f o r m o t h e r h i g h - l e v e l a c t i o n s . 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,releases,login,logout,status} ...[0m
Named Arguments#
- -v, --version
s h o w p r o g r a m ‘ s v e r s i o n n u m b e r a n d e x i t show program’s version number and exit
- --completion
P o s s i b l e c h o i c e s : b a s h , z s h , t c s h Possible choices: bash, zsh, tcsh
p r i n t s h e l l c o m p l e t i o n s c r i p t print shell completion script
Commands#
- command
P o s s i b l e c h o i c e s : c o n f i g , i n i t , c l o n e , i n f o , e x p o r t , u p l o a d , r e p o r t , r e l e a s e s , l o g i n , l o g o u t , s t a t u s Possible choices: config, init, clone, info, export, upload, report, releases, login, logout, status
Sub-commands#
config#
S e t u p t h e c r e d e n t i a l s f o r y o u r C L I . 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
P o s s i b l e c h o i c e s : l i s t , s e t , a d d , r e m o v e , c l e a r , v e r i f y Possible choices: list, set, add, remove, clear, verify
Named Arguments#
- --org, -o
O r g I D Org ID
- --key, -k
A P I K e y API Key
- --url, -u
E n d p o i n t U R L , s h o u l d d e f a u l t t o h t t p s : / / a p i . r e d b r i c k a i . c o m . Endpoint URL, should default to https://api.redbrickai.com.
- --profile, -p
P r o f i l e n a m e Profile name
- --force, -f
F o r c e c r e a t e n e w c r e d e n t i a l s Force create new credentials
D e f a u l t : F a l s e Default: False
Sub-commands#
list#
L i s t a l l c r e d e n t i a l p r o f i l e s List all credential profiles
[1;34m[0m[1;35mredbrick config list[0m [[32m-h[0m]
set#
S e t y o u r d e f a u l t c r e d e n t i a l s p r o f i l e Set your default credentials profile
[1;34m[0m[1;35mredbrick config set[0m [[32m-h[0m] [32m[profile][0m
Positional Arguments#
- profile
P r o f i l e n a m e Profile name
add#
A d d a n e w p r o f i l e 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
O r g I D Org ID
- --key, -k
A d d y o u r A P I K e y . Add your API Key.
- --url, -u
E n d p o i n t U R L , s h o u l d d e f a u l t t o h t t p s : / / a p i . r e d b r i c k a i . c o m . Endpoint URL, should default to https://api.redbrickai.com.
- --profile, -p
D e f i n e a n a m e f o r y o u r a u t h e n t i c a t i o n p r o f i l e . Define a name for your authentication profile.
remove#
R e m o v e a p r o f i l e Remove a profile
[1;34m[0m[1;35mredbrick config remove[0m [[32m-h[0m] [32m[profile][0m
Positional Arguments#
- profile
P r o f i l e n a m e Profile name
clear#
C l e a r a l l c r e d e n t i a l s Clear all credentials
[1;34m[0m[1;35mredbrick config clear[0m [[32m-h[0m]
verify#
V e r i f y a p r o f i l e Verify a profile
[1;34m[0m[1;35mredbrick config verify[0m [[32m-h[0m] [32m[profile][0m
Positional Arguments#
- profile
P r o f i l e n a m e Profile name
init#
C r e a t e a n e w p r o j e c t . W e r e c o m m e n d c r e a t i n g a n e w d i r e c t o r y a n d n a m i n g i t a f t e r y o u r p r o j e c t , i n i t i a l i z i n g y o u r p r o j e c t w i t h i n t h e n e w d i r e c t o r y . 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
L o c a l p a t h o f t h e e m p t y p r o j e c t d i r e c t o r y Local path of the empty project directory
D e f a u l t : “ . “ Default: “.”
Named Arguments#
- --name, -n
P r o j e c t n a m e Project name
- --taxonomy, -t
T a x o n o m y n a m e Taxonomy name
- --reviews, -r
N u m b e r o f r e v i e w s t a g e s Number of review stages
- --workspace, -w
T h e w o r k s p a c e t h a t y o u w a n t t o a d d t h i s p r o j e c t t o The workspace that you want to add this project to
- --sibling-tasks
N u m b e r o f t a s k s c r e a t e d f o r e a c h u p l o a d e d d a t a p o i n t Number of tasks created for each uploaded datapoint
clone#
T h e p r o j e c t w i l l b e c l o n e d t o a l o c a l d i r e c t o r y n a m e d a f t e r y o u r ` p r o j e c t n a m e ` .
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
P r o j e c t I D o r N a m e Project ID or Name
- path
L o c a l p a t h o f t h e e m p t y p r o j e c t d i r e c t o r y Local path of the empty project directory
info#
G e t a p r o j e c t ‘ s i n f o r m a t i o n 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
P a t h o f p r o j e c t ( D e f a u l t : c u r r e n t d i r e c t o r y ) Path of project (Default: current directory)
D e f a u l t : “ . “ Default: “.”
Named Arguments#
- --get, -g
P o s s i b l e c h o i c e s : l a b e l s t o r a g e Possible choices: labelstorage
G e t a p r o j e c t ‘ s s e t t i n g i n f o r m a t i o n Get a project’s setting information
- --set, -s
P o s s i b l e c h o i c e s : l a b e l s t o r a g e Possible choices: labelstorage
S e t a p r o j e c t s e t t i n g Set a project setting
export#
E x p o r t d a t a f o r a p r o j e c t 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
E x p o r t t y p e : ( l a t e s t [ d e f a u l t ] , g r o u n d t r u t h , < t a s k i d > ) Export type: (latest [default], groundtruth,
) D e f a u l t : “ l a t e s t “ Default: “latest”
Named Arguments#
- --with-files
E x p o r t w i t h f i l e s ( e . g . i m a g e s / v i d e o f r a m e s ) Export with files (e.g. images/video frames)
D e f a u l t : F a l s e Default: False
- --dicom-to-nifti
C o n v e r t D I C O M i m a g e s t o N I f T I . A p p l i c a b l e w h e n ` - - w i t h - f i l e s ` i s s e t . Convert DICOM images to NIfTI. Applicable when
--with-filesis set.D e f a u l t : F a l s e Default: False
- --old-format
W h e t h e r t o e x p o r t t a s k s i n o l d f o r m a t . ( D e f a u l t : F a l s e ) Whether to export tasks in old format. (Default: False)
D e f a u l t : F a l s e Default: False
- --without-masks
E x p o r t s o n l y t a s k s J S O N w i t h o u t d o w n l o a d i n g a n y s e g m e n t a t i o n m a s k s . N o t e : T h i s i s n o t r e c o m m e n d e d f o r t a s k s w i t h o v e r l a p p i n g l a b e l s . Exports only tasks JSON without downloading any segmentation masks. Note: This is not recommended for tasks with overlapping labels.
D e f a u l t : F a l s e Default: False
- --semantic
W h e t h e r t o e x p o r t a l l s e g m e n t a t i o n s a s s e m a n t i c _ m a s k . T h i s w i l l c r e a t e o n e s e g m e n t a t i o n f i l e p e r c l a s s . I f t h i s i s s e t t o T r u e a n d a t a s k h a s m u l t i p l e i n s t a n c e s p e r c l a s s , t h e n a t t r i b u t e s b e l o n g i n g t o e a c h i n s t a n c e w i l l n o t b e e x p o r t e d . 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.
D e f a u l t : F a l s e Default: False
- --binary-mask
W h e t h e r t o e x p o r t a l l s e g m e n t a t i o n s a s b i n a r y m a s k s . T h i s w i l l c r e a t e o n e s e g m e n t a t i o n f i l e p e r i n s t a n c e . Whether to export all segmentations as binary masks. This will create one segmentation file per instance.
D e f a u l t : F a l s e Default: False
- --single-mask
W h e t h e r t o e x p o r t a l l s e g m e n t a t i o n s i n a s i n g l e f i l e . B i n a r y m a s k w i l l b e c o n s i d e r e d i f b o t h b i n a r y _ m a s k a n d s i n g l e _ m a s k a r e s e t . Whether to export all segmentations in a single file. Binary mask will be considered if both binary_mask and single_mask are set.
D e f a u l t : F a l s e Default: False
- --no-consensus
W h e t h e r t o e x p o r t t a s k s w i t h o u t c o n s e n s u s i n f o . I f N o n e , w i l l d e f a u l t t o e x p o r t w i t h c o n s e n s u s i n f o , i f i t i s e n a b l e d f o r t h e g i v e n p r o j e c t . Whether to export tasks without consensus info. If None, will default to export with consensus info, if it is enabled for the given project.
D e f a u l t : F a l s e Default: False
- --png
E x p o r t l a b e l s a s P N G m a s k s Export labels as PNG masks
D e f a u l t : F a l s e Default: False
- --rt-struct
E x p o r t l a b e l s a s D I C O M R T - S t r u c t . ( O n l y f o r D I C O M i m a g e s ) Export labels as DICOM RT-Struct. (Only for DICOM images)
D e f a u l t : F a l s e Default: False
- --dicom-seg
E x p o r t l a b e l s a s D I C O M S E G . ( O n l y f o r D I C O M i m a g e s ) Export labels as DICOM SEG. (Only for DICOM images)
D e f a u l t : F a l s e Default: False
- --mhd
E x p o r t s e g m e n t a t i o n m a s k s i n M H D f o r m a t . Export segmentation masks in MHD format.
D e f a u l t : F a l s e Default: False
- --clear-cache
C l e a r l o c a l c a c h e Clear local cache
D e f a u l t : F a l s e Default: False
- --concurrency, -c
C o n c u r r e n c y v a l u e ( D e f a u l t : 1 0 ) Concurrency value (Default: 10)
D e f a u l t : 1 0 Default: 10
- --stage, -s
E x p o r t t a s k s t h a t a r e c u r r e n t l y i n t h e g i v e n s t a g e . A p p l i c a b l e o n l y w i t h ` r e d b r i c k e x p o r t ` a n d ` r e d b r i c k e x p o r t l a t e s t ` Export tasks that are currently in the given stage. Applicable only with
redbrick exportandredbrick export latest- --destination, -d
D e s t i n a t i o n d i r e c t o r y ( D e f a u l t : c u r r e n t d i r e c t o r y ) Destination directory (Default: current directory)
D e f a u l t : “ . “ Default: “.”
upload#
U p l o a d f i l e s t o a p r o j e c t 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
T h e f i l e p a t h o r d i r e c t o r y c o n t a i n i n g f i l e s t o u p l o a d t o t h e p r o j e c t The file path or directory containing files to upload to the project
Named Arguments#
- --as-frames
U p l o a d v i d e o f r o m i m a g e f r a m e s Upload video from image frames
D e f a u l t : F a l s e Default: False
- --type, -t
P o s s i b l e c h o i c e s : D I C O M 3 D , N I F T I 3 D , N R R D 3 D , I M A G E 2 D , V I D E O , V I D E O F R A M E S Possible choices: DICOM3D, NIFTI3D, NRRD3D, IMAGE2D, VIDEO, VIDEOFRAMES
I m p o r t f i l e t y p e [ ‘ ` D I C O M 3 D ` ‘ , ‘ ` N I F T I 3 D ` ‘ , ‘ ` N R R D 3 D ` ‘ , ‘ ` I M A G E 2 D ` ‘ , ‘ ` V I D E O ` ‘ , ‘ ` V I D E O F R A M E S ` ‘ ] Import file type [’
DICOM3D’, ‘NIFTI3D’, ‘NRRD3D’, ‘IMAGE2D’, ‘VIDEO’, ‘VIDEOFRAMES’]P l e a s e r e f e r t o [ o u r d o c u m e n t a t i o n ] ( h t t p s : / / d o c s . r e d b r i c k a i . c o m / i m p o r t i n g - d a t a / d i r e c t - d a t a - u p l o a d ) , t o u n d e r s t a n d t h e r e q u i r e d f o l d e r s t r u c t u r e a n d s u p p o r t e d f i l e t y p e s . Please refer to our documentation, to understand the required folder structure and supported file types.
D e f a u l t : “ D I C O M 3 D “ Default: “DICOM3D”
- --as-study
G r o u p f i l e s b y s t u d y Group files by study
D e f a u l t : F a l s e Default: False
- --json
U p l o a d j s o n f i l e s w i t h l i s t o f t a s k o b j e c t s Upload json files with list of task objects
D e f a u l t : F a l s e Default: False
- --segment-map, -m
S e g m e n t a t i o n m a p p i n g f i l e p a t h Segmentation mapping file path
- --storage, -s
S t o r a g e m e t h o d : ( r e d b r i c k [ d e f a u l t ] , p u b l i c , < s t o r a g e i d > ) Storage method: (redbrick [default], public,
) D e f a u l t : “ r e d b r i c k “ Default: “redbrick”
- --label-storage
L a b e l S t o r a g e m e t h o d : ( s a m e a s i t e m s s t o r a g e ` - - s t o r a g e ` [ d e f a u l t ] , r e d b r i c k , p u b l i c , < s t o r a g e i d > ) Label Storage method: (same as items storage
--storage[default], redbrick, public,) - --ground-truth
U p l o a d t a s k s d i r e c t l y t o g r o u n d t r u t h . Upload tasks directly to ground truth.
D e f a u l t : F a l s e Default: False
- --label-validate
V a l i d a t e N I f T I l a b e l i n s t a n c e s a n d s e g m e n t M a p . B y d e f a u l t , t h e u p l o a d e d N I f T I f i l e s a r e n o t v a l i d a t e d d u r i n g u p l o a d , w h i c h c a n r e s u l t i n i n v a l i d f i l e s b e i n g u p l o a d e d . U s i n g t h i s a r g u m e n t v a l i d a t e s t h e f i l e s b e f o r e u p l o a d , b u t m a y i n c r e a s e t h e u p l o a d t i m e . 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.
D e f a u l t : F a l s e Default: False
- --prune-segmentations
P r u n e s e g m e n t a t i o n s t h a t a r e n o t p a r t o f t h e s e r i e s . Prune segmentations that are not part of the series.
D e f a u l t : F a l s e Default: False
- --rt-struct
U p l o a d s e g m e n t a t i o n s f r o m D I C O M R T - S t r u c t f i l e s . Upload segmentations from DICOM RT-Struct files.
D e f a u l t : F a l s e Default: False
- --dicom-seg
U p l o a d s e g m e n t a t i o n s f r o m D I C O M S E G f i l e s . Upload segmentations from DICOM SEG files.
D e f a u l t : F a l s e Default: False
- --mhd
U p l o a d s e g m e n t a t i o n s f r o m M H D f i l e s . Upload segmentations from MHD files.
D e f a u l t : F a l s e Default: False
- --clear-cache
C l e a r l o c a l c a c h e Clear local cache
D e f a u l t : F a l s e Default: False
- --concurrency, -c
C o n c u r r e n c y v a l u e ( D e f a u l t : 1 0 ) Concurrency value (Default: 10)
D e f a u l t : 1 0 Default: 10
report#
G e n e r a t e a n a u d i t r e p o r t f o r a p r o j e c t . E x p o r t s a J S O N f i l e c o n t a i n i n g a l l a c t i o n s & e v e n t s a s s o c i a t e d w i t h e v e r y t a s k , i n c l u d i n g : Generate an audit report for a project. Exports a JSON file containing all actions & events associated with every task, including:
W h o a n n o t a t e d t h e t a s k Who annotated the task
W h o u p l o a d e d t h e d a t a Who uploaded the data
W h o r e v i e w e d t h e t a s k Who reviewed the task
a n d m o r e . and more.
[1;34m[0m[1;35mredbrick report[0m [[32m-h[0m] [[36m--concurrency [33mCONCURRENCY[0m] [32m[type][0m
Positional Arguments#
- type
E x p o r t t y p e : ( a l l [ d e f a u l t ] , g r o u n d t r u t h ) Export type: (all [default], groundtruth)
D e f a u l t : “ a l l “ Default: “all”
Named Arguments#
- --concurrency, -c
C o n c u r r e n c y v a l u e ( D e f a u l t : 1 0 ) Concurrency value (Default: 10)
D e f a u l t : 1 0 Default: 10
releases#
M a n a g e a n d e x p o r t d a t a s e t r e l e a s e s f o r a p r o j e c t . Manage and export dataset releases for a project.
[1;34m[0m[1;35mredbrick releases[0m [[32m-h[0m] [32m{create,export,info} ...[0m
Subcommands#
- subcommand
P o s s i b l e c h o i c e s : c r e a t e , e x p o r t , i n f o Possible choices: create, export, info
Sub-commands#
create#
C r e a t e a d a t a s e t r e l e a s e . Create a dataset release.
[1;34m[0m[1;35mredbrick releases create[0m [[32m-h[0m] [[36m--only-ground-truth[0m] [32mrelease[0m
Positional Arguments#
- release
R e l e a s e n a m e Release name
Named Arguments#
- --only-ground-truth
C r e a t e a r e l e a s e f r o m o n l y t h e g r o u n d t r u t h t a s k s . Create a release from only the ground truth tasks.
D e f a u l t : F a l s e Default: False
export#
E x p o r t a d a t a s e t r e l e a s e . D o w n l o a d s a l l l a b e l s f r o m t h e r e l e a s e . Export a dataset release. Downloads all labels from the release.
[1;34m[0m[1;35mredbrick releases export[0m [[32m-h[0m] [[36m--semantic[0m] [[36m--binary-mask[0m] [[36m--single-mask[0m] [[36m--png[0m] [[36m--mhd[0m] [[36m--concurrency [33mCONCURRENCY[0m] [[36m--refresh[0m] [32m[release][0m
Positional Arguments#
- release
R e l e a s e n a m e o r I D t o e x p o r t Release name or ID to export
Named Arguments#
- --semantic
W h e t h e r t o e x p o r t a l l s e g m e n t a t i o n s a s s e m a n t i c _ m a s k . Whether to export all segmentations as semantic_mask.
D e f a u l t : F a l s e Default: False
- --binary-mask
W h e t h e r t o e x p o r t a l l s e g m e n t a t i o n s a s b i n a r y m a s k s . Whether to export all segmentations as binary masks.
D e f a u l t : F a l s e Default: False
- --single-mask
W h e t h e r t o e x p o r t a l l s e g m e n t a t i o n s i n a s i n g l e f i l e . Whether to export all segmentations in a single file.
D e f a u l t : F a l s e Default: False
- --png
E x p o r t l a b e l s a s P N G m a s k s . Export labels as PNG masks.
D e f a u l t : F a l s e Default: False
- --mhd
E x p o r t s e g m e n t a t i o n m a s k s i n M H D f o r m a t . Export segmentation masks in MHD format.
D e f a u l t : F a l s e Default: False
- --concurrency, -c
C o n c u r r e n c y v a l u e ( D e f a u l t : 1 0 ) Concurrency value (Default: 10)
D e f a u l t : 1 0 Default: 10
- --refresh
R e f r e s h t h e r e l e a s e a r c h i v e . Refresh the release archive.
D e f a u l t : F a l s e Default: False
info#
G e t i n f o r m a t i o n a b o u t a d a t a s e t r e l e a s e . Get information about a dataset release.
[1;34m[0m[1;35mredbrick releases info[0m [[32m-h[0m] [32m[release][0m
Positional Arguments#
- release
R e l e a s e n a m e o r I D Release name or ID
login#
L o g i n t o R e d B r i c k A I u s i n g S e s s i o n - b a s e d a u t h e n t i c a t i o n . Login to RedBrick AI using Session-based authentication.
[1;34m[0m[1;35mredbrick login[0m [[32m-h[0m] [[36m--url [33mURL[0m]
Named Arguments#
- --url, -u
E n d p o i n t U R L , d e f a u l t s t o h t t p s : / / a p i . r e d b r i c k a i . c o m Endpoint URL, defaults to https://api.redbrickai.com
logout#
C l e a r y o u r c u r r e n t s e s s i o n a n d l o g o u t f r o m R e d B r i c k A I . Clear your current session and logout from RedBrick AI.
[1;34m[0m[1;35mredbrick logout[0m [[32m-h[0m]
status#
D i s p l a y y o u r c u r r e n t a u t h e n t i c a t i o n a n d o r g a n i z a t i o n s t a t u s . Display your current authentication and organization status.
[1;34m[0m[1;35mredbrick status[0m [[32m-h[0m]