OHIF / Viewers

OHIF zero-footprint DICOM viewer and oncology specific Lesion Tracker, plus shared extension packages
https://docs.ohif.org/
MIT License
3.1k stars 3.28k forks source link

OHIF Integration with .net core server and it's failing to display studies list #1328

Closed jaizz2003 closed 4 years ago

jaizz2003 commented 4 years ago

I am currently working on a DICOM based web application, I have created my backend server using .net core and want to integrate my server with OHIF viewer. I read all the documentation of OHIF viewer and configured my default.js file and changed the routes of wadoUriRoot,qidoRoot and wadoRoot as follows

window.config = {
// default: '/'
  routerBasename: '/',
  extensions: [],
  showStudyList: true,
  filterQueryParam: false,
  servers: {
    dicomWeb: [
      {
        name: 'DCM4CHEE',
        wadoUriRoot: 'http://127.0.0.1:5000',
        qidoRoot: 'http://127.0.0.1:5000',
        wadoRoot: 'http://127.0.0.1:5000',
        qidoSupportsIncludeField: true,
        imageRendering: 'wadors',
        thumbnailRendering: 'wadors',
        enableStudyLazyLoad: true,
      },
    ],
  }

Now when I recompile and run it, I get a totally black screen. I have checked that data is going to the browser. What are the possible reason for this behavior? How can I make my OHIF viewer to display my own Dicom images?

dannyrb commented 4 years ago

Do you see any errors in your console when you try to visit the application?

jaizz2003 commented 4 years ago

@dannyrb I finally able to solve it. It was a browser problem, Firefox and Chrome were not allowing CORS so I had to add services and UseCors to my Startup.cs in my server code to enable CORS

https://docs.microsoft.com/en-us/aspnet/core/security/cors?view=aspnetcore-3.1 There it's mentioned how to do it.

dannyrb commented 4 years ago

Thanks for taking the time to provide an update ^_^ Don't be a stranger!