gpt4 book ai didi

upload .nii files to kaggle(将.nii文件上传到Kaggle)

转载 作者:bug小助手 更新时间:2023-10-25 21:27:11 26 4
gpt4 key购买 nike



I am working on some mri images that have .nii.gz form, and their respective masks that are .nrrd type. I ziped the folders containing the images and the masks and uploaded them on kaggle. The masks work file, but the the notebook does not seem to recognize the patient files, but you can see them on the file explorer on the right of the notebook, as empty folders instead of files. My guess is that kaggle tries to unzip the .gz resulting in empty directories.

我正在处理一些mri图像,这些图像有. nii.gz格式,它们各自的掩码是.nrrd类型。我压缩了包含图像和面具的文件夹,并将它们上传到kaggle上。面罩工作文件,但笔记本似乎无法识别患者文件,但您可以在笔记本右侧的文件浏览器中看到它们,作为空文件夹而不是文件。我的猜测是kaggle试图解压缩.gz导致空目录。


here are the images in the file explore

这是文件浏览器中的图像


the images


and here you can see the masks

在这里你可以看到面具


the masks


when i copy file path for masks this works fine

当我复制掩码的文件路径时,这工作正常


os.path.isfile('/kaggle/input/arcin-data/resampled_masks/resampled_masks/segmentation101.nrrd')
True

but this prints out false

但这打印出的结果是错误的


os.path.isdir('/kaggle/input/arcin-data/Acrin_data/Acrin_data')
False

even thought I can see that the folder at least exists

即使我能看到文件夹至少是存在的


Finally, this is from the description of the dataset

最后,这来自对数据集的描述


enter image description here


更多回答

And what do you see when you do unzip -t file_to_upload.zip? are there any actual files in the ZIP?

当您将-t文件解压缩到_pload.zip时,您会看到什么?ZIP中有没有实际的文件?

优秀答案推荐

I found the answer, the problem was that .nii files are actually compressed, they were .nii.gz so kaggle thought they were separate directories and not the actual files, so it tried to decompress them but found nothing inside. I solved it by reading them locally and creating a new dataset with .pt files for the images and read them as such.

我找到了答案,问题是.nii文件实际上是压缩的,它们是.nii.gz,所以Kaggle认为它们是单独的目录,而不是实际的文件,所以它试图解压缩它们,但在里面什么也找不到。我通过在本地读取它们并使用.pt文件为图像创建一个新的数据集并按此方式读取它们来解决这个问题。


更多回答

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com