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

我是Java和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 is undefined”。

我尝试了几种变体,但总是出现相同的错误。这是我当前的代码:

  //
  //  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);
      })

我在做什么错了?

预先感谢您的帮助。

道格

lanhu091 回答:ITK JS readImageDICOMFileSeries()在控制台上报告“ filePath未定义”

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

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

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

可能还有其他资源/示例。
本文链接:https://www.f2er.com/3169837.html

大家都在问