paniquebanique
paniquebanique

Reputation: 1

MATLAB R2022b cannot load .nii.gz (compressed neuroimaging) data

I've been trying to open compressed fMRI data (.nii.gz file) on MATLAB, using the load_nifti function.

EDIT-> I had initially tried to use the load_nii function, but MATLAB did not recognize this command and itself suggested using the load_nifti command instead. My version of MATLAB has not 3rd party toolboxes or apps installed - the load_nifti (formerly load_nii function) have been integrated within the image processing toolbox since R2017b.

I am using MATLAB on LINUX Ubuntu version 22

Since there are many subjects, I've made a root path function in order to access this data.

root_path = ['/media/megan2/VERBATIM HD/dHCP_data/sub-' subj '/' 'ses-' ses_id '/' task];

Where subj and ses_id are variables that change.

The workspace has the list of subj and ses_id in order to find the subject data.

The code I'm using to open the file:

phaseBP = load_nifti([root_path '/BP_demeaned_0.033-0.07Hz_sub-' subj '_' 'ses-' ses_id '_task-rest_desc-preproc_bold-cropped.nii.gz']);

Running the code gives me this:

cd /media/megan2/VERBATIM HD

zcat /media/megan2/VERBATIM HD/dHCP_data/sub-CC00852XX11/ses-28210/func/BP_demeaned_0.033-0.07Hz_sub-CC00852XX11_ses-28210_task-rest_desc-preproc_bold-cropped.nii.gz > /tmp/tpb5ca9cf4_93fd_45f1_abdf_a96530646c80.load_nifti.m.nii

ERROR: gzip: /media/megan2/VERBATIM.gz: No such file or directory
gzip: HD/dHCP_data/sub-CC00852XX11/ses-28210/func/BP_demeaned_0.033-0.07Hz_sub-CC00852XX11_ses-28210_task-rest_desc-preproc_bold-cropped.nii.gz: No such file or directory

This just displays an empty 0x0 matrix in the workspace.

Things I've already tried:

Upvotes: 0

Views: 321

Answers (0)

Related Questions