Reply-To: | | [log in to unmask][log in to unmask]] Sent: Thursday, 6 September 2007 8:19 PM To: Stephen Duma Cc: [log in to unmask] Subject: Re: [SPM] Search Volume Size
Hi Stephen,
> the volume size SPM gives at the bottom of the results table > is different to the actual volume of the ROI
I've had a quick glance at the code, and can think of a couple of reasons why this might be the case... The relevant lines from spm_VOI.m are:
82 XYZmm = SPM.xVol.M(1:3,:)*[SPM.xVol.XYZ; ones(1, SPM.xVol.S)]; 117 XYZ = D.mat \ [XYZmm; ones(1, size(XYZmm, 2))]; 118 k = find(spm_sample_vol(D, XYZ(1,:), XYZ(2,:), XYZ(3,:),0) > 0); 122 xSPM.S = length(k);
where xSPM.S is the number of voxels, as reported by spm_list.m.
The first line finds the world/mm coordinates for all the voxels within the original analysis mask, which includes any explicit mask, and any absolute or relative thresholding that you specified before estimating the model, and also automatic masking out of any voxels where the data is constant over all scans. So this is one reason why your eventual search volume may not match that of your ROI -- namely, if your ROI includes voxels outside this analysis mask. This could lead to quite large discrepencies, if e.g. you had a ROI which included large amounts of non-GM and you'd used threshold-masking which excluded this. You didn't say how different your results were?
The second line above converts from world/mm space to the voxel space of the ROI image. The resulting voxel-space coordinates need not be integer voxel indices; spm_sample_vol will interpolate to the nearest neighbour (NN interpolation is specified by the final argument of 0). So if the voxel-dimensions or orientation of your ROI image don't exactly match that of your statistic image, then the volume in the statistic image which gets analysed may not match the volume of the ROI. This should (as far I as I can see) be a very small discrepency.
I would check these two options in reverse order: i.e. first use spm_check_orientations or similar to verify that your ROI and statistic images have the same dimensions etc. Then create a new mask image which is the intersection of your ROI mask and the analysis mask (saved as mask.img in the results directory) e.g. using imcalc with an expression of '(i1>0).*(i2>0)'. Then if you sum the voxels in this new image, e.g. with: vol = spm_vol('new_mask.img'(; img = spm_read_vols(vol); n = sum(img(:) > 0) hopefully that will match the volume reported by SVC in SPM.
Let me and the list know whether this explains your findings. Cheers, Ged.42_10Sep200717:21:[log in to unmask] |