cornerstoneWADOImageLoader icon indicating copy to clipboard operation
cornerstoneWADOImageLoader copied to clipboard

Security Error when loading xray dicom images

Open meisterpeeps opened this issue 4 years ago • 8 comments

I am trying to load dicom images and some of them, particularly x-rays are giving me an error. I can successfully load other dicom images, but not the x-rays with the dicom wado loader. I can also load the x-rays using MicroDicom viewer. The error I get:

Security Error: Content at http://localhost:3000/dicom may not load data from blob:http://localhost:3000/610.bundle.min.worker.js.

SecurityError: WorkerGlobalScope.importScripts: Failed to load worker script at "blob:http://localhost:3000/610.bundle.min.worker.js

Is that error meaningful to anyone?

meisterpeeps avatar Sep 28 '21 22:09 meisterpeeps

Hmm that's quite strange. Could you post a de-identified copy of one of the images?

swederik avatar Sep 30 '21 12:09 swederik

I had the same issue, I specified the full paths to the 610.bundle.min.worker.js and 888.bundle.min.worker.js files with:


config = {
	webWorkerTaskPaths: [
		folder + "/610.bundle.min.worker.js",
		folder + "/888.bundle.min.worker.js"
	]
};
cornerstoneWADOImageLoader.webWorkerManager.initialize(config);

Where folder contains the directory (including host) where the files are stored.

hexydec avatar Oct 14 '21 23:10 hexydec

@swederik

I haven't seen the security error since reverting to an older version and then switching to the newest version of wadoImageLoader. Other than that, I didn't change anything. However, some of my images do not render at all still and I also have a problem with some images properly sharpening. I'm using the sharpening code from the custom webworker example: https://rawgit.com/cornerstonejs/cornerstoneWADOImageLoader/master/examples/customWebWorkerTask/index.html

When using the following image, the image gets cut in half rather than sharpening.
https://github.com/meisterpeeps/dicomTest/blob/main/test0.dcm?raw=true

Also, the following image doesn't render at all. It receives a "dicomParser.readPart10Header: DICM prefix not found at location 132 - this is not a valid DICOM P10 file." It can load in the MicroDicom viewer, but cornerstone doesn't load it. The error seems more understandable -- something to do with a header in the file?

https://github.com/meisterpeeps/dicomTest/blob/main/test2.dcm?raw=true

meisterpeeps avatar Oct 26 '21 19:10 meisterpeeps

Also, the following image doesn't render at all. It receives a "dicomParser.readPart10Header: DICM prefix not found at location 132 - this is not a valid DICOM P10 file." It can load in the MicroDicom viewer, but cornerstone doesn't load it. The error seems more understandable -- something to do with a header in the file?

https://github.com/meisterpeeps/dicomTest/blob/main/test2.dcm?raw=true

This second part... actually not a problem. I think I must have had a typo, because it works for me now. That test2.dcm should just be 2.dcm.

The sharpening issue seems legit though.

meisterpeeps avatar Oct 27 '21 05:10 meisterpeeps

... Figured out the source of the sharpening issue... the example code converts the arraybuffer into an int16typedarray and it seems it needs an uint8clampedarray for arraybuffers that contain values between 0 and 255.

meisterpeeps avatar Oct 27 '21 07:10 meisterpeeps

I had the same issue, I specified the full paths to the 610.bundle.min.worker.js and 888.bundle.min.worker.js files with:

config = {
	webWorkerTaskPaths: [
		folder + "/610.bundle.min.worker.js",
		folder + "/888.bundle.min.worker.js"
	]
};
cornerstoneWADOImageLoader.webWorkerManager.initialize(config);

Where folder contains the directory (including host) where the files are stored.

Where did you find these 610 and 888 js files in the first place? Is that something I can download and then drop into a folder on my server? I'm fairly new to this and running into the same error when loading PW ultrasounds vs standard 2D which load without issue.

"7ca8aa43-6c62-411c-a8bb-6ebb060a4897:1 Uncaught (in promise) DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'blob:http://deidentified-server.com/610.bundle.min.worker.js' failed to load."

devopsconsultinginc avatar Nov 01 '21 19:11 devopsconsultinginc

Either:

  • https://unpkg.com/browse/[email protected]/dist/
  • https://www.npmjs.com/package/cornerstone-wado-image-loader

hexydec avatar Nov 22 '21 23:11 hexydec

Either:

  • https://unpkg.com/browse/[email protected]/dist/
  • https://www.npmjs.com/package/cornerstone-wado-image-loader

I'm not sure how to use the npmjs link, but what works for me is the unpkg link after removing /browse - otherwise I get mime type errors.

Notheryne avatar Dec 13 '21 15:12 Notheryne