view TODO @ 5687:13b1ff603b37 default

author Alain Mazy <>
date Tue, 09 Jul 2024 15:32:30 +0200
parents 4a2bfda999c6
line wrap: on
line source

=== Orthanc Roadmap ===

For higher-level ideas in the roadmap, please first read the
"Contributing to Orthanc" section of the Orthanc Book:

Some features are being funded by an OpenCollective one-time donations.
selected features are marked with priorities ((1) - higher, (2) - medium, (3) - nice to have)


* Configure an user-defined site UID root if generating DICOM UIDs
* Improve handling of errors in the command queue:
* Support partial file retrieval in Orthanc::HttpClient
* Support retry counter in Orthanc::HttpClient
* Option to enable DNS lookups in DICOM:
* Toolbox::ComputeMD5() fails on files larger than 4GB
* Add an option to run Orthanc in read-only mode both for DICOM and for Rest API.
* Logging: add more specific information to contextualize the logs.
  For a DICOM Transfer, that would be nice to include the modality in the context + a study identifier or a job id.
* (1) Accept extra DICOM tags dictionaries in the DCMTK format '.dic' (easier to use than declare
  them in the Orthanc configuration file).  Even the standard dictionaries could be 
  overriden by these custom dictionaries.
* Provide more flexibility wrt Dicom TLS ciphers and TLS version:
  Can maybe be achieved by adding a configuration to select the TLS Security Profile: 
  (e.g: TSP_Profile_BCP195_ND instead of TSP_Profile_BCP195)
* Add configurations to enable/disable warnings:
  - Modifying an instance while keeping its original SOPInstanceUID: This should be avoided!
  - Modifying a study while keeping its original StudyInstanceUID: This should be avoided!
* Store the job registry in a dedicatd table in DB ?
  Note: that might also be the right time to have a central jobs registry when working
  with multiple Orthanc instances on the same DB.
* Right now, some Stable events never occurs (e.g. when Orthanc is restarted before the event is triggered).
  Since these events are used to e.g. generate dicom-web cache (or update it !), we should try
  to make sure these events always happen.
  - Generate the events when setting IsStable=true when starting an Orthanc (ok for SQLite) ?
  - Also consider the use case of an Orthanc cluster that is being scaled-down just after one Orthanc instance
    has received a few instances -> we can not only check for missing stable events at startup since no Orthanc will start.  
    We would need to maintain the list of "unstable" resources in DB instead of memory only.
* In prometheus metrics, implement Histograms or Exponential Histograms to measure durations.  Right now, we only provide
  "average" durations that are not very relevant
  - for job durations (+ have one histogram for each job)
  - for HTTP request handling
  - ...
* Investigate if one could fix KeepAlive race conditions:
* The DICOM file cache shall keep a MD5 of the cached file and compare it with MD5
  from the DB.  That would allow 2 orthancs in a swarm to realize when the other
  Orthanc has updated the file:
* Allow saving PrivateTags in ExtraMainDicomTags.
  Note: they can actually be stored but they then appear as "Unknown Tag & Data" in the responses.
  If we try to add the PrivateCreator in the ExtraMainDicomTags, then, the DICOMWeb plugin fails to initialize because the private tags are not known.

Documentation (Orthanc Book)

* Write a getting started guide (step by step) for each platform to replace :
  - Ubuntu/Debian
  - Windows
  - OSX
  - Docker on Linux
  Each step by step guide should contain:
  - get binaries
  - launch
  - open explorer
  - edit configuration file
  - restart and observe changes

* Explain how log rotation can be achieved (no built-in support in Orthanc)
* Explain how to interface with Mirth/NextGen Connect
* How to reproduce issues by replacing Orthanc with storescp or wlmscpfs
* How to capture TCP traffic of DICOM protocol using tcpdump and Wireshark
* Add more configurations of viewers (Weasis, Slicer...):
* Discuss HL7 in a dedicated page:

Orthanc Explorer

* Option to tune the number of results for a local lookup:




* (1) Archive jobs: Resume downloads using "range requests":
* (3) Create DICOM from DICOMweb JSON ("application/dicom+json")
  with "/tools/create-dicom"
* (2) Create multi-frame images with /tools/create-dicom (by adding a
  "MultiFrame" flag to avoid creating a series), or modify PixelData
  of a multi-frame image:
* (1) Specify the transfer syntax in /tools/create-dicom
* Support Palette PNG in /tools/create-dicom:
* Support creation of DICOM files from MP4 in /tools/create-dicom.
  Sample python code:
  We would need to extract frame rate + dimension from the MP4 which would
  require ffmpeg or a similar library -> can not be done in the Orthanc core.
  -> keep it for a python plugin
  -> or require the payload to include rows/columns/cinerate/...
* (1) In the /studies/{id}/anonymize route, add an option to remove
  secondary captures.  They usually contains Patient info in the
  image. The SOPClassUID might be used to identify such secondary
* Support "/preview" and "/matlab" for LUT color images
* /preview should be able to display a dose report:
* Try to transcode files if a simple decoding fails:
* (2) Ranges of DICOM tags for "Keep" and "Remove" in ".../modify" and ".../anonymize":
* return error code/reason in HTTP response if resubmit/cancel/pause fails ...
* filter /changes by type e.g: /changes?filter=StablePatient
* save more details in jobs e.g: the resources being sent/exported ...
* allow filtering/ordering on the /jobs route:
* add an "AutoDeleteIfSuccessful": false option when creating jobs
* Allow skiping automatic conversion of color-space in transcoding/decoding.
  The patch that was initialy provided was breaking the IngestTranscoding.
  This might require a DCMTK decoding plugin ?
* Implement a 'commit' route to force the Stable status earlier.


* Stick to the JSONapi or JAREST guidelines for a "v2" of the API:!msg/orthanc-users/Bag-SwEE9ZI/-w7QXI6p7-oJ



* Support C-GET SCU (note that C-GET SCP was introduced in Orthanc 1.7.0)
* Support "Retrieve AE Title" (0008,0054) in C-FIND:
  - On SCP side: done by
  - On SCU side:
* Check Big Endian transfer syntax in ParsedDicomFile::EmbedImage and
* Strict hierarchical C-FIND:
* report DIMSE error codes in Rest API and job status for /store /query /move /retrieve
* report progress report of C-Move operation in jop progress.  There are 
  progress callbacks available in DIMSE_moveUser
* Log outgoing C-Find queries
* Support other Transfer Syntaxes in the Worklist plugin:


* Support extended association (e.g. for C-Find relational queries):
* Support C-MOVE-CANCEL:
* Combine StudyDate + StudyTime in C-Find matching (also for the worklist plugin with 
  ScheduledProcedureStartTime & Date).
  We should first filter in SQL by StudyDate only, combine it with StudyTime into a single 
  DateTime string and filter again in C++.


* Support multiple specific character sets (cf. "SCSH32" in orthanc-tests)
  - Japanese test:
* Support Supplementary Kanji set (ISO 2022 IR 159)
* Create DICOM files with multibyte encodings (Korean, JapaneseKanji, SimplifiedChinese)


* (3) ServerContext::DicomCacheLocker => give access to the raw buffer,
  useful in ServerContext::DecodeDicomInstance()
* (2) DicomMap: create a cache to the main DICOM tags index
* (3) Check out rapidjson:
* For C-Find results: we could store the computed tags
    in metadata on some events like NewSeries + DeletedSeries (same for other computer tags).
    OtherTags that could be saved in Metadata as well:
    - ModalitiesInStudy
    - all computed counters at series/study/patient level
    - RequestAttributesSequence (sequence that must be included in all DicomWeb QIDO-RS for series)

* Long-shot & not sure it is even feasible at all: try to reduce memory usage by implementing streaming
  when receiving DICOM instances from the Rest API or from DICOM and store files directly to disk as they
  are received.  Note that this would likely require rewriting large parts of Orthanc.  Note sure that 
  would be compatible with Transcoding.
  Use case: receiving 10 1GB instances in parallel can consume up to 20 GB
  Alternative option 1: write an "external application/plugin" that would take care of these receptions, write the
    file at the right place and send a signal to Orthanc to "adopt" the file.
  Alternative option 2: declare a memory resource (X GB) that is available for reception.  Every time
    Orthanc starts receiving a file, it reserves the memory or twice the memory (through a Semaphore)
    if no memory is available, it waits and possibly timeouts returning a 503 or DIMSE A700 (out of resources).
    This would at least protect from "out of memory" crashes.
  Alternative option 3: Configure DCMTK to "stream" DICOM files on a temporary file on disk.  Pass the file handle
    to Orthanc and/or the Storage plugin (instead of passing a memory buffer) -> the object-storage plugin could 
    "stream" the file to the storage.  The HTTP server could also "stream" its response from file handles.
    Transcoding should be "file based" too.
* To investigate: usage of mapped_file (not only in the indexer plugin):


* Integration test searching for "\" and "%" in PatientName, PatientID...



* Implement PluginsJob::GetOutput() to allow user-defined jobs to provide output:
* Add plugins for normalized operations (notably so as to support
  Print SCU/SCP, cf. "dcmprscp"):
* Provide access to the Orthanc::DicomUserConnection class in plugins:
* Provide a C++ callback similar to "ReceivedInstanceFilter()" in Lua
* Update the SDK to handle buffer sizes > 4GB (all sizes are currently coded in uint32_t)
* Add a C-Get SCP handler: OrthancPluginRegisterGetCallback
* Add a primitive for user authentication (to generate 401 HTTP status, whereas
  the "RegisterIncomingHttpRequestFilter()" can only generate 403 HTTP status)
* Add an index on the UUID column in the DelayedDeletion plugin:

Ideas of plugins

* Converter to/from NIfTI
* Decode JPEG2k with grok:
* Generate dynamic HTTP content using Lua:
* More generally, expose more callbacks of the plugin SDK in Lua:
* Configuration interface plugin


* Configure HTTP headers from Lua (in RestApiPost(), RestApiPut()
  and RestApiDelete().!msg/orthanc-users/WNnW187OILM/6XX_bm96BwAJ
* Retrieve HTTP status from calls to HttpGet, HttpPost, ...

Code refactoring

* Avoid direct calls to FromDcmtkBridge (make most of its 
  methods private), go through ParsedDicomFile wherever possible



* RHEL through EPEL (as of 2021, CentOS seems to be over):
* Fedora: Are DICOM dictionaries correctly located?

Big-endian architectures

* Check the generated 16bpp PNG images

Microsoft Windows

* Add compatibility with non-ASCII paths (Orthanc expresses its paths
  as UTF-8 strings, but Windows expects them to be translated to the 
  system locale)
* Fix error message when stopping the service:


Maintenance tools

* Standalone tool to detect corrupted files:
* Standalone tool to detect orphan files in OrthancStorage

Code quality and integration tests

* Have a look at openQA (cf. GNU Health)
* Add integration tests for LUT
* Add more complex testing scenarios like data-migration, change of 
  configuration files, multiple orthanc interacting togethers with various 
  config.  This should probably look like the python toolbox tests ...
  - add a test to validate Modalities and Peers stored in DB are not lost 
    while upgrading from one version to the other (Sylvain)
* On Ubuntu 20.04, accesses to unitialized memory are sometimes
  reported in libgjpeg by valgrind, if running the following command
  (this is probably unrelated to Orthanc):
  $ ./ --force Orthanc.test_bitbucket_issue_141 Orthanc.test_create_pdf Orthanc.test_decode_brainix_as_jpeg

External applications

* Create REST bindings with Slicer
* Create REST bindings with Horos/OsiriX