Print

Print


This will only work if the ROI image and data are in the same space. If they are not in the same space, then it will not work. 

Best Regards, 
Donald McLaren, PhD


On Mon, Oct 19, 2015 at 2:29 AM, Robin Shao <[log in to unmask]> wrote:
Dear SPM experts,

I have some ROI masks constructed from 2nd-level results and they are in mm dimension. I would like to use those ROIs to extract values from some first-level statistical maps like beta or con.maps. From reading previous posts I get that I need to convert mm dimension to voxel dimension, so I constructed the following matlab scripts (ultilizing the spm_read_vols and spm_get_data functions):

-------------------------------------------------------------------------------------------------------------------

Y = spm_read_vols(spm_vol(ROI_path),1); 
indx = find(Y>0);
[x,y,z] = ind2sub(size(Y),indx);

XYZ = [x y z]';  %%%%% To get the coordinates of the ROI in voxel dimension


Extracted_data = mean(spm_get_data(Image_path, XYZ),2);  %%%%%% to extract data from the statistical maps on those coordinates

--------------------------------------------------------------------------------------------------------------------

The resultant data look reasonable, however I just want to make sure the approach is correct. Could anyone advise?

Many thanks in advance.

Robin