MICA-MNI / BrainStat

A statistics and context decoding toolbox for neuroimaging.
https://brainstat.readthedocs.io
Other
95 stars 22 forks source link

How can i set the contrast in SLM? #349

Closed Ashley95555 closed 1 month ago

Ashley95555 commented 7 months ago
zihuaihuai commented 1 month ago

Please refer to this section of the tutorial

Next, we must define a contrast in observations (here: age). With the model, contrast, and cortical thickness data, we can then assess whether there is an effect of age on cortical thickness. contrast_age = demographics.AGE_AT_SCAN; mask = fetch_mask('fsaverage5');

slm = SLM( ... model, ... contrast_age, ... 'surf', 'fsaverage5', ... 'correction', {'rft', 'fdr'}, ... 'cluster_threshold', 0.01, ... 'mask', mask); slm.fit(cortical_thickness);

Before we go any further, we can quickly assess the quality and robustness of the fitted model. We can do this for every vertex/parcel on the cortex (default), for one vertex (see example below for vertex #88), or for a set of specific vertices. Our function slm.qc outputs a histogram of the residuals and a qq plot of the residuals versus the theoretical quantile values from a normal distribution. We can also map vertexwise measures of skewness and kurtosis (characterizing the residuals distribution) across the cortex.

If anything is not clear or wrong in the tutorial, feel free to submit a new issue about tutorial, please.