Hello All, I am running into an odd problem when attempting to calculate volumes of masked ROI's in my VBM data. What I am trying to accomplish is a correlation between two different ROI's in my VBM data. Here's what I have done: 1) created an sphere ROI mask with a radius of 5 mm in DLPFC using the WFU_pickatlas util. 2) applied the mask using spm_mask to my smoothed and modulated vbm data. This gives me m* files. 3) use the script below that was provided on this list-serve to calculate volumes >function gl = get_integrals(P) >% Integrate the values in an image. >if nargin<1, > P = spm_get(Inf,'*.img'); >end; >V = spm_vol(P); >gl = zeros(length(V),1); >for i=1:length(gl), > for z=1:V(i).dim(3), > img = spm_slice_vol(V(i),spm_matrix([0 0 z]),V(i).dim(1:2),0); > gl(i) = gl(i) + sum(img(:)); > fprintf('.'); > end; > gl(i) = gl(i)*(det(V(i).mat)/100^3); > fprintf('\n'); >end; The result is "ans = NaN" This is baffling because when I run the scipt above on an unmasked data set I get the correct output. I can view the masked data using "Display" within SPM and everything looks good. Is there something that spm_masked does to the data to alter it in someway, beyond masking? Or Am I completely misguided in my technique of masking and attempting to extract the volume of an ROI. Thank you for your time, blaine