You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cornerstone can not load DICOM images provided using WadoURI.
This is a slightly modified version of the NextJS template.
Steps to Reproduce
Load a set of DICOM images using the browser's file input feature
Set each image ID to the URL of the images with the "wadouri:" prefix
Load the images into a new Volume
"use client"import{useEffect,useState,useRef}from"react"import{createImageIdsAndCacheMetaData,initDemo}from"../lib"import{createImageIdsAndCacheMetaDataFromLocalFiles}from"@/lib/createImageIdsAndCacheMetaData"import{RenderingEngine,Enums,typeTypes,volumeLoader,}from"@cornerstonejs/core"exportdefaultfunctionApp(){const[uploadedFiles,setUploadedFiles]=useState<File[]>([]);constelementRef=useRef<HTMLDivElement>(null)construnning=useRef(false)useEffect(()=>{constsetup=async()=>{if(running.current){return}running.current=trueawaitinitDemo()// Get Cornerstone imageIds and fetch metadata into RAMconstimageIds=uploadedFiles.map((file)=>`wadouri:${URL.createObjectURL(file)}`)console.log(imageIds)// Instantiate a rendering engineconstrenderingEngineId="myRenderingEngine"constrenderingEngine=newRenderingEngine(renderingEngineId)constviewportId="CT_STACK"constviewportInput={
viewportId,type: Enums.ViewportType.ORTHOGRAPHIC,element: elementRef.currentasHTMLDivElement,defaultOptions: {orientation: Enums.OrientationAxis.SAGITTAL,},}renderingEngine.enableElement(viewportInput)// Get the stack viewport that was createdconstviewport=renderingEngine.getViewport(viewportId)asTypes.IVolumeViewport// Define a volume in memoryconstvolumeId="myVolume"constvolume=awaitvolumeLoader.createAndCacheVolume(volumeId,{
imageIds
})// Set the volume to loadvolume.load()// Set the volume on the viewport and it's default propertiesviewport.setVolumes([{ volumeId }])// Render the imageviewport.render()}if(uploadedFiles.length>0&&elementRef.current&&!running.current){setup()}// Create a stack viewport},[elementRef,running,uploadedFiles])return(<divclassName="h-screen w-screen"><div><inputtype="file"webkitdirectory=""directory=""onChange={(e)=>{constfiles=Array.from(e.target.files||[])setUploadedFiles(files)console.log(files)}}/></div><divref={elementRef}className="w-full h-full bg-red-400"></div></div>)}
The current behavior
No images are loaded and this error is thrown:
Uncaught (in promise) {error: Error: No JPEG Lossless decoder loaded at decodeJPEGLossless (webpack-internal:///(app-pages-br…, dataSet: a }
The expected behavior
The images are loaded and displayed.
OS
Windows 10
Node version
16.14
Browser
Chrome 83
The text was updated successfully, but these errors were encountered:
Describe the Bug
Cornerstone can not load DICOM images provided using WadoURI.
This is a slightly modified version of the NextJS template.
Steps to Reproduce
The current behavior
No images are loaded and this error is thrown:
Uncaught (in promise) {error: Error: No JPEG Lossless decoder loaded at decodeJPEGLossless (webpack-internal:///(app-pages-br…, dataSet: a }
The expected behavior
The images are loaded and displayed.
OS
Windows 10
Node version
16.14
Browser
Chrome 83
The text was updated successfully, but these errors were encountered: