Two-photon imaging analysis tool with a napari interface.
Project description
twopy
Two-photon imaging analysis tool for the Clark Lab output format.
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. Those files include the aligned movie, mean image, stimulus tables, photodiode signals, and recording metadata. Analysis and the GUI both work from the converted files, so the original source files remain separate from twopy's outputs. By default, converted recordings and interactive analysis outputs are cached locally under ~/.cache/twopy/recordings for speed; saving ROIs and analysis copies the changed output files back to the configured analysis_output location 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 it wrote. On macOS and Linux the default is ~/.config/twopy/config.yml; on Windows it is under %APPDATA%\twopy\config.yml. Edit that file with your database, data, and output paths before launching twopy. If you launch twopy before a config exists, twopy creates the same template, prints the path, and 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:
- Search the database or load a recording manually.
- Draw or edit ROIs in the
roisLabels layer. - Update response plots from the current ROIs.
- 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
- Full documentation
- Getting started: install, configure, launch, and save your first analysis.
- GUI guide: one page per task — loading, ROIs, plots, custom workflows, group matching, saving.
- Python API guide: find recordings, convert data, extract traces, fit kernels, and open napari from scripts.
- Writing custom workflows: add your own analysis to the napari Custom tab.
- Development guide: source setup and local checks.
- Input data spec: short recording folder contract.
- Recording file reference: detailed source and converted file schema.
Check
micromamba run -n twopy pre-commit run --all-files
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file twopy-0.3.6.tar.gz.
File metadata
- Download URL: twopy-0.3.6.tar.gz
- Upload date:
- Size: 1.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ceb4e5015c87223f8b04c73318555224a3cfd5594b7d5740231d4e6f5ff83d56
|
|
| MD5 |
4fd614d05eb4ae9b83c72cd2e351b5de
|
|
| BLAKE2b-256 |
198b841400dfc79793cf05f237767fd7c6e9e408352ed5a2477be0cf7864543b
|
Provenance
The following attestation bundles were made for twopy-0.3.6.tar.gz:
Publisher:
publish-to-pypi.yml on gumadeiras/twopy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
twopy-0.3.6.tar.gz -
Subject digest:
ceb4e5015c87223f8b04c73318555224a3cfd5594b7d5740231d4e6f5ff83d56 - Sigstore transparency entry: 1864284035
- Sigstore integration time:
-
Permalink:
gumadeiras/twopy@03dae829f2e454d1b138efd43fec0631b5a14a00 -
Branch / Tag:
refs/tags/0.3.6 - Owner: https://github.com/gumadeiras
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@03dae829f2e454d1b138efd43fec0631b5a14a00 -
Trigger Event:
release
-
Statement type:
File details
Details for the file twopy-0.3.6-py3-none-any.whl.
File metadata
- Download URL: twopy-0.3.6-py3-none-any.whl
- Upload date:
- Size: 1.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ba53ee903dad65ebf1969ff96f09b9e1593bca77648389b5419a55292a27361
|
|
| MD5 |
75d84e619546befce56dde5a12e88392
|
|
| BLAKE2b-256 |
a52c357666ce737c17d6736e6e97d3e84a90240c663138695135a75b858bd710
|
Provenance
The following attestation bundles were made for twopy-0.3.6-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on gumadeiras/twopy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
twopy-0.3.6-py3-none-any.whl -
Subject digest:
4ba53ee903dad65ebf1969ff96f09b9e1593bca77648389b5419a55292a27361 - Sigstore transparency entry: 1864284182
- Sigstore integration time:
-
Permalink:
gumadeiras/twopy@03dae829f2e454d1b138efd43fec0631b5a14a00 -
Branch / Tag:
refs/tags/0.3.6 - Owner: https://github.com/gumadeiras
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@03dae829f2e454d1b138efd43fec0631b5a14a00 -
Trigger Event:
release
-
Statement type: