Skip to main content

masknmf-toolbox

Installation | API | Data Formats | Paper |

PyTorch implementation of the masknmf framework for {calcium, voltage, glutamate} imaging analysis. Supports GPU-accelerated:

  • Motion Correction
  • Compression and Denoising
  • Signal Demixing
  • High-performance visualization

Installation

Tests are run against Python 3.12 and 3.13, on Linux and Windows using pip and miniforge3.

Download the repository

Until the package is published to PyPI, you have a few options to download the software:

  1. git clone (recommended)
  2. Download directly from GitHub (code -> Download ZIP)
  3. Install directly from a branch (see Skip the cloning step)
git clone https://github.com/apasarkar/masknmf-toolbox.git
cd masknmf-toolbox

pip

Virtual environments are outside the scope of this README, but in general we recommend:

  • UV (strongly recommended, prepend uv to all pip commands)
uv pip install .
pip install .

miniforge3

The only tested and supported flavor of anaconda is miniforge3:

conda create -n masknmf -c conda-forge python=3.12
pip install .

Skip the cloning step

If your environment is already set up, you can skip the cloning step and install directly from a branch of the repository:

# with standard venvs 
$ pip install git+https://github.com/apasarkar/masknmf-toolbox.git@main
# or with UV
$ uv pip install git+https://github.com/apasarkar/masknmf-toolbox.git@main

Installed 1 package in 0.63ms
 - masknmf-toolbox==0.1.0 
 + masknmf-toolbox==0.1.0 

GPU Dependencies

The default installation of PyTorch will not have cuda enabled. To get the cuda-enabled PyTorch installation

Find which Cuda version you're using (e.g. cuda_12.6)

nvcc --version
% or
nvidia-smi

Windows should have nvcc available in the command prompt if you have installed the CUDA toolkit.

If not, you can find it in the CUDA installation directory:

  • Windows:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\bin
  • Linux/Unix: /usr/local/cuda/bin/nvcc
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Thu_Sep_12_02:55:00_Pacific_Daylight_Time_2024
Cuda compilation tools, release 12.6, V12.6.77
Build cuda_12.6.r12.6/compiler.34841621_0

Install the version of PyTorch that matches your cuda and operating system on the PyTorch Getting Started.

API

See the notebooks folder for demos on how to use the motion correction, compression, and demixing APIs.

Data Formats

Support currently provided for

  • multipage .tiff files
  • hdf5 files.

Support for other formats can be easily added by defining a data loader class that implements LazyDataLoader.

Paper

If you use this method, please cite the accompanying paper

maskNMF: A denoise-sparsen-detect approach for extracting neural signals from dense imaging data. (2023). A. Pasarkar*, I. Kinsella, P. Zhou, M. Wu, D. Pan, J.L. Fan, Z. Wang, L. Abdeladim, D.S. Peterka, H. Adesnik, N. Ji, L. Paninski.

Metadata

Release files for masknmf 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for masknmf 0.1.0
File Size Uploaded Provenance Actions
masknmf-0.1.0.tar.gz 579.5 kB Without provenance Details for masknmf-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for masknmf 0.1.0
File Interpreter ABI Platform Actions
masknmf-0.1.0-py3-none-any.whl Python 3 none any Details for masknmf-0.1.0-py3-none-any.whl

Total release size: 1.2 MB

Release files / masknmf-0.1.0.tar.gz

Download URL masknmf-0.1.0.tar.gz
Size 579.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a29f6975d462cd85dfa8e946658619d1b9e26ea4f4f159dffbc77ece4c103289
BLAKE2b-256 checksum
How to use checksums
0bb93140042cf1fa995d220b98a7e63031b83e9d2255ed43268ee8a68ba62936
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"20.04","id":"focal","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / masknmf-0.1.0-py3-none-any.whl

Download URL masknmf-0.1.0-py3-none-any.whl
Size 667.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
12530e27be9bf5b13e6644c126b5b693150a0b59ee4059d462b4b30252039e4d
BLAKE2b-256 checksum
How to use checksums
2c847ff99adc92da5bc983c3ee71b7f46e3a7e66f1e0374e7d79d91d9e97b795
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"20.04","id":"focal","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for masknmf 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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