Kitware / itk-vtk-viewer

2D / 3D web image, mesh, and point set viewer using itk-wasm and vtk.js
https://kitware.github.io/itk-vtk-viewer/
BSD 3-Clause "New" or "Revised" License
209 stars 63 forks source link

The Web Viewer doesn't work #681

Closed EricMoerthVis closed 1 year ago

EricMoerthVis commented 1 year ago

When I access the web viewer it always states the following error:

An error occcured while loading the file. I am trying to load nifti files and compressed nifti files.

The browser doesn't deliver any errors in the console.

EricMoerthVis commented 1 year ago

I am trying for example this file:

https://data.kitware.com/api/v1/file/5b8446868d777f43cc8d5ec1/download/data.nrrd

PaulHax commented 1 year ago

Bummer! Pointing the viewer to that file with a URL parameter seems to work:

https://kitware.github.io/itk-vtk-viewer/app/?fileToLoad=https://data.kitware.com/api/v1/file/5b8446868d777f43cc8d5ec1/download/data.nrrd

Perhaps you can describe step by step how you access the viewer and try to load the file?

EricMoerthVis commented 1 year ago

If you run the exact url in Firefox you get an error and don't see the image. I also get the same error when I try to create the viewer out of Javascript code.

Uncaught (in promise) Exception { name: "NS_ERROR_FAILURE", message: "", result: 2147500037, filename: "https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js", lineNumber: 2, columnNumber: 0, data: null, stack: "u@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:2108834\n2349/KF/e.renderLater@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:2111231\n2349/KF/e.resetCamera@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:2119371\n2349/KF/e.setViewMode@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:2115332\nviewModeVolume@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:169:294079\n2349/e/this._exec@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1457902\n2349/e.prototype.exec@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1467591\n2349/e.prototype.execute@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1459688\n2349/e.prototype.update@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1460057\n2349/e.prototype.start/bv<@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1462896\n2349/e.prototype.process@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1455286\n2349/e.prototype.initialize@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1454804\n2349/e.prototype.start@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1462871\n2349/e.prototype.spawnMachine@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1468946\n2349/e.prototype.spawn@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1468300\n2349/e/this._exec@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1458806\n2349/e.prototype.exec@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1467591\n2349/e.prototype.execute@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1459688\n2349/e.prototype.update@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1460057\n2349/e.prototype.start/bv<@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1462896\n2349/e.prototype.process@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1455286\n2349/e.prototype.initialize@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1454804\n2349/e.prototype.start@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1462871\n2349/e.prototype.spawnMachine@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1468946\n2349/e.prototype.spawn@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1468300\n2349/e/this._exec@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1458806\n2349/e.prototype.exec@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1467591\n2349/e.prototype.execute@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1459688\n2349/e.prototype.update@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1460057\n2349/e.prototype.start/bv<@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1462896\n2349/e.prototype.process@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1455286\n2349/e.prototype.initialize@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1454804\n2349/e.prototype.start@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:1462871\n2349/e/<@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:169:582063\nu@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:104920\n7588/c/i._invoke@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:104709\n7588/S/</<@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:105345\nK@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:861780\na@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:861984\npromise callbackK@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:861851\na@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:861984\n2349/Y/</<@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:862043\n2349/Y/<@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:861923\n2349/W3@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:169:598260\n2349/e/<@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:169:601242\nu@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:104920\n7588/c/i._invoke@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:104709\n7588/S/</<@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:105345\nK@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:861780\na@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:861984\npromise callbackK@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:861851\na@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:861984\n2349/Y/</<@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:862043\n2349/Y/<@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:2:861923\n2349/q3@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:169:601373\nb5@https://kitware.github.io/itk-vtk-viewer/app/itkVtkViewer.js:169:624225\n" }

EricMoerthVis commented 1 year ago

The step is to click on the image in the application and select the file to view. I tried it now with Chrome and it seems to work there. So that is good :)

But in Firefox it still doesn't work with the error message I posted in the last comment

PaulHax commented 1 year ago

Firefox does not work for me ether. Thank you for letting us know!

EricMoerthVis commented 1 year ago

You are welcome! In general, is there a tutorial on how to embedd the viewer within a webpage and feed it with a file or URL within Javascript? I cannot get it running, with an URL I get a 404 error and when I feed it with a predownloaded file it just stays black.

PaulHax commented 1 year ago

Hmm, perhaps the examples/test-conglomerate.html and examples/compare-image.html can get you going?

EricMoerthVis commented 1 year ago

I used those as a starting point but unfortunately they don't work when I try to load a file from url:

kVtkViewer.js:2 GET http://localhost:3000/src/itk/web-workers/min-bundles/pipeline.worker.js 404 (Not Found) (anonymous) @ itkVtkViewer.js:2 e2.exports @ itkVtkViewer.js:2 e2.exports @ itkVtkViewer.js:2 u.request @ itkVtkViewer.js:2 u. @ itkVtkViewer.js:2 (anonymous) @ itkVtkViewer.js:2 y @ itkVtkViewer.js:2 H @ itkVtkViewer.js:2 A5 @ itkVtkViewer.js:169 await in A5 (async) (anonymous) @ itkVtkViewer.js:169 (anonymous) @ itkVtkViewer.js:169 b5 @ itkVtkViewer.js:169 (anonymous) @ ITKVTKSubscriber.js:30

itkVtkViewer.js:2 Uncaught (in promise) Error: Request failed with status code 404 at e2.exports (itkVtkViewer.js:2:75619) at e2.exports (itkVtkViewer.js:2:78035) at XMLHttpRequest.x (itkVtkViewer.js:2:70253) e

this is the error message when I try to do so

EricMoerthVis commented 1 year ago

Have you seen this error before? Is there a known solution to it?

PaulHax commented 1 year ago

Have seen the error. Working on a fix with #679