-6

如何将文件扩展名为 .dcm 的 Dicom 图像转换为 R 中的 Jpg 或 Png

我在 R 中尝试以下代码,但收到错误为错误:'...' 在不正确的上下文中使用

我下面的 R 代码有什么问题。

source("https://neuroconductor.org/neurocLite.R")
neuro_install('dcmtk')
install_dcmtk()
library(dcmtk)
setwd("D:/train/ID00007637202177411956430")
dcm<-readDICOMFile("27.dcm")
dcmj2pnm(dcm, outfile = tempfile(fileext = ".png"),opts = "--write-png", ...)

4

1 回答 1

-1

查看 dcmj2pnm.R ( https://github.com/muschellij2/dcmtk/blob/master/R/dcmj2pnm.R ) 的代码,它似乎希望第一个参数是 DICOM 文件名。您似乎在内存中传递 DICOM 图像,而不是文件名。

于 2020-07-21T18:30:26.093 回答