The Stat4Ci Matlab Toolbox

        The Stat4Ci Matlab toolbox performs all the computations necessary for the application of the Pixel and Cluster statistical tests to classification images. Both these tests were derived from Random Field Theory. Adler (1981) and Worsley (1994, 1995a, 1995b, 1996) have shown how the probability of observing a cluster of elements exceeding a threshold t for a random field produced by a known statistical law -- p(Z >= t) – is well-approximated by the expected Euler Characteristic (EC) of this random field. The EC basically counts the number of local maxima contained in the data. With high t thresholds, the EC approaches zero, and the expected EC is a good approximation of the probability of observing one or more clusters at that threshold t.

        The Pixel test computes a statistical threshold based on the probability of observing a single pixel above the threshold. This test has been shown to be best suited for detecting focal signals with high Z
-scores (Poline, Worsley, Evans & Friston 1997). But if the region of interest in the search space (the mouth in a face for example) is wide, it has usually a lower Z-score and cannot be detected. We could improve detection by applying more smoothing to the image. The amount of smoothing will depend on the extent of the features we wish to detect (Matched Filter Theorem), but we do not know this in advance.

    Friston, Worsley, Frackowiak, Mazziotta and Evans (1994) proposed an alternative to the Pixel test in order to improve the detection of wide signals with low Z-scores (see Poline et al, 1997, for a review). The idea is to set a low threshold (typically t >= 2.5) and base the test on the size of clusters of connected pixels above the threshold. The Cluster test is based on the probability that, above a threshold t, a cluster of size K (or more) pixels has occurred by chance (Cao & Worsley, 2001; Friston et al, 1994).

    A mere four pieces of information are required for the computation of the significant regions using the Pixel and the Cluster tests: a desired p-value, a threshold t (only used for the Cluster test), a search space, and the FWHM – or, equivalently, the sigma – of the Gaussian kernel used to smooth the classification image. The main function from the Stat4Ci Matlab toolbox – StatThresh.m – inputs this information together with a suitably prepared classification image (i.e., smoothed and Z-transformed), performs all the computations described above, and outputs a threshold for the Pixel test as well as the minimum size of a significant cluster for the Cluster test. The StatThresh.m function makes extensive use of the stat_threshold.m function, which was originally written by Keith Worsley for the fmristat toolbox.
 
        Other functions included in the Stat4Ci toolbox accomplish a variety of related computations: e.g., readCid.m reads a Classification Image Data (CID) file; BuildCi.m constructs classification images from a CID file;
SmoothCi.m smoothes a 2D classification image; ExpectedSCi.m computes the expected mean and standard deviation of a smooth classification image; ZTransSCi.m Z Z-transforms a smooth classification image; DisplayRes.m isplays the results of the Pixel and Cluster tests. All of these functions include thorough help sections.

        The DemoStat4Ci.m script illustrates the usage of the various Stat2Ci functions on two classification images from Gosselin and Schyns (2001), ExnexFG.tiff and GenderFG.tiff, within the search space defined by faceMask.tiff. Figure 1 shows the outcome of the analysis. Red pixels indicate the regions that attained statistical significance. For the Cluster test, only the clusters larger than the minimum size are displayed. A face (w1H.JPG) was overlaid to facilitate interpretation.


Figure 1. Two of Gosselin and Schyns' (
2001) classification images re-analyzed using the Stat4Ci Matlab toolbox.

The Stat4Ci toolbox is entirely free; if you use it in your research, please, cite us: Chauvin A., Worsley, K.J., Schyns, P.G., Arguin, M. & Gosselin, F. (in press). Accurate statistical tests for smooth classification images. Journal of Vision. [pdf]

Compressed version of the toolbox :