MATLAB code to read 4D rsfMRI

Submitted by FaezeVedaei on

Hi

I am just trying to write my own MATLAB code to do some part of preprocessing. I need to conver the list of 4D rsfMRI data to 3D. In fact I have 5 subject data in the list and each one has 450 timepoints rsfMRI. I want MATLAB read each 450 timepoints and average them together and give a 3D data for each subject.

Can you please help me to prepare this part? I really appreciate that.

Regards

Faeze

YAN Chao-Gan

Fri, 04/24/2020 - 08:53

Probably something like this:

[Data, VoxelSize, FileList, Header] = y_ReadAll('XXXXXXXX.nii');

DataNew = mean(Data,4);

y_Write(DataNew,Header,'ProcessedData.nii');

Forums