[ANN] Four new fMRI-related packages: CIFTI.jl, WatershedParcellation.jl, and more

Hi everyone, I’d like to announce four packages I’ve written that may be of interest to anyone working with surface-space representations of fMRI data in Julia.

First of all, there’s CIFTI.jl, a very basic and easy-to-use interface for reading and writing surface-space neuroimaging files of the CIFTI (Connectivity Informatics Technology Initiative) format.

Then the heavyweight package here is WatershedParcellation.jl. This package supplies a new implementation of a well-known method in the field, which is basically the application of the classic watershed image segmentation technique to the domain of surface-space fMRI. It’s based on the original MATLAB code from Evan Gordon and Tim Laumann from their 2016 paper “Generation and Evaluation of a Cortical Surface Area Parcellation.” The new implementation supplies these advantages:

  • very substantial speedups (probably less than 30 minutes total runtime, versus ~16 hours in the original MATLAB code)
  • better RAM usage so that it’s now feasible to run on a relatively modest hardware setup, or to run several instances in parallel in an HPC environment
  • easy to understand, flexible

And there are two more packages. Originally I just meant to make the WatershedParcellation code available in one big standalone package, but then when I started refactoring it for public use I realized that there were some pieces of it that could be really useful even outside of this specific application. That’s when I decided to branch things off into these two additional pacakges, which together provide the backbone for much of what WatershedParcellation does:

  • CorticalSurfaces.jl: A Julia package encapsulating the surface-space representation of the cerebral cortex
  • CorticalParcels.jl: A Julia package supplying abstractions and operations for efficiently working with parcels, or regions of interest, on a CorticalSurface

There’s one more package coming within the next couple of weeks, which will provide some GLMakie-based visualization utilities for all of the above. I’ve struggled to come up with a good name for it, though, so I welcome suggestions on that.

Thanks and I hope some people out there may find these packages useful.


Could you explain parcellation simply please?
Yeah… I should do a search.

Sure. A parcellation is basically just the segmentation of the brain into regions. It can be used as a dimensionality reduction technique, for example. There are many ways out there of doing that. WatershedParcellation.jl implements one particular well-known (in the field) method.

CorticalParcels.jl on the other hand provides more general-purpose tools for working with parcels/regions, irrespective of any particular parcellation method. It provides operations like rotation and resizing of regions, finding centroids, finding distances between regions, etc. You could even use these tools to build a new parcellation method, as I kind of demonstrate in WatershedParcellation.jl – because much of that is expressed just as a combination of those basic operations provided in CorticalParcels.jl.

Thankyou. I worked in medical imaging many years ago. The research group I was alongside at Kings was starting work on brain atlases. I guess the state of the art in that field has improved greatly due to early foundations.