How do you select the data source after building and serving from the dist folder.

67 views
Skip to first unread message

Stephen Douglas Scotti

unread,
Apr 30, 2020, 9:10:39 PM4/30/20
to cornerstone platform
I downloaded the .zip file from github and put the on my iMac to first evaluate the package.  Running from Docker is much easier initially, but then I ran.  After experimenting around to understand the file structure, etc., I ran:

yarn run build


to see what a compiled production version looks like.  That takes quite awhile on an older Mac, and it seems to get sort of stuck at 93%.  Nevertheless, it does build the files and they all get dumped in the dist folder under /platform/viewer/dist.  When I point a web server (Apache port 80 or Nginx port 81),  I do get a list of studies, but the studies are from the public server and not my local install of Orthanc.

How do I build OHIF, or otherwise modify it after building, so that it pulls images from my Orthanc instance.  Orthanc is running on the standard ports, and OHIF is running on port 80.  I am using MAMP and the root directory is the build in the dist folder.

In app.config, there is this, probably copied from the default.js file that I edited.  I have a local instance of Orthanc running on my computer.  I'm not sure that I have the configOSX.json file for Orthanc set up correctly, but I think so, and OHIF is pulling data from the public server.

    dicomWeb: [
     
{
        name
: 'Orthanc',
        wadoUriRoot
: '/wado',
        qidoRoot
: '/dicom-web',
        wadoRoot
: '/dicom-web',
        qidoSupportsIncludeField
: false,
        imageRendering
: 'wadors',
        thumbnailRendering
: 'wadors',
     
},
   
],
 
},


index.html is loading these script:

 
<script
   
src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default%2CObject.values%2CArray.prototype.flat%2CObject.entries%2CSymbol%2CArray.prototype.includes%2CString.prototype.repeat%2CArray.prototype.find"></script>
 
<script type="text/javascript">
    window
.PUBLIC_URL = '/';
 
</script>
 
<script type="text/javascript" src="/app-config.js"></script>
 
<script type="module" src="/init-service-worker.js"></script>

 
<title>OHIF Viewer</title>

 
<!-- WEB FONTS -->
 
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700&display=swap" rel="stylesheet" />

 
<!-- EXTENSIONS -->
 
<!-- <script type="text/javascript" src="path/to/some-extension.js"></script>

    <script>
      // If configuration file is a JS Object:
      window.config.extensions = [SomeExtension];

      // If configuration file is a JS Function:
      window.config = () => {
        return {
          extensions: [SomeExtension]
        };
      };
    </script> -->

<link href="/app.6ca565b7fb86a8a731ff.css" rel="stylesheet"></head>

<body>
 
<noscript> You need to enable JavaScript to run this app. </noscript>

 
<div id="root"></div>
<script type="text/javascript" src="/app.bundle.baa22ae66e3af014fd61.js"></script>



Stephen Douglas Scotti

unread,
Apr 30, 2020, 9:31:05 PM4/30/20
to cornerstone platform
Also, I tried using an Nginx server running on port 81 and I get a black screen.

Marc McLean

unread,
May 1, 2020, 7:22:18 AM5/1/20
to Stephen Douglas Scotti, cornerstone platform
Stephen,

It's been about a year ago that I tested the viewer with a local instance of Orthanc, but if I remember correctly you can run:

yarn run dev:orthanc 


Marc

--
You received this message because you are subscribed to the Google Groups "cornerstone platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cornerstone-plat...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cornerstone-platform/500fc9d0-c5ec-414f-965f-4b9806ec7c0f%40googlegroups.com.


--
Marc McLean
Message has been deleted

Peter Humphreys

unread,
May 1, 2020, 11:16:40 PM5/1/20
to Stephen Douglas Scotti, cornerstone platform
Black screen means your viewer is not connecting to the database correctly. The config.js isn't setup properly - you need to have the url to your orthanc server if you are running MAMP then I assume this is on the same box so something like this and just update the port from 8042 if your Orthanc server is listening on a different port:

{
  "servers": {
    "dicomWeb": [
      {
        "name": "Orthanc",
        "wadoUriRoot": "http://localhost:8042/wado",
        "qidoRoot": "http://localhost:8042/dicom-web",
        "wadoRoot": "http://localhost:8042/dicom-web",
        "qidoSupportsIncludeField": false,
        "imageRendering": "wadouri",
        "thumbnailRendering": "wadouri"
        }
      }
    ]
  }
} 

--
You received this message because you are subscribed to the Google Groups "cornerstone platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cornerstone-plat...@googlegroups.com.


--

Peter Humphreys


      Clinical Integration Specialists

243 Ocean Keys Bvd Clarkson WA 6030

https://www.virtualgoo.com/

M

E

+61 451 283 776

p...@virtualgoo.com

NOTE: This electronic mail message together with any attachments is confidential. If you are not the intended recipient, please e-mail us immediately and destroy this message. You may not copy, disclose or use the contents in any way. Thank you.

Augmented Reporting

unread,
Jun 26, 2022, 5:40:50 PMJun 26
to cornerstone platform
for OHIF v3-stable, define your data source in /platform/viewer/public/config/default.js, and then docker-compose build && docker-compose up -d

(there's probably a more logical way using the correct environmental variable in the dockerfile, but configuring default.js and building will work)

Reply all
Reply to author
Forward
0 new messages