extract the time course

Dear developers and users,

I would like to extract each subject's time course for each voxel in a predefined mask,  but I have no idea how to do it.

Any suggestion?

I would be grateful for a feedback on this approach.

Best regards,

Feng

 

http://rfmri.org/node/1142   也许这个是答案?

Hi Feng,
You can do the following:

[AllVolume,VoxelSize,theImgFileList, Header] =rest_to4d(DataFile);
[nDim1 nDim2 nDim3 nDimTimePoints]=size(AllVolume);
[MaskData,MaskVox,MaskHead]=rest_readfile(MaskFile);

% Convert into 2D
AllVolume=reshape(AllVolume,[],nDimTimePoints)';
MaskDataOneDim=reshape(MaskData,1,[]);

TCYouWanted=AllVolume(:,find(MaskDataOneDim));



TCYouWanted is a 2D matrix you want. You can see similar codes in: https://github.com/Chaogan-Yan/DPARSF/blob/master/Subfunctions/y_DegreeCentrality.m

Best,

Chao-Gan

<

Hi Chao-Gan,

Thanks for your reply, and that really helps.

All the bests!

Feng