dear FSL users:
I used "save_awv()" matlab function in FSL to save NIFTI data, but couldn't save the data correctly. My codes is listed below:
[tmcourse, spmap, trow, tcol, srow, scol]=reshapeic(icapath); % reshape the 4D NifTI data
tcoursename=strcat(icapath,''timecourse'');
smapname=strcat(icapath,''spatialmap'');
save_avw(spmap,smapname,''f'',[srow scol 0 0]);
save_avw(tmcourse,tcoursename,''f'',[trow tcol 0 0]);
Where "reshape()" is my self-developed function for reshaping the 4D NIFTI data into 2D matrix in matlab. "tmcourse" is the 2D time course matrix; "spmap" is 2D spatial IC matrix; "srow" and "scol" are size of rows and column of spatial IC matrix, and "trow" and "tcol" are size of rows and column for time course matrix, respectively.
I checked tmcourse and spmap in matlab after excuting my program, and they are correct. I checked srow, scol, trow and tcol, and they are correct too. When I was trying to save "tmcourse" into a new NIFTI data, it has no problem. But when I was trying to save spmap into a NIFTI data, only the first column of spmap was saved. I couldn't figure out what was happening. I used the same way for both, but it worked for time course saving and didn't work for spatial map saving. Can anyone give some suggestion/hint where I got it wrong?
Thanks a lot
Xuelin
|