torch-volpy 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- torch_volpy-0.1.0/LICENSE +21 -0
- torch_volpy-0.1.0/MANIFEST.in +21 -0
- torch_volpy-0.1.0/PKG-INFO +109 -0
- torch_volpy-0.1.0/README.md +78 -0
- torch_volpy-0.1.0/pyproject.toml +57 -0
- torch_volpy-0.1.0/setup.cfg +4 -0
- torch_volpy-0.1.0/src/torch_volpy/__init__.py +10 -0
- torch_volpy-0.1.0/src/torch_volpy/extraction/ALI.py +829 -0
- torch_volpy-0.1.0/src/torch_volpy/extraction/Spikepursuit.py +2328 -0
- torch_volpy-0.1.0/src/torch_volpy/extraction/__init__.py +4 -0
- torch_volpy-0.1.0/src/torch_volpy/filter/Filter.py +160 -0
- torch_volpy-0.1.0/src/torch_volpy/filter/__init__.py +3 -0
- torch_volpy-0.1.0/src/torch_volpy/gui/__init__.py +51 -0
- torch_volpy-0.1.0/src/torch_volpy/gui/__main__.py +4 -0
- torch_volpy-0.1.0/src/torch_volpy/gui/assets/chevron-down-disabled.svg +3 -0
- torch_volpy-0.1.0/src/torch_volpy/gui/assets/chevron-down.svg +3 -0
- torch_volpy-0.1.0/src/torch_volpy/gui/assets/chevron-up-disabled.svg +3 -0
- torch_volpy-0.1.0/src/torch_volpy/gui/assets/chevron-up.svg +3 -0
- torch_volpy-0.1.0/src/torch_volpy/gui/core.py +1210 -0
- torch_volpy-0.1.0/src/torch_volpy/gui/qt_app.py +6084 -0
- torch_volpy-0.1.0/src/torch_volpy/model/Cellpose.py +272 -0
- torch_volpy-0.1.0/src/torch_volpy/model/Summary.py +225 -0
- torch_volpy-0.1.0/src/torch_volpy/model/__init__.py +16 -0
- torch_volpy-0.1.0/src/torch_volpy/motion/MotionCorrect.py +1626 -0
- torch_volpy-0.1.0/src/torch_volpy/motion/Template.py +277 -0
- torch_volpy-0.1.0/src/torch_volpy/motion/Translation.py +611 -0
- torch_volpy-0.1.0/src/torch_volpy/motion/__init__.py +5 -0
- torch_volpy-0.1.0/src/torch_volpy/movie/Movie.py +574 -0
- torch_volpy-0.1.0/src/torch_volpy/movie/__init__.py +3 -0
- torch_volpy-0.1.0/src/torch_volpy/util/IJAB.py +182 -0
- torch_volpy-0.1.0/src/torch_volpy/util/__init__.py +3 -0
- torch_volpy-0.1.0/src/torch_volpy.egg-info/PKG-INFO +109 -0
- torch_volpy-0.1.0/src/torch_volpy.egg-info/SOURCES.txt +37 -0
- torch_volpy-0.1.0/src/torch_volpy.egg-info/dependency_links.txt +1 -0
- torch_volpy-0.1.0/src/torch_volpy.egg-info/entry_points.txt +2 -0
- torch_volpy-0.1.0/src/torch_volpy.egg-info/requires.txt +16 -0
- torch_volpy-0.1.0/src/torch_volpy.egg-info/top_level.txt +1 -0
- torch_volpy-0.1.0/tests/test_gui_motion_correction.py +64 -0
- torch_volpy-0.1.0/tests/test_spikepursuit_filter_methods.py +59 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 bobqianic
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
include README.md
|
|
2
|
+
include LICENSE
|
|
3
|
+
include pyproject.toml
|
|
4
|
+
|
|
5
|
+
prune .idea
|
|
6
|
+
prune .venv
|
|
7
|
+
prune _test
|
|
8
|
+
prune build
|
|
9
|
+
prune dist
|
|
10
|
+
|
|
11
|
+
global-exclude __pycache__
|
|
12
|
+
global-exclude *.py[cod]
|
|
13
|
+
global-exclude *.pyo
|
|
14
|
+
global-exclude *.h5
|
|
15
|
+
global-exclude *.hdf5
|
|
16
|
+
global-exclude *.tif
|
|
17
|
+
global-exclude *.tiff
|
|
18
|
+
global-exclude *.pt
|
|
19
|
+
global-exclude *.npy
|
|
20
|
+
global-exclude *.mat
|
|
21
|
+
global-exclude *.png
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: torch-volpy
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: PyTorch tools for voltage imaging movie processing and signal extraction.
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Keywords: voltage-imaging,calcium-imaging,neuroscience,pytorch,signal-extraction,motion-correction
|
|
7
|
+
Classifier: Development Status :: 3 - Alpha
|
|
8
|
+
Classifier: Intended Audience :: Science/Research
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering :: Image Processing
|
|
14
|
+
Requires-Python: >=3.10
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: cellpose
|
|
18
|
+
Requires-Dist: h5py>=3.8
|
|
19
|
+
Requires-Dist: matplotlib>=3.7
|
|
20
|
+
Requires-Dist: numpy>=1.24
|
|
21
|
+
Requires-Dist: tifffile>=2023.7.10
|
|
22
|
+
Requires-Dist: torch>=2.0
|
|
23
|
+
Provides-Extra: segmentation
|
|
24
|
+
Provides-Extra: gui
|
|
25
|
+
Requires-Dist: PyQt6>=6.6; extra == "gui"
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: build>=1.2; extra == "dev"
|
|
28
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
29
|
+
Requires-Dist: twine>=5; extra == "dev"
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
|
|
32
|
+
# torch-volpy
|
|
33
|
+
|
|
34
|
+
PyTorch tools for voltage imaging movie processing and signal extraction.
|
|
35
|
+
|
|
36
|
+
The package currently provides:
|
|
37
|
+
|
|
38
|
+
- HDF5-backed movie I/O through `Movie`
|
|
39
|
+
- Motion template building, translation estimation, and motion correction
|
|
40
|
+
- Gaussian high-pass filtering
|
|
41
|
+
- Summary image generation
|
|
42
|
+
- Cellpose-based segmentation support
|
|
43
|
+
- ALI and SpikePursuit signal extraction
|
|
44
|
+
|
|
45
|
+
## Installation
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pip install torch-volpy
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Install the GUI extra for interactive movie viewing and ROI trace extraction:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pip install "torch-volpy[gui]"
|
|
55
|
+
torch-volpy-gui
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
For local development from this repository:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
python -m pip install -e ".[gui,dev]"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Basic Imports
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
from torch_volpy.movie import Movie
|
|
68
|
+
from torch_volpy.motion import MotionCorrect, Template, Translation
|
|
69
|
+
from torch_volpy.filter import Filter
|
|
70
|
+
from torch_volpy.model import Summary
|
|
71
|
+
from torch_volpy.extraction import ALI, Spikepursuit
|
|
72
|
+
from torch_volpy.model import Cellpose
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## GUI
|
|
76
|
+
|
|
77
|
+
The PyQt GUI opens HDF5 movies (`.h5`/`.hdf5`, dataset defaults to `movie`) and
|
|
78
|
+
TIFF stacks (`.tif`/`.tiff`). It provides frame playback, Cellpose ROI
|
|
79
|
+
generation from a summary image, loading existing ROI masks (`.tif`, `.npy`,
|
|
80
|
+
`.npz`, `.h5`/`.hdf5`), click-to-select ROI picking, and trace extraction with:
|
|
81
|
+
|
|
82
|
+
- `Spikepursuit` as the default extraction method
|
|
83
|
+
- `ALI` for cropped ROI activity localization
|
|
84
|
+
- a simple mean-ROI trace for quick inspection
|
|
85
|
+
|
|
86
|
+
The Cellpose ROI button follows the test workflow in `_test/test_cellpose.py`:
|
|
87
|
+
build `Summary(movie)`, stack `[mean, mean, corr]`, and pass that image to
|
|
88
|
+
`Cellpose.build(...)`. The resulting labeled mask is shown as an overlay; click
|
|
89
|
+
an ROI in `Select` mode to choose which label is used for trace extraction.
|
|
90
|
+
|
|
91
|
+
When opening a TIFF stack, the GUI first converts it to a sibling HDF5 file,
|
|
92
|
+
runs motion correction into `corrected_<name>.h5`, and then displays the
|
|
93
|
+
corrected HDF5 movie. A progress bar in the Movie panel reports conversion and
|
|
94
|
+
motion-correction phases.
|
|
95
|
+
|
|
96
|
+
<p align="center">
|
|
97
|
+
<img src="./media/2026-06-06%20231838.png" width="800" alt="App Screenshot">
|
|
98
|
+
</p>
|
|
99
|
+
<p align="center">
|
|
100
|
+
<img src="./media/2026-06-06%20232535.png" width="800" alt="App Screenshot">
|
|
101
|
+
</p>
|
|
102
|
+
|
|
103
|
+
## How To Build
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
python -m build
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
The build artifacts are written to `dist/`.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# torch-volpy
|
|
2
|
+
|
|
3
|
+
PyTorch tools for voltage imaging movie processing and signal extraction.
|
|
4
|
+
|
|
5
|
+
The package currently provides:
|
|
6
|
+
|
|
7
|
+
- HDF5-backed movie I/O through `Movie`
|
|
8
|
+
- Motion template building, translation estimation, and motion correction
|
|
9
|
+
- Gaussian high-pass filtering
|
|
10
|
+
- Summary image generation
|
|
11
|
+
- Cellpose-based segmentation support
|
|
12
|
+
- ALI and SpikePursuit signal extraction
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install torch-volpy
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Install the GUI extra for interactive movie viewing and ROI trace extraction:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install "torch-volpy[gui]"
|
|
24
|
+
torch-volpy-gui
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
For local development from this repository:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
python -m pip install -e ".[gui,dev]"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Basic Imports
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
from torch_volpy.movie import Movie
|
|
37
|
+
from torch_volpy.motion import MotionCorrect, Template, Translation
|
|
38
|
+
from torch_volpy.filter import Filter
|
|
39
|
+
from torch_volpy.model import Summary
|
|
40
|
+
from torch_volpy.extraction import ALI, Spikepursuit
|
|
41
|
+
from torch_volpy.model import Cellpose
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## GUI
|
|
45
|
+
|
|
46
|
+
The PyQt GUI opens HDF5 movies (`.h5`/`.hdf5`, dataset defaults to `movie`) and
|
|
47
|
+
TIFF stacks (`.tif`/`.tiff`). It provides frame playback, Cellpose ROI
|
|
48
|
+
generation from a summary image, loading existing ROI masks (`.tif`, `.npy`,
|
|
49
|
+
`.npz`, `.h5`/`.hdf5`), click-to-select ROI picking, and trace extraction with:
|
|
50
|
+
|
|
51
|
+
- `Spikepursuit` as the default extraction method
|
|
52
|
+
- `ALI` for cropped ROI activity localization
|
|
53
|
+
- a simple mean-ROI trace for quick inspection
|
|
54
|
+
|
|
55
|
+
The Cellpose ROI button follows the test workflow in `_test/test_cellpose.py`:
|
|
56
|
+
build `Summary(movie)`, stack `[mean, mean, corr]`, and pass that image to
|
|
57
|
+
`Cellpose.build(...)`. The resulting labeled mask is shown as an overlay; click
|
|
58
|
+
an ROI in `Select` mode to choose which label is used for trace extraction.
|
|
59
|
+
|
|
60
|
+
When opening a TIFF stack, the GUI first converts it to a sibling HDF5 file,
|
|
61
|
+
runs motion correction into `corrected_<name>.h5`, and then displays the
|
|
62
|
+
corrected HDF5 movie. A progress bar in the Movie panel reports conversion and
|
|
63
|
+
motion-correction phases.
|
|
64
|
+
|
|
65
|
+
<p align="center">
|
|
66
|
+
<img src="./media/2026-06-06%20231838.png" width="800" alt="App Screenshot">
|
|
67
|
+
</p>
|
|
68
|
+
<p align="center">
|
|
69
|
+
<img src="./media/2026-06-06%20232535.png" width="800" alt="App Screenshot">
|
|
70
|
+
</p>
|
|
71
|
+
|
|
72
|
+
## How To Build
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
python -m build
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The build artifacts are written to `dist/`.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=69", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "torch-volpy"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "PyTorch tools for voltage imaging movie processing and signal extraction."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
keywords = [
|
|
13
|
+
"voltage-imaging",
|
|
14
|
+
"calcium-imaging",
|
|
15
|
+
"neuroscience",
|
|
16
|
+
"pytorch",
|
|
17
|
+
"signal-extraction",
|
|
18
|
+
"motion-correction",
|
|
19
|
+
]
|
|
20
|
+
classifiers = [
|
|
21
|
+
"Development Status :: 3 - Alpha",
|
|
22
|
+
"Intended Audience :: Science/Research",
|
|
23
|
+
"Programming Language :: Python :: 3",
|
|
24
|
+
"Programming Language :: Python :: 3.10",
|
|
25
|
+
"Programming Language :: Python :: 3.11",
|
|
26
|
+
"Programming Language :: Python :: 3.12",
|
|
27
|
+
"Topic :: Scientific/Engineering :: Image Processing",
|
|
28
|
+
]
|
|
29
|
+
dependencies = [
|
|
30
|
+
"cellpose",
|
|
31
|
+
"h5py>=3.8",
|
|
32
|
+
"matplotlib>=3.7",
|
|
33
|
+
"numpy>=1.24",
|
|
34
|
+
"tifffile>=2023.7.10",
|
|
35
|
+
"torch>=2.0",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[project.optional-dependencies]
|
|
39
|
+
segmentation = []
|
|
40
|
+
gui = [
|
|
41
|
+
"PyQt6>=6.6",
|
|
42
|
+
]
|
|
43
|
+
dev = [
|
|
44
|
+
"build>=1.2",
|
|
45
|
+
"pytest>=8",
|
|
46
|
+
"twine>=5",
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
[project.scripts]
|
|
50
|
+
torch-volpy-gui = "torch_volpy.gui.qt_app:main"
|
|
51
|
+
|
|
52
|
+
[tool.setuptools.packages.find]
|
|
53
|
+
where = ["src"]
|
|
54
|
+
include = ["torch_volpy*"]
|
|
55
|
+
|
|
56
|
+
[tool.setuptools.package-data]
|
|
57
|
+
torch_volpy = ["gui/assets/*.svg"]
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""PyTorch tools for voltage imaging movie processing and signal extraction."""
|
|
2
|
+
|
|
3
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
4
|
+
|
|
5
|
+
try:
|
|
6
|
+
__version__ = version("torch-volpy")
|
|
7
|
+
except PackageNotFoundError:
|
|
8
|
+
__version__ = "0.0.0"
|
|
9
|
+
|
|
10
|
+
__all__ = ["__version__"]
|