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
210 stars 64 forks source link

[Help] fileToLoad is not loading local files #441

Closed rodrigomologni closed 2 years ago

rodrigomologni commented 2 years ago

Hi Team!

I would like to visualize local files using ?fileToLoad= as shown in the image below, available at Progressive Web App.

image

But it's not working. What am I doing wrong? If anyone could answer me, I'd appreciate it.

Script

  1. Create C:\data
  2. Download https://data.kitware.com/api/v1/file/564a65d58d777f7522dbfb61/download/data.nrrd
  3. Move 025_13months_T2_RegT1_Reg2Atlas_ManualBrainMask_Stripped.nrrd to C:\data
  4. Run itk-vtk-viewer from C:\
itk-vtk-viewer
  => Serving C:\ on port 3000

     vEthernet (Default Switch) => http://172.27.128.1:3000/
     vEthernet (Wi-Fi) => http://172.23.224.1:3000/
     Wi-Fi => http://192.168.1.103:3000/
     vEthernet (Ethernet) => http://172.30.16.1:3000/
  1. Open http://localhost:3000/?fileToLoad=/data/025_13months_T2_RegT1_Reg2Atlas_ManualBrainMask_Stripped.nrrd

image

thewtex commented 2 years ago

For security reasons, the browser intentionally does not provide access to the local filesystem.

thewtex commented 2 years ago

Note that the CLI is provided to load local filesystem files -- they can be passed as arguments.

rodrigomologni commented 2 years ago

Hi @thewtex!

For security reasons, the browser intentionally does not provide access to the local filesystem.

How can I overcome this problem, please? I'm using Google Chrome on Windows 10.

Note that the CLI is provided to load local filesystem files -- they can be passed as arguments.

CLI doesn't work either. fileToLoad receives /data/025_13months_T2_RegT1_Reg2Atlas_ManualBrainMask_Stripped.nrrd, but 025_13months_T2_RegT1_Reg2Atlas_ManualBrainMask_Stripped.nrrd (without /data/) is passed.

PS D:\Users\Rodrigo\Downloads> itk-vtk-viewer 025_13months_T2_RegT1_Reg2Atlas_ManualBrainMask_Stripped.nrrd

itk-vtk-viewer
  => Serving . on port 3000

     Conexão Local => http://10.8.0.26:3000/?fileToLoad=/data/025_13months_T2_RegT1_Reg2Atlas_ManualBrainMask_Stripped.nrrd
     vEthernet (Wi-Fi) => http://172.26.112.1:3000/?fileToLoad=/data/025_13months_T2_RegT1_Reg2Atlas_ManualBrainMask_Stripped.nrrd
     Wi-Fi => http://192.168.1.103:3000/?fileToLoad=/data/025_13months_T2_RegT1_Reg2Atlas_ManualBrainMask_Stripped.nrrd
     vEthernet (Ethernet) => http://172.20.160.1:3000/?fileToLoad=/data/025_13months_T2_RegT1_Reg2Atlas_ManualBrainMask_Stripped.nrrd
     vEthernet (Default Switch) => http://172.24.64.1:3000/?fileToLoad=/data/025_13months_T2_RegT1_Reg2Atlas_ManualBrainMask_Stripped.nrrd
thewtex commented 2 years ago

@rodrigomologni thanks for the follow-up! Addressed in #453

rodrigomologni commented 2 years ago

Hi @thewtex! Both are working now! Thank you very much! 🎉

I have a question, why /data/ is added in the URL? For example:

itk-vtk-viewer BRUGGE60K_FY-SF-KM-1-1.vtp ==> http://172.22.144.1:3000/?fileToLoad=/data/BRUGGE60K_FY-SF-KM-1-1.vtp
thewtex commented 2 years ago

The /data/ is just informational.

rodrigomologni commented 2 years ago

OK. Thanks!