cornerstone icon indicating copy to clipboard operation
cornerstone copied to clipboard

Issues in loading DICOM image from IIS server in ASP.NET application

Open hasanmansor opened this issue 9 years ago • 2 comments

Hi ! I am trying to load DICOM images in an ASP.NET application using IIS server but I am failed .. I am using WADOImageLoader and WebWorker. Previously, I successfully loaded images in a Node.js application. But now it seems like there is an error in the imageId as the server returns a "404 not found" error.. I tried the following different URLs for imageId but none works.. (Here the "ISeeImageTestApplication" is the name of my ASP.NET application)

dicomweb://localhost/ISeeImageTestApplication/Resources/Images/image1.dcm, wadouri://localhost/ISeeImageTestApplication/Resources/Images/image1.dcm, dicomweb:/localhost/ISeeImageTestApplication/Resources/Images/image1.dcm, wadouri:/localhost/ISeeImageTestApplication/Resources/Images/image1.dcm, http://localhost/ISeeImageTestApplication/Resources/Images/image1.dcm, dicomweb:/http://localhost/ISeeImageTestApplication/Resources/Images/image1.dcm, dicomweb:http://localhost/ISeeImageTestApplication/Resources/Images/image1.dcm, wadouri:http://localhost/ISeeImageTestApplication/Resources/Images/image1.dcm ... and many others

And here is my JS code which loads the image:

`$(document).ready(function () { var config = { maxWebWorkers: 1, startWebWorkersOnDemand: true, webWorkerPath: '/cornerstoneWADOImageLoader/cornerstoneWADOImageLoaderWebWorker.js', taskConfiguration: { 'decodeTask': { loadCodecsOnStartup: false, initializeCodecsOnStartup: false, codecsPath: '../../cornerstoneWADOImageLoaderCodecs.js', usePDFJS: false }, 'sleepTask': { sleepTime: 3000 } } }; cornerstoneWADOImageLoader.webWorkerManager.initialize(config);

var element = document.getElementById('imageViewer');
var imageId = "dicomweb://localhost/ISeeImageTestApplication/Resources/Images/image1.dcm";

cornerstone.enable(element);

cornerstone.loadImage(imageId).then(function (image) {
    var viewport = cornerstone.getDefaultViewportForImage(element, image);
    cornerstone.displayImage(element, image, viewport);
});

});`

Any help would be highly appreciated. Thanks

Hasan

hasanmansor avatar Oct 06 '17 13:10 hasanmansor

I found the solution. Actually the IIS wasn't configured to serve .dcm files, I added the following lines to my Web.config file of my application and it worked.

<staticContent> <mimeMap fileExtension=".dcm" mimeType="application/DICOM" /> </staticContent> Thanks

hasanmansor avatar Oct 06 '17 14:10 hasanmansor

Great!

swederik avatar Oct 06 '17 14:10 swederik