hyemin-han / BayesFactorFMRI

BayesFactorFMRI is a tool developed with R and Python to allow neuroimaging researchers to conduct Bayesian second-level analysis of fMRI data and Bayesian meta-analysis of fMRI images with multiprocessing.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BayesFactorFMRI

Please refer to and cite these articles when you use BayesFactorFMRI:
0. Han, H. (2021). BayesFactorFMRI: Implementing Bayesian second-level fMRI analysis with multiple comparison correction and Bayesian meta-analysis of fMRI images with multiprocessing. Journal of Open Research Software, 9(1), 1. http://doi.org/10.5334/jors.328 https://bit.ly/36wV3HV
Based on the specific functionality that you intend to use:

  1. Bayesian multiple comparison correction: Han, H. (2020). Implementation of Bayesian multiple comparison correction in the second-level analysis of fMRI data: With pilot analyses of simulation and real fMRI datasets based on voxelwise inference. Cognitive Neuroscience, 11(3), 157-169. http://bit.ly/2S6Uka2
  2. Bayesian meta-analysis: Han, H., & Park, J. (2019). Bayesian meta-analysis of fMRI image data. Cognitive Neuroscience, 10(2), 66-76. http://bit.ly/2RCbxZY

BayesFactorFMRI provides a GUI to

  1. Bayesian 2nd-level analysis of fMRI data with multiple comparison correction and
  2. Bayesian meta-analysis of fMRI studies.

To test this tool, R (>= 3.5) and Python (>= 3.7.3; Python 3.8 is not recommended due to package-related issues at this point) are required. Plus, these additional packages should be installed:

R: BayesFactor, metaBMA, oro.nifti

Python: tkinter (for GUI), shutil, pandas, nibabel, rpy2, subprocess, numpy, nilearn (os, math, atexit, glob)

To install dependencies:

  1. R packages

    In the R console, execute:

    install.packages('BayesFactor')

    install.packages('metaBMA')

    install.packages('oro.nifti') A quick note on 11/24/21: please install the most up-to-date oro.nift, 0.11.0 (as of 11/24/21), to avoid any bug during the result image creation process.

  2. Python packages

    To install the following Python packages, execute the following command at the terminal:

    pip (or pip3) install shutil

    pip (or pip3) install pandas

    pip (or pip3) install nibabel

    pip (or pip3) install rpy2

    pip (or pip3) install subprocess

    pip (or pip3) install numpy

    pip (or pip3) install -U --user nilearn (for further details, refer to https://nilearn.github.io/introduction.html#installing-nilearn)

After installing all required dependencies, follow directions below:

  1. Download contents (codes and etc.) in V1.0.0.
  2. Download tutorial images files in the designated subfolder(s) (i.e. /Correction for (1) and /Meta for (2)).
  3. Run bayes_select_ui.py with Python to start either correction_ui or bmeta_ui. At the terminal, execute: python (or python3) bayes_select_ui.py
  4. Follow the directions provided with the GUI.

At the last stage, you will decide either to run the analysis locally or on a cluster. Once you decide to run the analysis locally, then GUI will call Python and R automatically at the end of the process. If you choose to run the analysis on a cluster, the GUI will end. You have to upload created files (including both codes, image files, etc.) to a cluster and run run_this.py. These files will be created in a working directory that you specify in GUI. In this process, you may need to write additional code(s) to run run_this.py on the cluster (e.g., slurm batch including "python (or python3) run_this.py").

In order to see how to perform Bayesian second-level analysis and meta-analysis with tutorial datasets, please refer to one of these:

GUI directions for Bayesian second-level analysis (Tutorial)

GUI directions for Bayesian meta-analysis (Tutorial)

Contact and support Any bugs, errors, questions, or suggestions associated with BayesFactorFMRI can be submitted via the “Issues” tab in the GitHub repository. Furthermore, the author, Hyemin Han, can be contacted via email for support.

About

BayesFactorFMRI is a tool developed with R and Python to allow neuroimaging researchers to conduct Bayesian second-level analysis of fMRI data and Bayesian meta-analysis of fMRI images with multiprocessing.

License:MIT License


Languages

Language:Python 72.6%Language:R 27.4%