Error using load_nii_hdr while using load_untouch_nii.m

Hi, I would like to load a nifti file on matlab r2020b with this command: load_untouch_nii('Subject_a.nii.gz')
But I got an error: Error using load_nii_hdr (line 32) Cannot find file "Subject_a.gz.nii".
I am wondering why the input file name has been changed from XXX.nii.gz to XXX.gz.nii

댓글 수: 2

I have tried to load the file by: load_untouch_nii('Subject_a.nii') after extracting 'Subject_a.nii' from 'Subject_a.nii.gz'.
The error has gone. But '.nii.gz' format worked properly months ago.
I got the same error, which is really odd. This worked fine yesterday.

댓글을 달려면 로그인하십시오.

답변 (2개)

芯怡 徐
芯怡 徐 2022년 4월 7일

0 개 추천

I tried to convert the string format using `str2mat` and the problem was solved.
帆
2023년 2월 23일

0 개 추천

Unlike in load_nii.m, it seems that there is no check for ".gz" files in load_untouch_nii. Maybe you can just modify the source code and manually add the ".gz" file check before loading.

카테고리

도움말 센터File Exchange에서 Environment and Settings에 대해 자세히 알아보기

질문:

2022년 3월 8일

댓글:

2024년 1월 4일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by