python - 带有 .nii.gz 文件的医学成像 (PyRadiomics)
问题描述
我正在尝试实施该软件包:
https://pyradiomics.readthedocs.io/en/latest/usage.html
它看起来超级简单,但他们需要 .nrrd文件。我的文件是.nii.gz。我该如何解决这个问题?另外,有没有人尝试在 TCIA 数据上应用 PyRadiomics?如果是这样,我可以看看你的 github 或 Jupyter Notebook 吗?
非常感谢。
解决方案
You could turn NII into numpy array firstly and then turn it into NRRD with using:
import numpy as np
import nibabel as nib
import nrrd
# Download NII
example_filename = "image.nii.gz"
image = nib.load(example_filename)
# Turn into numpy array
array = np.array(img.dataobj)
# Save NRRD
nrrd_path_to = "image.nrrd"
nrrd.write(image_path_to, array)
推荐阅读
- reactjs - JEST Test.DataReducer 未定义
- flutter - 在android上显示带有颤动的pdf
- javascript - 将arraybuffer转换为fileList?
- wordpress - 有没有办法为产品付款并在服务交付之前暂缓付款?
- c++ - 如何将不同的变量传递给相同类型的 QML
- python - Azure 服务总线。自动锁定更新
- python - 为什么 bar.py 中的 print(sys.modules['__main__']) 会产生相同的输出?
- ironpython - Spotfire - 通过 IronPython 根据文档属性值在表中标记行
- node.js - AbortError:Redis 连接丢失并且命令中止。可能已经处理
- z3 - 调整 Z3 量词实例化的指南(使用 SMT-LIB 接口)