Skip to main content

twopy

Two-photon imaging analysis tool for the Clark Lab output format.

twopy napari interface

Getting Started

twopy lets you open two-photon recordings, draw ROIs, plot responses in real time, process and analyze them, and save them.

When you first load a recording, twopy converts it to HDF5 files that it owns. These files contain the aligned movie, mean image, stimulus tables, photodiode signals, and recording metadata. Analysis and the GUI use only the converted files. Thus, the original source files stay separate from twopy outputs. By default, twopy uses ~/.cache/twopy/recordings as a local cache. When you save ROIs and analysis, twopy copies changed files to analysis_output in the background.

Install

Examples use micromamba, but any conda-compatible environment manager should work.

micromamba create -n twopy -c conda-forge python=3.13 pip -y
micromamba run -n twopy python -m pip install twopy

Verify the install:

micromamba run -n twopy python -c 'import twopy; print(twopy.__name__)'

Create the config template in your user folder:

twopy config setup

twopy prints the config path that it wrote. The default path on macOS and Linux is ~/.config/twopy/config.yml. On Windows, the path is under %APPDATA%\twopy\config.yml. Before you start twopy, add your database, data, and output paths to that file. If the config does not exist, twopy creates the template and prints its path. Then, twopy stops so you can edit it.

Validate the active config and show its path and file contents:

twopy config

Start

micromamba activate twopy
twopy

twopy validates the config before opening napari. It does not require lab data folders or network drives to be mounted at launch.

Open a source recording or converted recording directly:

twopy /path/to/source/recording
twopy /path/to/recording_data.h5

Basic GUI flow:

  1. Search the database or load a recording manually.
  2. Draw or edit ROIs in the rois Labels layer.
  3. Update response plots from the current ROIs.
  4. Click Save ROIs + analysis in Export when the plots look right.

When a source recording has not been converted yet, twopy converts it first. Converted data includes the aligned movie, mean image, stimulus tables, photodiode signals, and recording metadata.

Docs

Check

micromamba run -n twopy pre-commit run --all-files

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

twopy-0.4.1.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

twopy-0.4.1-py3-none-any.whl (1.5 MB view details)

Uploaded Python 3

File details

Details for the file twopy-0.4.1.tar.gz.

File metadata

  • Download URL: twopy-0.4.1.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for twopy-0.4.1.tar.gz
Algorithm Hash digest
SHA256 0181078ea0bd78fbf4b3fa64932cc2b837b5496a463b58529330021525772df2
MD5 5733b3566410f611cc88ad2b62a4e949
BLAKE2b-256 8c7d5e5ab4bec6198ea30f39055367928c3219391fd41c14de58e55dd23bccc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for twopy-0.4.1.tar.gz:

Publisher: publish-to-pypi.yml on gumadeiras/twopy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file twopy-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: twopy-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for twopy-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ef4faf52b4efd68f914a12ea7e6d3fc25d79dcd729d3d6af3a9e25a06cf16780
MD5 f01c112cbbeb50e47ac38923d4f2c4f8
BLAKE2b-256 37ffc1d0850e4248bf61fea4b0dc1bc0d05ce4c5436aacb50467fbe1bfa4ea86

See more details on using hashes here.

Provenance

The following attestation bundles were made for twopy-0.4.1-py3-none-any.whl:

Publisher: publish-to-pypi.yml on gumadeiras/twopy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 files

0.4.0

2 files

0.3.9

2 files

0.3.8

2 files

0.3.7

2 files

0.3.6

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 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