cornerstone icon indicating copy to clipboard operation
cornerstone copied to clipboard

How I can skip the corrupted dicom file

Open pmd23 opened this issue 4 years ago • 0 comments

I am facing one issue. I am converting dicom images to jpg and trying to render that jpg file using Cornerstone.

In the stack i am pushing the multiple (files) jpg images to view the images. file names which is I am getting from server. if in case one of the dicom file may get corrupted due to some reason. so in that case how I can skip this file and render next file.

series = result.data;	
imageIds = series.map(seriesImage => `${baseUrl}${seriesImage}`);
stack.imageIds = imageIds; // HERE I AM GETTING FILES S
// In some cases file is corrupted so How I can skip that file and render another one.
cornerstone.loadAndCacheImage(imageIds[0]).then((image) => {
       viewport = cornerstone.getDefaultViewportForImage(element, image);
        cornerstone.displayImage(element, image,viewport)
	cornerstoneTools.addStackStateManager(element, ['stack'])
	cornerstoneTools.addToolState(element, 'stack', stack)
})

Mostly what happened with me the first dicom file in stack with is corrupted then I am not able to load other files. So how I can skip that file and render other.

This error I am getting which rendering the dicom image ### Unexpected VR found for DICOM fragment sequence: UN

pmd23 avatar Jun 26 '20 20:06 pmd23