问题遇到的现象和发生背景
我在vue中开发dicom三维重建,在itkjs读取图片时,一直返回undefinder,经过查询,在itk的imageIO.work.js文件的2225行,filePaths是文件列表,但是加了个work路径,这个路径不存在,是否是写入了对象,这是个前端站,是否需要什么服务?
这样在第3000行读取的的时候,会提示找不到文件
问题相关代码,请勿粘贴截图
Promise.all(fetchFiles).then(path => {
readImageDICOMFileSeries(path).then(({ webWorker, image }) => {
imageData = vtkITKHelper.convertItkToVtkImage(image);
const view3d = document.getElementById("view3d");
const fullScreenRenderer = vtkFullScreenRenderWindow.newInstance({
container: view3d,
background: [0, 0, 0]
});
const renderer = fullScreenRenderer.getRenderer();
const renderWindow = fullScreenRenderer.getRenderWindow();
const actor = vtkVolume.newInstance();
const mapper = vtkVolumeMapper.newInstance({ sampleDistance: 1.1 }); //体渲染映射;
mapper.setSampleDistance(1.3); //体渲染距离原色
mapper.setInputData(imageData);
actor.setMapper(mapper);
const sampleDistance =
0.7 *
Math.sqrt(
imageData
.getSpacing()
.map(v => v * v)
.reduce((a, b) => a + b, 0)
);
mapper.setSampleDistance(sampleDistance);
renderer.addVolume(actor);
renderer.resetCamera();
renderWindow.render();
});
console.log(11);
});
运行结果及报错内容
我想要达到的结果
我希望能把dicom独处,转换成itk格式,然后转成vtk格式,最后完成三维重建