react-cornerstone-viewport not loading images with dicomweb or wadors prefix.
Hi,
As we can find in examples, react-cornerstone-viewport only works with .dcm files.
What do I need to load images with dicomweb or wadors prefix as OHIF is doing?
OHIF is sending Image URLS (instance frames) with wadors: prefix and react-cornerstone-viewport is loading and displaying them in the canvas, as you can see in the following image

This is my cornestone setup
/*
* Init Cornerstone
*/
import dicomParser from 'dicom-parser'
import cornerstone from 'cornerstone-core'
import cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader'
import cornerstoneMath from 'cornerstone-math'
import cornerstoneTools from 'cornerstone-tools'
import Hammer from 'hammerjs'
export default function initCornerstone(csToolsConfig) {
// Cornerstone Tools
cornerstoneTools.external.cornerstone = cornerstone
cornerstoneTools.external.Hammer = Hammer
cornerstoneTools.external.cornerstoneMath = cornerstoneMath
cornerstoneTools.loadHandlerManager.setErrorLoadingHandler(
(element, imageId, error) => {
console.error(imageId) // eslint-disable-line no-console
throw error
}
)
const defaultCsToolsConfig = csToolsConfig || {
globalToolSyncEnabled: true,
showSVGCursors: true,
autoResizeViewports: false,
}
cornerstoneTools.init(defaultCsToolsConfig)
// WADO Image Loader
cornerstoneWADOImageLoader.external.cornerstone = cornerstone
cornerstoneWADOImageLoader.external.dicomParser = dicomParser
cornerstoneWADOImageLoader.webWorkerManager.initialize({
maxWebWorkers: navigator.hardwareConcurrency || 1,
startWebWorkersOnDemand: true,
taskConfiguration: {
decodeTask: {
initializeCodecsOnStartup: false,
usePDFJS: false,
strict: false,
},
},
})
}
Hi !
I'm beginning to use cornerstone but i think it's because of the way Cornerstone is built. Because cornerstoneWADOImageLoader is a specific image loader registered in cornerstone Doc image loader and you can see in this doc also that the scheme is used to use the proper image loader for cornerstone.
I'm not sure but maybe it'll answer your question.
Inquiring on this as well. wadors: prefix on the image load results in errors using this React plugin, such as "cannot read "samplesPerPixel property" as it is "undefined" per console errors.