PyTorch tools for voltage imaging movie processing and signal extraction.
The package currently provides:
- HDF5-backed movie I/O through
Movie - Motion template building, translation estimation, and motion correction
- Gaussian high-pass filtering
- Summary image generation
- Cellpose-based segmentation support
- ALI and SpikePursuit signal extraction
The performance test shown below was run on a 512x400 movie acquired at 1000 fps. The test machine used an AMD Ryzen 7 5800X CPU and an NVIDIA GeForce RTX 2080 Ti GPU. Runtime will vary with movie length, selected processing steps, extraction method, storage speed, and CUDA availability.
pip install torch-volpyInstall the GUI extra for interactive movie viewing and ROI trace extraction:
pip install "torch-volpy[gui]"
torch-volpy-guiFor local development from this repository:
python -m pip install -e ".[gui,dev]"from torch_volpy.movie import Movie
from torch_volpy.motion import MotionCorrect, Template, Translation
from torch_volpy.filter import Filter
from torch_volpy.model import Summary
from torch_volpy.extraction import ALI, Spikepursuit
from torch_volpy.model import CellposeThe PyQt GUI opens HDF5 movies (.h5/.hdf5, dataset defaults to movie) and
TIFF stacks (.tif/.tiff). It provides frame playback, Cellpose ROI
generation from a summary image, loading existing ROI masks (.tif, .npy,
.npz, .h5/.hdf5), click-to-select ROI picking, and trace extraction with:
Spikepursuitas the default extraction methodALIfor cropped ROI activity localization- a simple mean-ROI trace for quick inspection
The Cellpose ROI button follows the test workflow in _test/test_cellpose.py:
build Summary(movie), stack [mean, mean, corr], and pass that image to
Cellpose.build(...). The resulting labeled mask is shown as an overlay; click
an ROI in Select mode to choose which label is used for trace extraction.
When opening a TIFF stack, the GUI first converts it to a sibling HDF5 file,
runs motion correction into corrected_<name>.h5, and then displays the
corrected HDF5 movie. A progress bar in the Movie panel reports conversion and
motion-correction phases.
python -m buildThe build artifacts are written to dist/.



