{"id":16726136,"url":"https://github.com/ch00k/orthanc-cli","last_synced_at":"2025-10-19T04:58:53.607Z","repository":{"id":37179130,"uuid":"309107721","full_name":"Ch00k/orthanc-cli","owner":"Ch00k","description":"Command-line interface for Orthanc, an open-source, lightweight DICOM server","archived":false,"fork":false,"pushed_at":"2023-03-06T09:58:56.000Z","size":329,"stargazers_count":14,"open_issues_count":15,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-12T05:51:45.984Z","etag":null,"topics":["cli","command-line","commandline","dicom","orthanc","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ch00k.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-01T13:58:13.000Z","updated_at":"2024-10-29T18:27:00.000Z","dependencies_parsed_at":"2024-10-28T11:44:50.312Z","dependency_job_id":null,"html_url":"https://github.com/Ch00k/orthanc-cli","commit_stats":{"total_commits":128,"total_committers":4,"mean_commits":32.0,"dds":0.25,"last_synced_commit":"5360fb9619be8adefdf102b4a7c4f5b241a8d67d"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ch00k%2Forthanc-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ch00k%2Forthanc-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ch00k%2Forthanc-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ch00k%2Forthanc-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ch00k","download_url":"https://codeload.github.com/Ch00k/orthanc-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235213325,"owners_count":18953731,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","command-line","commandline","dicom","orthanc","rust"],"created_at":"2024-10-12T22:52:16.336Z","updated_at":"2025-10-04T03:30:50.351Z","avatar_url":"https://github.com/Ch00k.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![crate](https://img.shields.io/crates/v/orthanc-cli.svg)](https://crates.io/crates/orthanc-cli)\n[![test](https://github.com/Ch00k/orthanc-cli/workflows/tests/badge.svg)](https://github.com/Ch00k/orthanc-cli/actions)\n[![codecov](https://codecov.io/gh/Ch00k/orthanc-cli/branch/master/graphs/badge.svg)](https://codecov.io/github/Ch00k/orthanc-cli)\n[![license](https://img.shields.io/crates/l/orthanc.svg)](./UNLICENSE)\n\n# orthanc-cli\n\n**orthanc-cli** is a command-line interface for\n[Orthanc](https://www.orthanc-server.com), an open-source, lightweight [DICOM](https://en.wikipedia.org/wiki/DICOM)\nserver.\n\n\u003c!--toc-start--\u003e\n* [Compatibility](#compatibility)\n* [Installation](#installation)\n  * [Completions](#completions)\n* [Configuration](#configuration)\n  * [Orthanc server address](#orthanc-server-address)\n  * [Orthanc server authentication](#orthanc-server-authentication)\n* [Usage](#usage)\n  * [Help](#help)\n  * [Entities and their IDs](#entities-and-their-ids)\n  * [Search](#search)\n  * [Anonymizing and modifying Entities](#anonymizing-and-modifying-entities)\n    * [Anonymization](#anonymization)\n    * [Modification](#modification)\n\u003c!--toc-end--\u003e\n\n## Compatibility\n\n_orthanc-cli_ usually supports the same Orthanc versions as its underlying [orthanc-rs](https://crates.io/crates/orthanc)\ncrate. See [Compatibility](https://github.com/Ch00k/orthanc-rs#compatibility) for details.\n\n## Installation\n\nThere are multuple different ways to install _orthanc-cli_.\n\n* using [cargo](https://doc.rust-lang.org/cargo):\n\n  ```\n  $ cargo install --locked orthanc-cli\n  ```\n\n* manually downloading a release package from Github Releases [page](https://github.com/Ch00k/orthanc-cli/releases)\n\n### Completions\n\n_orthanc-cli_ comes with pre-built completion files for Bash, fish and Zsh. See [here](./completion/README.md) for\ndetails on how to use those files.\n\n## Configuration\n\n_orthanc-cli_ needs several settings configured in order to communicate with an Orthanc server: Orthanc server address,\nand username and password (in case the server requires authentication).\n\n### Orthanc server address\n\nOrthanc server address can be set with `-s/--server` command-line option. The value of the option is an HTTP(S) URL,\ne.g. `http://127.0.0.1:8042`. Alternatively, if you prefer to not type the option every time you call a command, you can\nset an environment variable `ORC_ORTHANC_SERVER`\n\n```\n$ export ORC_ORTHANC_SERVER=http://127.0.0.1:8042\n```\n\n### Orthanc server authentication\n\nIf the Orthanc server you are working with requires authentication, you can provide it with command-line options\n`-u/--username` and `-p/--password`. Similar to the server address these can also be set as environment variables\n`ORC_ORTHANC_USERNAME` and `ORC_ORTHANC_PASSWORD`:\n\n```\n$ export ORC_ORTHANC_USERNAME=orthanc\n$ export ORC_ORTHANC_PASSWORD=orthanc\n```\n\n## Usage\n\n### Help\n\nTo get a general idea of the usage run `orthanc --help`. This will present the list of options, flags, and subcommands:\n\n```\n$ orthanc --help\northanc-cli 0.4.0\nAndrii Yurchuk \u003cay@mntw.re\u003e\nCommand-line interface for Orthanc, an open-source, lightweight DICOM server\n\nUSAGE:\n    orthanc [OPTIONS] \u003cSUBCOMMAND\u003e\n\nFLAGS:\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nOPTIONS:\n    -s, --server \u003cSERVER\u003e        Orthanc server address\n    -u, --username \u003cUSERNAME\u003e    Orthanc username\n    -p, --password \u003cPASSWORD\u003e    Orthanc password\n\nSUBCOMMANDS:\n    patient     Patient-level commands\n    study       Study-level commands\n    series      Series-level commands\n    instance    Instance-level commands\n    modality    Modality-level commands\n    help        Prints this message or the help of the given subcommand(s)\n```\n\nEach subommand in its turn has its own has its own help:\n\n```\n$ orthanc study --help\northanc-study\nStudy-level commands\n\nUSAGE:\n    orthanc study \u003cSUBCOMMAND\u003e\n\nFLAGS:\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nSUBCOMMANDS:\n    list         List all studies\n    show         Show study details\n    search       Search for studies\n    anonymize    Anonymize study\n    modify       Modify study\n    download     Download study\n    delete       Delete study\n    help         Prints this message or the help of the given subcommand(s)\n```\n\nSubcommands might have nested subcommands, which also respond to `--help`. If unsure, append `--help` to the command to\nsee how to use it.\n\n### Entities and their IDs\n\n_orthanc-cli_ makes a convention of calling Patients, Studies, Series and Instances _Entities_ (not to be confused with\n[Application Entities](http://otpedia.com/entryDetails.cfm?id=137)). You might come across this naming in documentation\nor names of command-line options or flags.\n\nSimilarly to Orthanc web interface _orthanc-cli_ operates mainly with unique identifiers (IDs) when it comes to referring\nto _Entities_ (Patients, Studies, Series etc.). Each Entity is assigned a unique identifier (ID) by the Orthanc server,\nthat looks similar to this:\n\n```\n22c54cb6-28302a69-3ff454a3-676b98f4-b84cd80a\n```\n\nIn the list of Studies for example the identifiers are in the first column (ID):\n\n```\n$ orthanc study list\n ID                                             PatientID   AccessionNumber   StudyInstanceUID              StudyDescription   StudyDate   StudyTime   Number of Series\n------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n ab7a6e26-18072a37-5f2a2210-8a7f0823-f2fa9119   patient_2   REMOVED           1.3.46.670589.11.1.5.0.6560   Study 1            20110101    140606      2\n cbec5098-53cd29f5-86d01e4b-c6e76386-709f00a6   patient_1   REMOVED           1.3.46.670589.11.1.5.0.7116   Study 1            20120101    130431      2\n 8c69229f-eba0eccb-2aa35808-e26bf10a-69375f79   patient_1   REMOVED           1.3.46.670589.11.3540642177   Study 2            20110101    084707      2\n```\n\nWhen you need to refer to an Entity in any of the _orthanc-cli_ commands use its Orthanc ID:\n\n```\n$ orthanc study show cbec5098-53cd29f5-86d01e4b-c6e76386-709f00a6\n ID                 cbec5098-53cd29f5-86d01e4b-c6e76386-709f00a6\n Patient ID         8be8a583-193f48d2-d9b8dd53-adc11459-e46c7c27\n PatientID          patient_1\n StudyID            402411870\n AccessionNumber    REMOVED\n StudyInstanceUID   1.3.46.670589.11.1.5.0.7116.2012100313043060185\n StudyDescription   Study 1\n StudyDate          20120101\n StudyTime          130431\n Number of Series   2\n```\n\n### Search\n\n_orthanc-cli_ allows searching for entities withing the Orthanc server. You can search for patients, studies, series and\ninstances with `orthanc \u003cENTITY\u003e search --query \u003cQUERY\u003e`. Each of the commands will return a list of entities you search\nfor, e.g. `orthanc patient search` will return a list of patients, `orthanc study search` - a list of studies etc.\n\nThe value of the `--query` command-line option are space-separted pairs of DICOM tags: `TagName=TagValue`. For examle:\n\n```\n$ orthanc series search --query BodyPartExamined=PINKY\n ID                                             SeriesInstanceUID                SeriesDescription   Modality   BodyPartExamined   Number of Instances\n-------------------------------------------------------------------------------------------------------------------------------------------------------\n 33209de2-5b2e7753-9537bc4d-4bd166f6-fb48d303   1.2.276.0.7230010.3.1.3.816750   Series 1            MR         PINKY              1\n dab1ca97-70f554a9-c8e83dec-17216f2c-88148c44   1.2.276.0.7230010.3.1.3.816746   Series 1            MR         PINKY              1\n```\n\nWildcards are allowed in values of some DICOM tags. More info on that\n[here](http://dicom.nema.org/medical/dicom/2019e/output/chtml/part04/sect_C.2.2.2.4.html).\n\nAn example of wildcard usage in `StudyDescription`:\n\n```\n$ orthanc study search --query AccessionNumber=REMOVED StudyDescription=*1\n ID                                             PatientID   AccessionNumber   StudyInstanceUID                 StudyDescription   StudyDate   StudyTime   Number of Series\n---------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n 342f1834-e4658a76-2f7f8dd6-5f4034dd-eee91323   patient_1   REMOVED           1.2.276.0.7230010.3.1.2.816848   Study 1            20110101    140606      2\n 92be942a-744ab613-d5ea8167-5b11a0c9-670f0b10   patient_1   REMOVED           1.2.276.0.7230010.3.1.2.816853   Study 1            20110101    140606      2\n ab7a6e26-18072a37-5f2a2210-8a7f0823-f2fa9119   patient_2   REMOVED           1.3.46.670589.11.1.5.0.6560.20   Study 1            20110101    140606      4\n```\n\n### Anonymizing and modifying Entities\n\n_orthanc-cli_ allows modification and anonymization of entities.\nModification requires you to specify how exactly an entity should be modified, while anonymization does not. For both\nanonymization and modification you can configure the process with either command-line options or a configuration file.\n\nNote that both anonymization and modification create a copy of the entity that is being anonymized/modified instead of\nchanging the entity in-place.\n\n#### Anonymization\n\nAnonymization of an entity can be done with or without configuration. If done without configuration, anonymization\ntreats DICOM tags according to [Application Level Confidentiality Profile Attributes](http://dicom.nema.org/medical/dicom/2017c/output/html/part15.html#table_E.1-1):\n\n```\n$ orthanc study anonymize cbec5098-53cd29f5-86d01e4b-c6e76386-709f00a6\n New study ID   bb8802bf-fa9621bd-e43406cf-707a3cfb-7786ec34\n Patient ID     6cf95a77-4112b9d3-905c17f0-d48ee8e1-b9e6d482\n```\n\nTo change the way particular DICOM tags are treated during anonymization you can use command-line options:\n\n* `--replace`: the values of specified DICOM tags will be replaced with those specified\n* `--keep`: the values of the specified DICOM tags will be left intact (even if they are specified as to be removed in\nthe table mentioned above)\n* `--keep-private-tags`: whether or not to keep the values of private DICOM tags (if omitted private DICOM tags are\nremoved)\n\nThe above command-line options are used as follows:\n\n```\n$ orthanc study anonymize cbec5098-53cd29f5-86d01e4b-c6e76386-709f00a6 --replace PatientName=\"Rick Sanchez\" PatientBirthDate=19700101 --keep StudyDate StudyTime --keep-private-tags\n New study ID   72b2983e-0196e005-7102f94f-4bf2161c-18d33b59\n Patient ID     1209a543-256b97d2-639bebf1-c3c076e7-0b4b8a3f\n```\n\nIf you intend to give special treatment to more than a couple of DICOM tags, writing them all on the command line can\nbecome inconvenient. For this purpose you can use an anonymization configuration file instead. The configuration file\nmust be in [YAML](https://yaml.org) format and may contain the following fields (see above for their meaning):\n\n* `replace`\n* `keep`\n* `keep_private_tags`\n\nExample:\n\n```yaml\nreplace:\n  PatientName: Rick Sanchez\n  PatientBirthDate: 19700101\nkeep:\n  - StudyDate\n  - StudyTime\nkeep_private_tags: true\n```\n\nThe usage of such a configuration file is as follows:\n\n```\n$ orthanc study anonymize cbec5098-53cd29f5-86d01e4b-c6e76386-709f00a6 --config /tmp/anonymization_conf.yml\n New study ID   22fc5ba2-650a6ef5-76f78251-af82a47f-87ce33f4\n Patient ID     8d8454ca-3c70d505-3d4ddced-792feac4-7c992741\n```\n\n#### Modification\n\nIn order to modify an entity you are required to specify how exactly it should me modified. This can be done with the\nfollowing command-line options:\n\n* `--replace`: the values of specified DICOM tags will be replaced with those specified\n* `--remove`: the specified DICOM tags will be removed\n\nThe above command-line options are used as follows:\n\n```\n$ orthanc study modify cbec5098-53cd29f5-86d01e4b-c6e76386-709f00a6 --replace PatientName=\"Rick Sanchez\" PatientBirthDate=19700101 --remove StudyDate StudyTime\n New study ID   24510c21-3b10e0ac-268f7570-b8c01c22-77e19a41\n Patient ID     b64615f0-5cac7527-68e751f7-c22d822c-e4ff1e1d\n```\n\nSimilar to the process of anonymization you can use a configuration file for modification in case you need to modify\nmore than a hadful of DICOM tags. The configuration file must be in [YAML](https://yaml.org) format and may contain the\nfollowing fields:\n\n* `replace`\n* `remove`\n\nExample:\n\n```yaml\nreplace:\n  PatientName: Rick Sanchez\n  PatientBirthDate: 19700101\nremove:\n  - StudyDate\n  - StudyTime\n```\n\nThe usage of such a configuration file is as follows:\n\n```\n$ orthanc study modify cbec5098-53cd29f5-86d01e4b-c6e76386-709f00a6 --config /tmp/modification_conf.yml\n New study ID   db0a9bc8-7b0362ca-f361c32b-ba62bfd2-44ff849b\n Patient ID     8be8a583-193f48d2-d9b8dd53-adc11459-e46c7c27\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fch00k%2Forthanc-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fch00k%2Forthanc-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fch00k%2Forthanc-cli/lists"}