TFCE_vertex_analysis | R Documentation |
Fits a linear model with the cortical or hippocampal surface data as the predicted outcome, and returns t-stat and threshold-free cluster enhancement (TFCE) statistical maps for the selected contrast.
TFCE_vertex_analysis(
model,
contrast,
formula,
formula_dataset,
surf_data,
nperm = 100,
tail = 2,
nthread = 10,
smooth_FWHM,
VWR_check = TRUE
)
model |
An N X P data.frame object containing N rows for each subject and P columns for each predictor included in the model |
contrast |
A N x 1 numeric vector or object containing the values of the predictor of interest. Its length should equal the number of subjects in model (and can be a single column from model). The t-stat and TFCE maps will be estimated only for this predictor. |
formula |
An optional string or formula object describing the predictors to be fitted against the surface data, replacing the model, contrast, or random arguments. If this argument is used, the formula_dataset argument must also be provided.
|
formula_dataset |
An optional data.frame object containing the independent variables to be used with the formula (the IV names in the formula must match their column names in the dataset). |
surf_data |
A N x V matrix object containing the surface data (N row for each subject, V for each vertex), in fsaverage5 (20484 vertices), fsaverage6 (81924 vertices), fslr32k (64984 vertices) or hippocampal (14524 vertices) space. See also Hipvextract(), SURFvextract() or FSLRvextract output formats. Alternatively, a string object containing the path to the surface object (.rds file) outputted by extraction functions may be given. |
nperm |
A numeric integer object specifying the number of permutations generated for the subsequent thresholding procedures (default = 100) |
tail |
A numeric integer object specifying whether to test a one-sided positive (1), one-sided negative (-1) or two-sided (2) hypothesis |
nthread |
A numeric integer object specifying the number of CPU threads to allocate |
smooth_FWHM |
A numeric vector object specifying the desired smoothing width in mm. It should not be specified if the surf_data has been smoothed previously with smooth_surf(), because this result in surf_data being smoothed twice. |
VWR_check |
A boolean object specifying whether to check and validate system requirements. Default is TRUE. |
This TFCE method is adapted from the 'Nilearn' Python library.
A list object containing the t-stat and the TFCE statistical maps which can then be subsequently thresholded using TFCE_threshold()
RFT_vertex_analysis
, TFCE_vertex_analysis_mixed
, TFCE_threshold
demodata = readRDS(system.file('demo_data/SPRENG_behdata_site1.rds',
package = 'VertexWiseR'))[1:5,]
CTv = readRDS(file = url(paste0("https://github.com",
"/CogBrainHealthLab/VertexWiseR/blob/main/inst/demo_data/",
"SPRENG_CTv_site1.rds?raw=TRUE")))[1:5,]
TFCEpos=TFCE_vertex_analysis(model=demodata[,c("sex","age")],
contrast=demodata[,"age"], surf_data=CTv, tail=1,
nperm=5, nthread = 2, VWR_check=FALSE)
#To threshold the results, you may then run:
#results=TFCE_threshold(TFCEpos, p=0.05, atlas=1)
#results$cluster_level_results
#Formula alternative:
#formula= as.formula("~ age + sex")
#TFCEpos=TFCE_vertex_analysis(formula=formula,
#formula_dataset=demodata, surf_data=CTv, tail=1,
#nperm=5, nthread = 2, VWR_check=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.