Configuration for use with Orthanc, questions about PDF's and building packages

Describe Your Question

I have a few questions. I am revisiting integration of OHIF with Orthanc using the “ServeFolders” option in Orthanc, whereby the built-in server that is part of Orthanc (I think CivetWeb) serves the front-end files for OHIF. There are some details about that feature of Orthanc here:

I have my entire system setup in Docker, and I created a folder at the root of my package called “OHIF”. I downloaded the from GitHub and then unzipped in in that folder, so the path to my builds is in: /OHIF/Viewers-master/platform/viewer/dist

I then map that in the orthanc.json to the Docker container for Orthanc, and then my URL to the index.html page is like: http://localhost:8042/OHIF/index.html

That does load the page, apparently without any network / file load errors, but I get that warning that says “Sorry, this page does not exist.”, and when I go to the Study List, I do see the list of studies on my Orthanc server.

I realize that probably isn’t a typical way to set it up, but it does seem like it might work from some applications (i.e. development). One drawback is that I need to have node.js / npm / yarn either on my host or baked into the Docker container, which is fine really.

My ServeFolders config in Orthanc is like shown below. Note the MIME type for .mjs, and other settings. The url http://localhost:8042/OHIF is the ‘home’ directory.

    "ServeFolders": {
    "AllowCache" : false,
    "GenerateETag" : false,
    "Extensions": {
      ".mjs": "application/javascript"
    "Folders" : {
    "/docs": "/development/Sphinx",
    "/custom": "/development/custom",
    "/OHIF": "/OHIF/Viewers-master/platform/viewer/dist"

What steps can we follow to reproduce the bug?

With that setup, I can get to a study after going to the study list and then end up on a page like:

http://localhost:8042/OHIF?/viewer/StudyInstanceUID. That displays OK for the most part, except for embedded / encapsulated PDF’s, and the type of error I get depends upon what kind build I perform.

I have tried build, build:package, and I guess next I’ll try build:package-all. Errors:

  1. With build: PDF’s display, but multipage PDF’s will not scroll to or display the last page, but they do download fine. The thumb just says “DOC”, which is the modality I have then set at for now.
  2. With build:package, the thumb says “EncapsulatedPDF”, which is correct but not exactly pretty looking, and then I also get a number of errors that say “Fail to load series, Modality not supported” and “imageID must not be undefined”. I suspect that in this case I am missing some sort of extension or SOPClassUID mapping ?
  3. I will try that next.

Finally, it isn’t clear to me what versions of node.js, npm, yarn I should be using since I had trouble building a little. The Docker container is running Debian 11, and I install node.js in that at build time so I can build OHIF from in the container.


  1. How do I tweak the build / config, so that I can view a study directly without having to go to the StudyList ? Must have something to do with routerBasename, PUBLIC_URL, etc. It does seem that the dicomweb routing locally ‘works’ though since OHIF is served from the Orthanc container itself.

  2. How can I get PDF’s to display correctly ? Do I need to explicitly install / enable the dicom-pdf extension.

  3. What are the recommended versions of node.js / npm / yarn to use for builds, etc. given my setup.

Sorry, but it seems like with a few adjustments this type of setup will at least work for a development server.

Stephen D. Scotti