Skip to content

ln2t/connectomix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License

Connectomix: Functional Connectivity from fMRIPrep Outputs Using BIDS Structure

Overview

Connectomix is a BIDS app designed to compute functional connectomes from fMRI data preprocessed with fMRIPrep. It facilitates both participant-level and group-level analyses using various methods for defining regions of interest (ROIs) and computing connectivity measures. Connectomix leverages the Brain Imaging Data Structure (BIDS) to organize data and outputs, ensuring compatibility with existing neuroimaging workflows.

Key features include:

  • Extraction of time series data from preprocessed fMRI data, with flexible denoising strategies.
  • Computation of functional connectivity matrices using methods like atlas-based parcellation, seed-based analysis, and Independent Component Analysis (ICA).
  • Support for multiple connectivity measures (e.g., correlation, partial correlation).
  • Generation of group-level statistical comparisons, including permutation testing.
  • Automatic generation of default configuration files tailored to your dataset.
  • BIDS-compliant outputs for seamless integration with other neuroimaging tools.
  • An Autonomous mode where paths and configuration are guessed before launching the analysis, without any other input required.
  • Report generation containing summary of the findings at group-level.

Installation

Docker Installation

You can run Connectomix using Docker, which encapsulates the application along with all its dependencies in a container. This method ensures a consistent environment without the need to manually install Python packages or manage dependencies. Of course, you must install docker by yourself beforehand, e.g. following this link Docker Installation.

Pulling the Docker Image

A pre-built Docker image is available on Docker Hub. Pull the image using the following command:

sudo docker pull arovai/connectomix

Running Connectomix with Docker

To execute Connectomix using Docker, use the following command structure:

sudo docker run --rm -it \
    -v /path/to/bids_dataset:/bids_dataset:ro \
    -v /path/to/derivatives:/derivatives \
    arovai/connectomix \
    /bids_dataset /derivatives participant
  • Mounting Volumes:
    • -v /path/to/bids_dataset:/bids_dataset:ro mounts your BIDS dataset directory into the container at /bids_dataset as read-only (ro).
    • -v /path/to/derivatives:/derivatives mounts your derivatives directory where outputs will be written.
  • Command Arguments:
    • /bids_dataset and /derivatives are the paths inside the container (as defined by the -v options) for the BIDS dataset and derivatives directory, respectively.
    • participant specifies the analysis level.
    • --fmriprep_dir /bids_dataset/derivatives/fmriprep tells Connectomix where to find the fMRIPrep outputs inside the container.

Notes:

  • Adjusting for Group-Level Analysis: To perform a group-level analysis, change the analysis level to group and provide the necessary configuration:

    sudo docker run --rm -it \
        -v /path/to/bids_dataset:/bids_dataset:ro \
        -v /path/to/derivatives:/derivatives \
        arovai/connectomix \
        /bids_dataset /derivatives group --config /derivatives/config/group_config.yaml

    Ensure that your configuration file is accessible within the container. If it's stored in the derivatives directory, as in the example above, it will be available at /derivatives/config/group_config.yaml inside the container.

  • Autonomous mode with Docker: the autonomous mode (see below) needs to get access to the current directory. To do that using docker, you must specify use -w option as follows:

    sudo docker run --rm -it -v $(pwd):/data -w /data arovai/connectomix --autonomous

For more information on Docker and managing containers, visit the Docker Documentation.

Python Installations

Connectomix requires Python 3 and several Python packages. Install the necessary dependencies using pip:

pip install nibabel nilearn pandas numpy matplotlib scipy statsmodels bids yaml

Alternatively, you can use a virtual environment or conda environment to manage dependencies:

conda create -n connectomix_env python=3.8
conda activate connectomix_env
pip install nibabel nilearn pandas numpy matplotlib scipy statsmodels bids yaml

Usage

Connectomix can be executed from the command line with the following syntax:

python connectomix.py bids_dir derivatives_dir analysis_level [options]
  • bids_dir: The root directory of the BIDS dataset.
  • derivatives_dir: The directory where outputs will be stored.
  • analysis_level: The analysis level to run. Choose between participant or group.

Command-Line Arguments

  • --fmri