Background: Functional magnetic resonance imaging (fMRI) is a technique that has caught the attention of scientists since its appearance over thirty years ago. This tool allows for analyzing human brain activity through a sequence of magnetic resonance (MR) images. One important stage in the application of the fMRI technique is the statistical analysis of the sequence of post-processed images. The General Linear Model (GLM) is perhaps the most common statistical model applied for task-based fMRI analysis. However, in the majority of applications where this model is used, the spatiotemporal structures usually present in this type of data are commonly ignored. Thus, in the package introduced in this article, we have implemented a statistical method based on Matrix-Variate Dynamic Linear Models (MDLM) that allows taking into account the spatiotemporal structures in the modeling of task-based fMRI data.
Results: The BayesDLMfMRI package performs statistical analysis for task-based fMRI data at both individual and group levels. The analysis to detect brain activation at the individual level is based on modeling the fMRI signal using MDLM. The analysis for the group stage is based on posterior distributions of the state parameter obtained from the modeling at the individual level. In this way, this package offers several R functions with different algorithms to perform inference on the state parameter to assess brain activation for both individual and group stages. Those functions allow for parallel computation when the analysis is performed for the entire brain as well as analysis at specific voxels when it is required.
Conclusions: In summary, we present a software implementation of a well-tested statistical method for task-based fMRI analysis that would complement analysis performed with more popular packages such as FSL and SPM.