Package: chrs
chrschrsis a command-line client forChRIS.
It can upload files toChRISlibrary, download files fromChRIS,
and can run and feeds (computational experiments) onChRIS.InstallationThere are four ways to installchrs.Direct DownloadYou can downloadchrsfromGithub Releases.
Get the latest version here:https://github.com/FNNDSC/chrs/releases/latestThis is the easiest installation method, however there is no
mechanism for automatic updates.Using Pipchrsis published toPyPiusingPyO3/maturin. Installingchrsusingpipwill be preferable for users who are already comfortable with Python.pipinstall--userchrsIf necessary, add thebinfolder to$PATH:echo'export PATH="$HOME/.local/bin:$PATH"'>>~/.bashrcsource~/.bashrccargo binstallcargo binstallis a convenient solution
for installing pre-compiled binaries usingcargoas a package manager. First install rust-binstall,
then runcargobinstallchrsBuild from source from crates.ioUsecargoto get and build the
package from source, from crates.io:cargoinstallchrsIf necessary, add thebinfolder to$PATH:echo'export PATH="$HOME/.cargo/bin:$PATH"'>>~/.bashrcsource~/.bashrcUsingchrsRunchrs --helpfor usage information.Note: when specifying URLs, they should be to the backend API, not the front-end.
E.g. instead ofhttps://app.chrisproject.org/feeds/1520, the correct URL would
behttps://cube.chrisproject.org/api/v1/1520/.Overviewchrs--addresshttps://cube.chrisproject.org/api/v1/--usernamechris--passwordchris1234login
chrsuploadmy_data/chrs loginchrs loginsaves authentication tokens securely using yourkeyring. Logging into multiple
different instances ofChRISis supported, or as different users
on the sameChRISinstance.# log in, type username and password interactivelychrs--addresshttps://cube.chrisproject.org/api/v1/login# log in without using keyring and non-interactively, useful for automationchrs--addresshttps://cube.chrisproject.org/api/v1/--usernametest-userlogin--no-keyring--password-stdin<<<"$PASSWORD"chrs logoutRemove previously saved authentication token(s).# remove saved logins for cube.chrisproject.orgchrs--addresshttps://cube.chrisproject.org/api/v1/logout# remove all saved loginschrslogoutchrs switchSwitch between saved logins.# interactive prompt, use arrow keys to choosechrsswitchjenningshttp://cube-next.tch.harvard.edu/api/v1/jennihttp://cube-next.tch.harvard.edu/api/v1/rudolphhttp://cube-next.tch.harvard.edu/api/v1/
>jennydamanhttps://cube.chrisproject.org/api/v1/chrishttps://cube.chrisproject.org/api/v1/# non-interactive usagechrsswitch--usernamejennydaman--addresshttps://cube.chrisproject.org/api/v1/chrs feedsList or search existing feeds.$chrsfeeds
COVID-NETanalysisonpatientABCDchris/feed_1891
SPLvisualizationchris/feed_1890
LLDtest3chris/feed_1889
Subplatesurfacessurface_fitparameterschedulejennings/feed_1888
Preprocessdatafromhenryjennings/feed_1887chrs ls PATHList files and directories inChRIS.# by default, folder names appear as feed names or plugin instance titles$chrsls--tree-L4chris/feed_1443
chris/Segmentedvolumedataanalysis
└──pl-dircopy_5827├──data│├──output.meta.json│├──input.meta.json│└──aparc.a2009saseg.mgz└──generatevolumereport└──data├──output.meta.json├──mgz2LUT_report.pdf├──mgz2LUT_report.html└──input.meta.json

$chrsls--tree-L4--full--rawchris/feed_1443
chris/feed_1443
└──chris/feed_1443/pl-dircopy_5827├──chris/feed_1443/pl-dircopy_5827/data│├──chris/feed_1443/pl-dircopy_5827/data/output.meta.json│├──chris/feed_1443/pl-dircopy_5827/data/input.meta.json│└──chris/feed_1443/pl-dircopy_5827/data/aparc.a2009saseg.mgz└──chris/feed_1443/pl-dircopy_5827/pl-mgz2LUT_report_5836└──chris/feed_1443/pl-dircopy_5827/pl-mgz2LUT_report_5836/data├──chris/feed_1443/pl-dircopy_5827/pl-mgz2LUT_report_5836/data/output.meta.json├──chris/feed_1443/pl-dircopy_5827/pl-mgz2LUT_report_5836/data/mgz2LUT_report.pdf├──chris/feed_1443/pl-dircopy_5827/pl-mgz2LUT_report_5836/data/mgz2LUT_report.html└──chris/feed_1443/pl-dircopy_5827/pl-mgz2LUT_report_5836/data/input.meta.jsonchrs upload FILE...Upload files and run workflows.# upload some fileschrsuploadone_file.txtanother_file.txt# upload all files in a directorychrsuploadmy_data/# upload directory and create a feed with the name "Tractography Study"chrsupload--feed"Tractography Study"my_data/# upload directory, create a feed, and run a workflowchrsupload--feed"Surface Extraction"\--pipeline"Fetal Brain Surface Extraction v1.0.0"\my_data/chrs download SRC [DST]Download files fromChRIS.# download all files created by a feed number 15 into the current directorychrsdownloadhttps://cube.chrisproject.org/api/v1/15/files/# download the output of plugin instance 30, but save the files to a# directory called "my_outputs" instead of something like# "<username>/feed_15/pl-dircopy_5550/pl-pfdicom_tagExtract_5551/data/...",chrsdownload--shortenhttps://cube.chrisproject.org/api/v1/plugins/instances/5551/files/my_outputs# download files from ChRIS given a pathchrsdownloadchris/uploads/fetal_dataset
chrsdownloadSERVICES/PACS/orthanc/9cfafb0-DIXON_SHANNON_ANON-20140701# download data from all plugin instances of a feed to the same folder,# effectively joining their outputs into one directorychrsdownload--flattenchris/feed_14feed14_outputschrs run-latestRun aChRISplugin (i.e. create a plugin instance) by name.# run pl-mri10yr06mo01da_normal (fs-type) to create a new ChRIS feedchrsrun-latestpl-mri10yr06mo01da_normal# run pl-mri-preview (ds-type) after plugin instance id=56, with option --units-fallback mmchrsrun-latest--memory-limit2Gi--compute-resource-namemoc--previous-id56pl-mri-preview----units-fallbackmmNote: since plugin version is not specified when usingchrs run-latest,
the parameters are subject to change.chrs run(not yet implemented)
is preferable for the sake of reproducibility.A plugin's parameters help can be viewed, e.g. forpl-mri-preview,
by runningchrs plugin-help pl-mri-previewchrs getMake an authenticated HTTP GET request.Aschrsis still under development, many functions are still unavailable.
Advanced users can usechrs getto query the CUBE API directly.# example: list plugins used in feed 12cargorun--gethttps://cube.chrisproject.org/api/v1/12/plugininstances/|jq-r'.results[] | .plugin_name'chrs pipeline-file addUploads a file-representation of aChRISpipeline.
Supported file formats are:JSON (plugin_treemay be either a string (canonical) or an object)YAMLchrspipeline-fileaddchris/tests/data/pipelines/fetal_brain_reconstruction_expanded.jsonchrs pipeline-file convertConvert between supported pipeline file formats.chrspipeline-fileconvertpipeline.jsonpipeline.ymlFeedbackPlease report bugs and/or request features here:https://github.com/FNNDSC/chrs/issues