ITK JS readImageDICOMFileSeries()在控制台上报告'filePath未定义'

问题描述 投票:0回答:1

我是Javascript和ITK的新手。我从克隆ITK-JS存储库开始,并通过示例进行工作。

我的目标-从我的浏览器,将目录(MR系列)中的所有图像读取到单个ITK图像(3D卷)中。

我从ITK-JS示例中的'webpack'示例开始-使该示例在我的浏览器中运行。

然后:1.更改index.html以启用multiple元素的<input type='file'>。我通过将FileList对象的内容写入html元素来确认可以正常工作,并通过'readFile()'使它工作;然后2.将“ readFile(null,files [0])”替换为“ readImageDICOMFileSeries(null,files)”。

[当我使用'readImageDICOMFileSeries()运行代码时,出现控制台消息:“ TypeError:filePath未定义”。

我已经尝试了几种变体,但总是会遇到相同的错误。这是我当前的代码:

  //
  //  read the images
  // return readFile(null, files[0])  // -- this line works
  return readImageDICOMFileSeries(null, files)  // the causes TypeError: filePath is undefined 
      .then((worker)=>{
              const {image}=worker;
              let mFile = JSON.stringify(image) ;
              alert(mFile)
              console.log(image);
      })
      .catch(error=>{
              console.error(error);
              alert(error.message);
      })

我在做什么错?

感谢您的帮助。

道格

javascript itk
1个回答
0
投票

这是一个使用ITK和emscripten来编译ITK库以读取大多数医学图像格式的示例。它可以在浏览器和node.js中使用。

https://www.npmjs.com/package/med-img-reader

我希望它会有所帮助。https://github.com/InsightSoftwareConsortium/itk-js/tree/master/examples/

可能有其他资源/示例
© www.soinside.com 2019 - 2024. All rights reserved.