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. 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:
- 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
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.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0181078ea0bd78fbf4b3fa64932cc2b837b5496a463b58529330021525772df2
|
|
| MD5 |
5733b3566410f611cc88ad2b62a4e949
|
|
| BLAKE2b-256 |
8c7d5e5ab4bec6198ea30f39055367928c3219391fd41c14de58e55dd23bccc3
|
Provenance
The following attestation bundles were made for twopy-0.4.1.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.4.1.tar.gz -
Subject digest:
0181078ea0bd78fbf4b3fa64932cc2b837b5496a463b58529330021525772df2 - Sigstore transparency entry: 2522643531
- Sigstore integration time:
-
Permalink:
gumadeiras/twopy@d258d105fc657554d5aeab49e65ba64c43b338f2 -
Branch / Tag:
refs/tags/0.4.1 - Owner: https://github.com/gumadeiras
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@d258d105fc657554d5aeab49e65ba64c43b338f2 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef4faf52b4efd68f914a12ea7e6d3fc25d79dcd729d3d6af3a9e25a06cf16780
|
|
| MD5 |
f01c112cbbeb50e47ac38923d4f2c4f8
|
|
| BLAKE2b-256 |
37ffc1d0850e4248bf61fea4b0dc1bc0d05ce4c5436aacb50467fbe1bfa4ea86
|
Provenance
The following attestation bundles were made for twopy-0.4.1-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.4.1-py3-none-any.whl -
Subject digest:
ef4faf52b4efd68f914a12ea7e6d3fc25d79dcd729d3d6af3a9e25a06cf16780 - Sigstore transparency entry: 2522643619
- Sigstore integration time:
-
Permalink:
gumadeiras/twopy@d258d105fc657554d5aeab49e65ba64c43b338f2 -
Branch / Tag:
refs/tags/0.4.1 - Owner: https://github.com/gumadeiras
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@d258d105fc657554d5aeab49e65ba64c43b338f2 -
Trigger Event:
release
-
Statement type: