vtkImageMarchingCubes

Hello there,

I’m struggling to read a vti volume using vtk.js. I feel I’m close to a solution, but still not quite there. Maybe someone with a trained eye can easy detect the problem? Here my code:

const actor = vtkActor.newInstance();
const sphereActor = vtkActor.newInstance();
const mapper = vtkMapper.newInstance();

const marchingCube = vtkImageMarchingCubes.newInstance({
  contourValue: 0.0,
  computeNormals: true,
  mergePoints: true,
});

//XML_imageDataReader
const vtiReader = vtkXMLImageDataReader.newInstance();
vtiReader
  .setUrl('headsq.vti', { loadData: true })
  vtiReader.loadData().then(() => {
  const source = vtiReader.getOutputData(0);
  const actorVolume = vtkActor.newInstance();
  marchingCube.setInputConnection( source );
  marchingCube.setContourValue(200);
  mapper.setInputConnection( marchingCube.getOutputPort() );
  actorVolume.setMapper(mapper);
  actorVolume.getProperty().setColor(0.0, 0.0, 1.0);
  renderer.addActor(actorVolume);
  renderWindow.render();
});

Could you provide any errors that you are seeing, or is your dataset just not showing without any console errors?