I used this demo to import the downloaded headsq.vti file into Times 404 again via reader.seturl
.
my code:
reader.setUrl(`http://172.22.150.37:8000/img/headsq.vti`, { loadData: true }).then(() => {
const fileContents = writer.write(reader.getOutputData());
// Try to read it back.
const textEncoder = new TextEncoder();
writerReader.parseAsArrayBuffer(textEncoder.encode(fileContents));
renderer.resetCamera();
renderWindow.render();
const blob = new Blob([fileContents], { type: 'text/plain' });
const a = window.document.createElement('a');
a.href = window.URL.createObjectURL(blob, { type: 'text/plain' });
a.download = 'headsq.vti';
a.text = 'Download';
a.style.position = 'absolute';
a.style.left = '50%';
a.style.bottom = '10px';
document.body.appendChild(a);
a.style.background = 'white';
a.style.padding = '5px';
});
image path:
got error:
How can I directly use the downloaded VTI file ?