Why does a specific nifti image cannot be unzipped when using niftiread? Tmpdir needs write permission and sufficient free space.
Ältere Kommentare anzeigen
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 Kommentar
Walter Roberson
am 6 Nov. 2023
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
Akzeptierte Antwort
Weitere Antworten (1)
Ricardo Alonso
am 6 Apr. 2024
1 Stimme
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.
Kategorien
Mehr zu Simulink finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!