How to exchange the VTI file of a case for a local VTI file?

Hello! When I test the official website code case, the following problem occurs when importing local VTI files.Is vtkHttpDataSetReader unable to read vti files on my computer?


reader

  .setUrl(` http://192.168.1.4:8080/test.vti`, { loadData: true })
  .then(() => {
    const data = reader.getOutputData();
    const dataRange = data.getPointData().getScalars().getRange();
    const firstIsoValue = (dataRange[0] + dataRange[1]) / 3;

    const el = document.querySelector('.isoValue');
    el.setAttribute('min', dataRange[0]);
    el.setAttribute('max', dataRange[1]);
    el.setAttribute('value', firstIsoValue);
    el.addEventListener('input', updateIsoValue);

    marchingCube.setContourValue(firstIsoValue);
    renderer.addActor(actor);
    renderer.getActiveCamera().set({ position: [1, 1, 0], viewUp: [0, 0, -1] });
    renderer.resetCamera();
    renderWindow.render();
  });

image

vtkHttpDataSetReader is not a VTI reader (it is more generic and expect its own structure). If you want to read vti file, you need to use vtkXMLImageDataReader.