Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The TAPAS PhysIO Toolbox for Physiological Noise Modeling in fMRI #71

Open
5 of 18 tasks
mrikasper opened this issue Dec 1, 2023 · 5 comments
Open
5 of 18 tasks

Comments

@mrikasper
Copy link
Contributor

mrikasper commented Dec 1, 2023

Title

The TAPAS PhysIO Toolbox for Physiological Noise Modeling in fMRI

Leaders

Collaborators

Brainhack Global 2023 Event

BrainHack Toronto

Project Description

TL;DR: Watch the videos on PhysIO and MACS to learn about these 2 toolboxes that we are trying to integrate and make more accessible in this Hackathon.

The PhysIO Toolbox offers model-based physiological noise correction for functional MRI (fMRI) data, based on peripheral physiological recordings, such as cardiac and respiratory traces (ECG, pulse oximeter, breathing belt). Major noise models, such as RETROICOR, respiratory volume per time (RVT) or heart-rate variability (HRV) modulations of BOLD are supported.

PhysIO is written in Matlab, but also offered as standalone version via a containerized solution (Neurodesk) or web-based processing interface (CBRAIN). Through its integration as a toolbox in SPM, it both offers interactive operation via the Batch Editor GUI, as well as batch execution within fMRI preprocessing pipelines.

Through its more than 10 years of development as part of the Translational Algorithms for Psychiatry-Advancing Science (TAPAS) Software Package, PhysIO has seen many improvements and new releases, but user requests for new features always outnumber our core developer capacity.

In this Brainhack, we would like to add two of the most highly-desired features to PhysIO:

  1. Finding the best physiological noise model for your data using MACS
  2. Creating an interactive tutorial of PhysIO in action using Matlab Online and open datasets, for example based on this prototype code

If you want to start small, there is also a user wish list of changes to the interface and documentation that we would be happy to see implemented.

Link to project repository/sources

Goals for Brainhack Global

All of the following goals are equally worthwhile. We will base our prioritization on user interest and expertise:

  1. Model Selection of the best Physiological noise model for your data (tracked in this issue)
  • With the large variety of physiological noise models and parameters offered by PhysIO, a common question for users is which model is right for their data.
  • Overly simplistic models might not remove noise effectively, overly complex models, on the other hand, might reduce your sensitivity to detect fMRI activation by removing degrees of freedom in your task model or signal correlated to your task.
  • Bayesian model selection is a formal way to compare different modeling choices and select the best model for your data.
  • MACS (Model Assessment, Comparison and Selection) is an SPM toolbox offering Bayesian Model Selection for the general linear models (GLMs) used in fMRI analysis.
  • In this milestone, we want to complete the following:
    • Identify a suitable multi-subject open fMRI dataset (e.g., on OpenNeuro) with peripheral recordings
    • Run different physiological noise models (GLMs) on multiple subjects
    • Assess the GLMs for single subjects and the group via MACS
    • Perform model comparison for a couple of typical models (RETROICOR different orders, plus RVT, plus HRV, different delays RVT/HRV delays)
    • Write a programmatic interface within PhysIO to call MACS for model assessment/selection
    • Write a batch editor interface for PhysIO model assessment using MACS
  1. Interactive Online Tutorial of the PhysIO pipeline with openly available fMRI data (tracked in this issue)
  • We have created a prototype of this effort using "Matlab Online".
  • There are some barriers to make it a great user experience for your first contact with the PhysIO Toolbox, in particular
    • the slow initialization because of downloading git submodules from GitHub (including SPM)
    • the choice of appropriate (good physiological recordings) and small open fMRI datasets, e.g., from OpenNeuro
  1. Fulfilling some PhysIO users' long-standing small, but impactful feature requests from the wish list, such as
    • A consistent interface for multiband fMRI data (this issue)
    • A direct read-in of BIDS scan timing data from .json sidecar files, similar to the CBRAIN implementation
    • Exporting preprocessed physiological traces and derived measures (heart-rate variability, respiratory volume per time) at base resolution before physiological modeling (this issue)

Good first issues

  • A consistent interface for multiband fMRI data (this issue) and this possible solution
  • the choice of an appropriate (good physiological recordings) and small open fMRI dataset for the PhysIO-Live Demo (single subject) and the Model Selection goal, e.g., from OpenNeuro

Communication channels

https://mattermost.brainhack.org/brainhack/channels/physio

Skills

  • Matlab: basic (running scripts, navigating the Matlab environment) to advanced (unit testing)
  • SPM: none to advanced (Navigating the SPM Results and CheckReg Tools, Batch Editor Programming, Setting up multiple processing pipelines)
  • Functional MRI Analysis: basic (GLM) to advanced (Model Comparison, Model Evidence, Bayes factor)
  • Open Data Standards/Repositories: BIDS and OpenNeuro

Onboarding documentation

What will participants learn?

  • Basics of physiological noise correction in fMRI (RETROICOR, RVT, HRV)
  • Basics of model comparison/model selection
  • Using PhysIO as a Matlab script, in a GUI, at the Batch Editor Level with SPM
  • Using Matlab Online with open-source code and data repositories

Data to use

TBD (it's one of the tasks)

Number of collaborators

4

Credit to collaborators

As outlined in our TAPAS CONTRIBUTING document, new members shall add themselves to the Contributor License Agreement alongside their first pull request contribution to the TAPAS PhysIO Code. This document is also referenced in the PhysIO README.

Image

AvatarPhysIO

Type

documentation, method_development, pipeline_development, visualization

Development status

1_basic structure

Topic

bayesian_approaches, data_visualisation, MR_methodologies, physiology, statistical_modelling

Tools

BIDS, SPM

Programming language

documentation, Matlab

Modalities

fMRI

Git skills

1_commit_push

Anything else?

We aim at making the project development environment available via Matlab Online or standalone (browser- or container-based, no license required), but if there is specific expertise, we could also aim at full Octave-compatibility of the toolbox.

Things to do after the project is submitted and ready to review.

  • Add a comment below the main post of your issue saying: Hi @brainhackorg/project-monitors my project is ready!
  • Twitter-sized summary of your project pitch.
@mrikasper
Copy link
Contributor Author

Hi @brainhackorg/project-monitors my project is ready!

@mrikasper
Copy link
Contributor Author

mrikasper commented Dec 1, 2023

Twitter-sized summary of our project pitch:

Reduce noise to the MACS with PhysIO for fMRI: Ever overwhelmed by the vast selection of noise models in PhysIO for your fMRI data? Find the best model for your data in this project by integrating Bayesian model selection via the MACS toolbox into your PhysIO workflow.

@mrikasper
Copy link
Contributor Author

mrikasper commented Dec 13, 2023

Possible dataset to work on (see also this issue):

TODO:

  • Assess, whether DataLad interface speeds up access for Matlab Online
  • Download last subject (sub-46) and test whether it works with PhysIO, then basic SPM preprocessing (similar to this CUBRIC Demo), then MACS GLM

@mrikasper
Copy link
Contributor Author

Update: In the BrainHack23 Toronto, @likeajumprope and me managed to achieve the following:

  • Found a publicly available dataset on OpenNeuro to finally demonstrate a full processing pipeline,
  • Get PhysIO and a basic preprocessing pipeline running, up to the F-test statistical parametric maps that show where in the brain the noise models explain signal variance (see screenshot below)
  • All code is in a dedicated repository. now we can continue to try out the model comparison.

image

@JoramSoch
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment