How to load DICOM image from IIS server in an ASP.NET application

177 views
Skip to first unread message

Hasan Mansoor

unread,
Oct 6, 2017, 9:49:19 AM10/6/17
to cornerstone platform

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

Hasan Mansoor

unread,
Oct 6, 2017, 10:55:32 AM10/6/17
to cornerstone platform

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

Reply all
Reply to author
Forward
0 new messages