when you say you tried to use the contrast as a mask, did you just use the raw contrast or did you binarize it? If you did the former than it is clear why you had no inmask voxels since any non-zero voxels would all be seen as part of the mask. So, what you want to do is load the mask, apply a threshold and binarize it by setting anything below the threshold to 0, and anything above to 1 (though the latter may not be completely necessary). Then, you could just use that mask to mask out the resulting contrast map from the other analysis. Here is code to do it:

%Make mask

V = spm_vol('contrast_image_2turn_into_mask')
Y = spm_read_vols(V);

threshold = X; %any value you choose.

Y(find(Y<threshold)) = 0;
Y(find(Y)) = 1;

% Use mask

VV = spm_vol('contrast_image_2mask');
YY = spm_vol(VV);

YY(find(Y)) = 0; %apply mask

VV.fname = 'masked_image.img';
spm_write_vol(VV,YY);

%% There ya go

Cheers,
Michael

On Sun, May 22, 2011 at 9:58 AM, SUBSCRIBE SPM Yihui Hung <[log in to unmask]> wrote:
Hello,

I used SPM8 for my experiment. I manipulated three factors (e.g., factor A, B, C) in my experiment. The activation maps under factor A was used as a mask to constrain the effects of factor B and factor C. The problem is that the factor A and factor B and factor C cannot be put in the same model at second level analysis. I tried to put the .img file resulting from factor A across participants in the “explicit mask” in the second level analysis. However, the estimation stopped by showing no inmask voxels. I searched through forum and did not find any useful solutions. Can someone help me out? Moreover, is the threshold masking related to the p value? If not, how should I set criteria for the activation map of the mask?

I did notice that one person in the forum suggested that one can create an activation maps in which the factor B is modeled with the mask of factor A in first level analysis. Then, submit the resulting .img file into second level analysis. My question is how to create and save the img file.

Finally, I posted a question regarding how to export beta values over multiple coordinates a week ago. However, no one provide any answers. I wonder whether it is due that no one has the answer or due to that there already is an answer in the forum.

Thank you for your patience and advice.
Sincerely,

Yihui




--
Research Associate
Gazzaley Lab
Department of Neurology
University of California, San Francisco