Yes. They are in the same space.

To check the space, the images should have the same hdr.mat.

hdr=spm_vol(image);


Best Regards, 
Donald McLaren, PhD


On Tue, Oct 20, 2015 at 6:29 AM, Robin Shao <[log in to unmask]> wrote:
Dear Donald,

Thanks for your answer. When I defined the image space for my ROI, I used the same space as the 'mask' file in my 2nd-level analysis, which I expect should be in MNI space? I am extracting values from 1st-level beta maps. Given 1st-level is carried out after normalization, I expect the beta maps should be in MNI space too? Using the spm_read_vols function I get N coordinate values which also matched the size of the activation clusters from which the ROI was extracted. When I used display to check the ROI and the 1st-level beta map, they are of the same dimension too (61 * 73 * 61).

Can I then safely conclude they are in the same space? Or is there a way that I can directly check which space they are in?

Thanks again.

Robin




Date: Mon, 19 Oct 2015 23:37:12 -0400
From: [log in to unmask]
Subject: Re: [SPM] Statistical map value extration
To: [log in to unmask]


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