【问题标题】:How to use ImageDataGenerator with nii/NIFTI files using ADNI dataset如何使用 ADNI 数据集将 ImageDataGenerator 与 nii/NIFTI 文件一起使用
【发布时间】:2019-06-24 20:40:57
【问题描述】:

我正在尝试使用 keras 的 ImageDataGenerator 类加载我的数据,但我遇到了麻烦,因为图像文件不是标准的 jpeg/png 图像文件,而是 nii.gz 文件。我找到了这个 github repo https://github.com/sremedios/nifti_image_generator/blob/master/utils/nifti_image.py 但输出的尺寸不匹配并且

train_generator.next()

抛出一个错误

ValueError: could not broadcast input array from shape (233,189) into shape (197,233,189,1)

【问题讨论】:

  • 当你读入你的 nifti 数据时,数据是什么形状的? print(data.shape)
  • 197x233x189

标签: image keras computer-vision nifti mri


【解决方案1】:

为了使用 Nii 文件,这是 MR、CT 等医学图像的标准格式。 您必须使用nibabel 库来读取医学影像数据集。
DLTK 库也可从 Google 获得,用于医学成像。

【讨论】:

    猜你喜欢
    • 2018-01-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-06
    • 1970-01-01
    • 2021-04-20
    相关资源
    最近更新 更多