Why does a specific nifti image cannot be unzipped when using niftiread? Tmpdir needs write permission and sufficient free space.
19 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I was using niftiread to load a .nii.gz file. It worked fine perfectly fine for other files except this one. It showed error message
"Error using images.internal.nifti.niftiFile/getUncompressedFileName (line 136)
Cannot unzip file. tempdir needs write permissions and sufficient free space.
Error in images.internal.nifti.niftiFile (line 45)
[filename, self.TempfileCleaners, ~] = self.getUncompressedFileName(firstFile);
Error in niftiread (line 66)
NF = images.internal.nifti.niftiFile(varargin{:});"
I used MATLAB2021b.
I had a few attempts:
1. Double checked the path and the file name. They are correct.
2. Use setenv() to change tempdir to my home directory, which I am sure I have the write permission and enough space. But it did not solve this problem.
3. I am able to open this image using image viewing tool (MRIcron, etc). But I cannot unzip it manually using 7zip.
This issue happened before, and I cannot figure it out all the times. If anyone can help me with it, I would highly appreciate it!
1 件のコメント
Walter Roberson
2023 年 11 月 6 日
Are you using linux? If so see the discussion at https://www.mathworks.com/matlabcentral/answers/1798895-invalid-cross-device-link-18-when-saving-a-file-on-arch-linux?s_tid=srchtitle
採用された回答
Neha
2023 年 11 月 14 日
Hi Tongyao,
I understand that you are facing an error while using the "niftiread" function while loading a .nii.gz file. Since you have already confirmed that the file name and path are correct and that there are no permission or space related issues, you can try implementing the solution explained in the comments for this MATLAB Answer:
Hope this helps!
0 件のコメント
その他の回答 (1 件)
Ricardo Alonso
2024 年 4 月 6 日
Hello. This just happened to me.
In my case it was because the file wasn't really a compressed one, but uncompressed (.nii) that I copied with the wrong extension (.nii.gz).
Change its extension to .nii and try again.
I suspect this is your case because of your 3d point.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で 3-D Volumetric Image Processing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!