Skip to main content

Python Version PyPI Version License CI codecov Code style: Ruff pre-commit

Derotation

The derotation package offers a robust solution for reconstructing multiphoton movies of rotating samples acquired with a line scanning microscope.

On the left, the mean image of a 3-photon movie in which the sample was rotating. In the center, the mean image after derotation, and on the left the mean image of the derotated movie after suite2p registration. As you can see, already after derotation the cells are visible and have well defined shapes.

Quick Install

Install the latest stable release in a conda environment:

conda create -n derotation-env python=3.12
conda activate derotation-env
pip install derotation

Overview

To address certain neuroscience questions, it might be necessary to image the brain while the head of the animal rotates. In such a case, and even more when the frame rate is low, the acquired movies are distorted by the rotation. These distortions have a peculiar pattern due to the line scanning nature of the microscope, which can be corrected by the derotation package.

With derotation you can:

  • Recover calcium imaging movies by line-by-line derotation that can be fed into standard analysis pipelines such as suite2p
  • Estimate the center of rotation using Bayesian optimization
  • Validate improvements to the derotation algorithm and pipelines using synthetic data
  • Verify the quality of the derotation using debugging plotting tools
  • Batch-process multiple datasets with consistent configuration files

Data Source & Funding

Sample data used for examples and figures can be found on Gin.

All microscopy data has been acquired with a 3-photon microscope by Simon Weiler in the Margrie Lab as described by Cloves and Margrie.

This project was sponsored by the Margrie Lab in the Sainsbury Wellcome Centre for Neural Circuits and Behaviour at University College London.

References

Previous work on derotation of calcium imaging movies:

This package was inspired by previous MATLAB script on derotation.

Join the Development

Contributions to derotation are encouraged, whether to fix a bug, develop a new feature, or improve documentation. Get in touch through our Zulip chat.

Open an issue to report a bug or request a new feature.

Metadata

Release files for derotation 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for derotation 0.1.6
File Size Uploaded
derotation-0.1.6.tar.gz 43.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for derotation 0.1.6
File Interpreter ABI Platform
derotation-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 88.7 kB

Release files / derotation-0.1.6.tar.gz

Download URL derotation-0.1.6.tar.gz
Size 43.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f0e6401d8c6665277091eefa9b7289796274a36a2180a52c9a7037b866c33bd7
BLAKE2b-256 checksum
How to use checksums
ccc27863b5be3455ca18f608b20b87633bc0cb7d6d1e83b9d5b6a71240ba2ae4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / derotation-0.1.6-py3-none-any.whl

Download URL derotation-0.1.6-py3-none-any.whl
Size 45.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a6969361f34a6d0f8c23c27890f3c0682e4687f999943d944d5eda7ba8f5d30a
BLAKE2b-256 checksum
How to use checksums
ebcb0ec5f79d53c4c275cd11c702a095422895518ed6f6fa3790b3365127a9d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.1

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page