OK, this mail isn’t from John either, and it doesn’t even reference John’s code, but it’s useful info that I’ve needed on more than one occation.
The difficulty is that the fMRI interface doesn’t querry about masking; this email spells out how to overcome this.
Subject: Re: explicit masking From: Stefan Kiebel <email@example.com> Date: Tue, 27 Jun 2000 11:43:52 +0100 To: "Kevin J. Black" <firstname.lastname@example.org>, SPM <email@example.com> Dear Kevin, > Is it possible to instruct spm99 to search all voxels within a given > mask image rather than all above a fixed or a %mean threshold? Yes, with SPM99 it's possible to use several masking options. To recap, there are 3 sorts of masks used in SPM99: 1. an analysis threshold 2. implicit masking 3. explicit masking 1: One can set this threshold for each image to -Inf to switch off this threshold. 2: If the image allows this, NaN at a voxel position masks this voxel from the statistics, otherwise the mask value is zero (and the user can choose, whether implicit masking should be used at all). 3: Use mask image file(s), where NaN (when image format allows this) or a non-positive value masks a voxel. On top of this, SPM automatically removes any voxels with constant values over time. So what you want is an analysis, where one only applies an explicit mask. In SPM99 for PET, you can do this by going for the Full Monty and choosing -Inf for the implicit mask and no 0-thresholding. Specify one or more mask images. (You could also define a new model structure, controlling the way SPM for PET asks questions). With fMRI data/models, SPM99 is fully capable of doing explicit masking, but the user interface for fMRI doesn't ask for it. One way to do this type of masking anyway is to specify your model, choose 'estimate later' and modify (in matlab) the resulting SPMcfg.mat file. (see spm_spm.m lines 27 - 39 and 688 - 713). 1. Load the SPMcfg.mat file, set the xM.TH values all to -Inf, set xM.I to 0 (in case that you have an image format not allowing NaN). 2. Set xM.VM to a vector of structures, where each structure element is the output of spm_vol. For instance: xM.VM = spm_vol('Maskimage'); 3. Finally, save by save SPMcfg xM -append > If so, does the program define a voxel to be used as one which has > nonzero value in the named mask image? Not nonzero, but any positive value and unequal NaN. Note that you can specify more than one mask image, where the resulting mask is then the intersection of all mask images. Stefan