{"id":17030329,"url":"https://github.com/vsoch/som-orthanc","last_synced_at":"2026-04-06T03:04:59.504Z","repository":{"id":141668020,"uuid":"93211781","full_name":"vsoch/som-orthanc","owner":"vsoch","description":"A Docker base for running Orthanc for the School of Medicine","archived":false,"fork":false,"pushed_at":"2017-06-03T03:20:55.000Z","size":28,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-23T21:51:25.380Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vsoch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2017-06-02T23:49:04.000Z","updated_at":"2023-11-17T07:33:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"5cebaa87-586c-4b1a-97de-d4e913edf7ac","html_url":"https://github.com/vsoch/som-orthanc","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"a01a1183032e3e9547b1888a249fb6490acf7681"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vsoch/som-orthanc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsoch%2Fsom-orthanc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsoch%2Fsom-orthanc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsoch%2Fsom-orthanc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsoch%2Fsom-orthanc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vsoch","download_url":"https://codeload.github.com/vsoch/som-orthanc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsoch%2Fsom-orthanc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267988489,"owners_count":24176996,"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","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-10-14T08:06:17.276Z","updated_at":"2026-04-06T03:04:59.445Z","avatar_url":"https://github.com/vsoch.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SOM-ORTHANC\n\nThis is a Docker image configured to run [orthanc](http://book.orthanc-server.com/users/docker.html) with a simple postgres database. I've provided complete instructions in [scripts/setup_instance.sh](scripts/setup_instance.sh) to configure a new Ubuntu 16.04 machine to run Docker and docker-compose, and in the future this will be a start up script for any general machine started with [Packer](https://packer.io). But you can also just install Docker and docker-compose locally, and give it a test! To use, you will need to install Docker and docker-compose. Then:\n\n```\ngit clone https://www.github.com/som/som-orthanc.git\ncd som-orthanc\n```\nYou probably want to change the configuration file username and password for the database, it's in [orthanc/orthanc.json](orthanc/orthanc.json). Then bring up the image.\n\n```\ndocker-compose up -d\n```\nYou are going to see:\n\n```\nWARNING: Image for service orthanc was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.\n```\nand that's fine, it's because we are being a bit lazy in having it build for us instead of building it in advance. You could do that too:\n\n```\ndocker-compose build\n```\n\nports 104 and 80 should connect to Orthanc, so you should be able to open [http://localhost](http://localhost) to see things. Note that we are using the web server (nginx) installed on the host, which doesn't have to be the case (we could use a docker image).\n\nHow do you see your images? Like this:\n\n```\ndocker-compose ps\ndocker ps\n```\n\nYou will probably want to shell into the image to look around. I usually do this (note that I got the name from the `ps` commands above:\n\n```\nNAME=$(docker ps -aqf \"name=somorthanc_orthanc_1\")\ndocker exec -it $NAME bash\n```\n\nThe `i` means interactive, and the `t` means terminal. So you are asking to run `bash` via an interactive terminal.\n\n# Uploading Dicom\nI found I could just drag and drop files on the web interface, even my janky cookie dicoms seemed to work ok :) It should be located at [http://localhost/app/explorer.html#upload](http://localhost/app/explorer.html#upload).\n\nAnd this is how you would use (for example, storescu) to upload files:\n\n```\nstorescu -aec SOMORTHANC localhost 4242 *.dcm\n```\n\nSince you probably don't have this installed on your computer, you can use the dcmtk Singularity / Docker images that I've generated. Both are provided, and can be run with [Singularity](http://singularity.lbl.gov) if in an environment without sudo, or with Docker on your local machine. Since we are working with Docker here, I'll show you how to use [the image provided on Docker Hub](https://hub.docker.com/r/vanessa/dicom/), and I've also written up a complete (nicer to look at) walkthrough for both as part of the [pydicom](https://pydicom.github.io/containers-dcmtk) organization containers docs.\n\nHere is how to see the general command usage, with `--help`:\n\n```\ndocker run --volume /path/on/host/*.dcm:/data vanessa/dicom storescu --help\n```\n\nand here is how you could map a folder locally into the container with dicoms, and use storescu to send files there:\n\n```\ndocker run --volume /path/on/host/*.dcm:/data vanessa/dicom storescu -aec SOMORTHANC localhost 4242 /data/*.dcm\n```\n\nBefore I get this up and running in some cloudy place, I'm going to look more into the authentication and other plugins that we might want.\n\n# Storage\nThe image uses an actual folder on the filesystem, which seems similar to MIRC-CTP's approach. In this instance, I found it here, along with the configuration file:\n\n```\nls etc/orthanc\nOrthancStorage orthanc.json\n```\n\nand you can tell this from the [docker-compose.yml](docker-compose.yml), but there are other database stuffs (eg postgres) here:\n\n```\nls /var/lib/orthanc/db\nls /var/lib/postgresql\n```\n\n# Build\nThe original build files I found by way of looking at the [base Docker Image](https://github.com/jodogne/OrthancDocker/blob/master/orthanc/Dockerfile). They are located at `/root` in the image.\n\n```\nroot@b0ec09719511:/# ls /root\nbuild-dicomweb.sh    build-webviewer.sh  build.sh\nbuild-postgresql.sh  build-wsi.sh\n```\n\nAnd unfortunately the /root/orthanc folder (with additional scripts and resources) is removed during the [original build](https://github.com/jodogne/OrthancDocker/blob/master/orthanc/build.sh)! I cloned the original repo with mercurial, re-obtained the files (stored in [orthanc/resources](orthanc/resources) and these are added to the image. I was very happy to see that these scripts are all in Python :)\n\n\n# Things to Learn!\nImportantly, OrthanC has a [RESTful API](http://book.orthanc-server.com/users/rest.html) to interact with it, which looks like it will do most of what we need (although I need to test for myself). Backup can be done with [postgres](http://book.orthanc-server.com/users/backup.html), and I also know how to set up what Google calls [hot standby](https://cloud.google.com/community/tutorials/setting-up-postgres-hot-standby) to back that up.\n\n# Plugins\nThe application seems to be focused around plugins, which I found here:\n\n```\nls /usr/share/orthanc/plugins/\nlibOrthancDicomWeb.so           libOrthancWSI.so\nlibOrthancPostgreSQLIndex.so    libOrthancWebViewer.so\nlibOrthancPostgreSQLStorage.so\n```\n\nI also found some command line executables:\n\n```\n$ cd /usr/local/bin\n$ ls\nOrthancRecoverCompressedFile  OrthancWSIDicomToTiff  OrthancWSIDicomizer\n```\n\n## OrthancRecoverCompressedFile\n\n```\nOrthancRecoverCompressedFile       \nMaintenance tool to recover a DICOM file that was compressed by Orthanc.\n\nUsage: OrthancRecoverCompressedFile \u003cinput\u003e [output]\nIf \"output\" is not given, the data will be output to stdout\n```\n\n## OrthancWSIDicomToTiff\nThis is pretty neat, it seems to be a tool to convert dicoms to tiff, likely it's used for the web viewer.\n\n```\nOrthancWSIDicomToTiff --help\nW0602 23:44:33.496989 FromDcmtkBridge.cpp:142] Loading the external DICOM dictionary \"/usr/share/libdcmtk2/dicom.dic\"\nW0602 23:44:33.509186 ApplicationToolbox.cpp:230] Orthanc WSI version: mainline (20170308T122235)\n\nUsage: OrthancWSIDicomToTiff [OPTION]... [INPUT] [OUTPUT]\nOrthanc, lightweight, RESTful DICOM server for healthcare and medical research.\n\nConvert a DICOM image for digital pathology stored in some Orthanc server as a\nstandard hierarchical TIFF (whose tiles are all encoded using JPEG).\n\nGeneric options:\n  --help                Display this help and exit\n  --version             Output version information and exit\n  --verbose             Be verbose in logs\n\nOptions for the source DICOM image:\n  --orthanc arg (=http://localhost:8042/)\n                                        URL to the REST API of the target \n                                        Orthanc server\n  --username arg                        Username for the target Orthanc server\n  --password arg                        Password for the target Orthanc server\n\nOptions for the target TIFF image:\n  --color arg           Color of the background for missing tiles (e.g. \n                        \"255,0,0\")\n  --reencode arg        Whether to re-encode each tile in JPEG (no transcoding,\n                        much slower) (Boolean)\n  --jpeg-quality arg    Set quality level for JPEG (0..100)\n\n```\n\n###  OrthancWSIDicomizer \nThis looks to be going the other way, creating dicom from a pathology image.\n\n```\nW0602 23:46:24.566482 FromDcmtkBridge.cpp:142] Loading the external DICOM dictionary \"/usr/share/libdcmtk2/dicom.dic\"\nW0602 23:46:24.580463 ApplicationToolbox.cpp:230] Orthanc WSI version: mainline (20170308T122300)\nE0602 23:46:24.580654 Dicomizer.cpp:587] No input file was specified\n\nUsage: OrthancWSIDicomizer [OPTION]... [INPUT]\nOrthanc, lightweight, RESTful DICOM server for healthcare and medical research.\n\nCreate a DICOM file from a digital pathology image.\n\nGeneric options:\n  --help                Display this help and exit\n  --version             Output version information and exit\n  --verbose             Be verbose in logs\n  --threads arg (=2)    Number of processing threads to be used\n  --openslide arg       Path to the shared library of OpenSlide (not necessary \n                        if converting from standard hierarchical TIFF)\n\nOptions for the source image:\n  --dataset arg         Path to a JSON file containing the DICOM dataset\n  --sample-dataset      Display a minimalistic sample DICOM dataset in JSON \n                        format, then exit\n  --reencode arg        Whether to re-encode each tile (no transcoding, much \n                        slower) (Boolean)\n  --repaint arg         Whether to repaint the background of the image \n                        (Boolean)\n  --color arg           Color of the background (e.g. \"255,0,0\")\n\nOptions to construct the pyramid:\n  --pyramid arg (=0)    Reconstruct the full pyramid (slow) (Boolean)\n  --smooth arg (=0)     Apply smoothing when reconstructing the pyramid \n                        (slower, but higher quality) (Boolean)\n  --levels arg          Number of levels in the target pyramid\n\nOptions for the target image:\n  --tile-width arg                      Width of the tiles in the target image\n  --tile-height arg                     Height of the tiles in the target image\n  --compression arg                     Compression of the target image \n                                        (\"none\", \"jpeg\" or \"jpeg2000\")\n  --jpeg-quality arg                    Set quality level for JPEG (0..100)\n  --max-size arg (=10)                  Maximum size per DICOM instance (in MB)\n  --folder arg                          Folder where to store the output DICOM \n                                        instances\n  --folder-pattern arg (=wsi-%06d.dcm)  Pattern for the files in the output \n                                        folder\n  --orthanc arg (=http://localhost:8042/)\n                                        URL to the REST API of the target \n                                        Orthanc server\n  --username arg                        Username for the target Orthanc server\n  --password arg                        Password for the target Orthanc server\n\nDescription of the imaged volume:\n  --imaged-width arg (=15)  With of the specimen (in mm)\n  --imaged-height arg (=15) Height of the specimen (in mm)\n  --imaged-depth arg (=1)   Depth of the specimen (in mm)\n  --offset-x arg (=20)      X offset the specimen, wrt. slide coordinates \n                            origin (in mm)\n  --offset-y arg (=40)      Y offset the specimen, wrt. slide coordinates \n                            origin (in mm)\n\nAdvanced options:\n  --optical-path arg (=brightfield) Optical path to be automatically added to \n                                    the DICOM dataset (\"none\" or \"brightfield\")\n  --icc-profile arg                 Path to the ICC profile to be included. If \n                                    empty, a default sRGB profile will be \n                                    added.\n  --safety arg (=1)                 Whether to do additional checks to verify \n                                    the source image is supported (might slow \n                                    down) (Boolean)\n  --lower-levels arg                Number of pyramid levels up to which \n                                    multithreading should be applied (only for \n                                    performance/memory tuning)\n```\n\nA few notes from this [list](https://groups.google.com/forum/#!topic/orthanc-users/RO4XKCxDEAE) on how to scale.\n\n\u003e\u003e Regarding Swarm, you'll have to adapt this to a Docker \"stack\" file; \nthe format is mostly compatible with docker-compose and may eventually \nsupplant it. You have to pay attention to persistent volumes however, \nwhich you don't want spread across nodes mindlessly. Leads: consider \nusing a distributed filesystem for Orthanc storage, or a key/value \nstore with associated plugin, or even a Postgres database with \n\"EnableStorage\": \"true\". For the index, only use one replica and \nconsider things like CloudStor or other solutions that will ensure the \ndata is always where the container is running (or accessible from \nthere). PG also has built-in replication capabilities to explore. \n\nI suggest starting small, though scaling does get interesting ;). \nStateless services are usually easy to work with, especially with a \nsolution like Swarm or K8s, but state is often a little bit of a \nchallenge. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvsoch%2Fsom-orthanc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvsoch%2Fsom-orthanc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvsoch%2Fsom-orthanc/lists"}