
Mesoscopy is an open-source package for the analysis of mesoscale calcium recordings. It handles the preprocessing of mesoscale recording files to extract ∆F responses, the anatomical registration of recordings to the Allen Brain atlas as well as analysis of recordings captured at rest or with behaviour.
Mesoscopy works best with data acquired in the NWB format. Alternatively, recordings acquired as HDF5 files compatible with mesoscopy’s raw data schema may be used.
Dual-channel recordings with an accompanying haemodynamic response channel (e.g. using both 470nm and 405nm excitation for GCaMP) will be automatically separated during preprocessing and yield a corrected ∆F signal.
An example acquisition script (designed for FLIR Grasshopper cameras) can be found here.
The recommended way to install mesoscopy is by using pipx (https://pypa.github.io/pipx/). pipx will create an isolated python environment from which mesoscopy will run, leaving the system python alone. This is the recommended way to install mesoscopy, as it will not interfere with any other python packages you may have installed on your system.
pipx.
On Ubuntu / Debian:
sudo apt update
sudo apt install pipx
pipx ensurepath
sudo pipx ensurepath
On Fedora:
sudo dnf install pipx
pipx ensurepath
sudo pipx ensurepath
For other distributions, install pipx with pip:
python3 -m pip install --user pipx
python3 -m pipx ensurepath
sudo pipx ensurepath
Install mesoscopy.
pipx install mesoscopy
Install pipx with homebrew.
brew install pipx
pipx ensurepath
sudo pipx ensurepath
Install mesoscopy.
pipx install mesoscopy
With Windows, you have two choices. You can either use mesoscopy with the Windows Subsystem for Linux (WSL) and follow the instructions above for installing mesoscopy on Linux (recommended), or you can run mesoscopy directly on Windows via PowerShell. The choice is of course yours, but you should bear in mind that mesoscopy primarily targets Unix-like OSs (Linux & MacOS) at the moment, so while everything should work fine on Windows, your milage may vary.
To install mesoscopy directly on Windows, first install pipx using Scoop:
scoop install pipx
pipx ensurepath
Then install mesoscopy via pipx:
pipx install mesoscopy
Our typical workflow guide will take you through the typical processing steps for analysing mesoscale recordings with mesoscopy.
You should also check out our how to guides for a deeper dive into individual aspects of analysis, including quality control. If you’re about to start acquiring data, or wish to convert existing data to a format compatible with mesoscopy, check out our data schema and converting videos to HDF5 guides.