Observed since 21 Oct, 11:30 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
aind-ophys-utils
Generated from aind-library-template
Python utility library for processing calcium imaging (optical physiology) data. All interfaces are array-based (NumPy / h5py) with no project-specific data structures, making the modules easy to integrate into any pipeline.
| Module | Description |
|---|---|
baseline_fitting | Robust parametric baseline fitting: M-estimator norms (Tukey biweight variants), IRLS nonlinear fitting with JAX autodiff, robust LOWESS smoother, and a high-level fit_baseline orchestrator that chains bleach-trend fitting with local fluctuation estimation. |
dff | ΔF/F computation from fluorescence traces. Inactive-frame masking baseline, parallelised across ROIs, with a plot_dff helper for QA visualisation. |
signal_utils | Signal processing primitives: running percentile filter, nanmedian filter, robust noise standard deviation (MAD / FFT / Welch), and a fast noise estimator using GPU-accelerated FFTs via PyTorch. |
summary_images | GPU-accelerated summary images for calcium imaging movies: mean, max-correlation (Cn), and peak-to-noise ratio (PNR). |
array_utils | Array downsampling and subsampling utilities with flexible strategies (mean, max, median, first, last, mid) and optional NaN-skipping. |
video_utils | H5 video downsampling and VP9 video encoding via imageio-ffmpeg. |
motion_border_utils | Compute motion borders from frame-shift correction outputs. |
segmentation_utils | Reduce per-pixel value maps to per-ROI values: a generic reduce_over_masks engine (mean/max/median/... under each mask) and a roi_probabilities wrapper that turns a Cellpose cellprob map into one aggregate probability per ROI. |
pip install aind-ophys-utils
GPU / CPU note.
aind-ophys-utilsdepends on PyTorch, which pulls in CUDA libraries by default from PyPI (~2 GB). To install a CPU-only build instead, install PyTorch first using the official CPU index, then install this package:pip install torch --index-url https://download.pytorch.org/whl/cpu pip install aind-ophys-utilsAlternatively, pass
--extra-index-urlin a single command:pip install aind-ophys-utils --extra-index-url https://download.pytorch.org/whl/cpu
To use the software from source, clone the repository and in the root directory run
pip install -e .
To develop the code in place, run
pip install -e .[dev]
There are several libraries used to run linters, check documentation, and run tests.
coverage run -m pytest && coverage report
interrogate .
flake8 .
black .
isort .
For internal members, please create a branch. For external members, please fork the repository and open a pull request from the fork. We'll primarily use Angular style for commit messages. Roughly, they should follow the pattern:
<type>(<scope>): <short summary>
where scope (optional) describes the packages affected by the code changes and type (mandatory) is one of:
The table below, from semantic release, shows which commit message gets you which release type when semantic-release runs (using the default configuration):
| Commit message | Release type |
|---|---|
fix(pencil): stop graphite breaking when too much pressure applied | |
feat(pencil): add 'graphiteWidth' option | |
perf(pencil): remove graphiteWidth optionBREAKING CHANGE: The graphiteWidth option has been removed.The default graphite width of 10mm is always used for performance reasons. | (Note that the BREAKING CHANGE: token must be in the footer of the commit) |
To generate the rst files source files for documentation, run
sphinx-apidoc -o doc_template/source/ src
Then to create the documentation HTML files, run
sphinx-build -b html doc_template/source/ doc_template/build/html
More info on sphinx installation can be found here.
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
h5pyEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | h5py>=3.11 | runtime |
imageio-ffmpegEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | imageio-ffmpeg>=0.5 | runtime |
jaxEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | jax>=0.4.26 | runtime |
matplotlibEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | matplotlib>=3.9 | runtime |
pandasEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | pandas>=2.2.2 | runtime |
scikit-imageEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | scikit-image>=0.24 | runtime |
scipyEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | scipy>=1.11 | runtime |
statsmodelsEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | statsmodels>=0.14.2 | runtime |
torchEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | torch>=2.3 | runtime |
blackEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | black; extra == "dev" | runtime |
coverageEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | coverage; extra == "dev" | runtime |
flake8Environment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | flake8; extra == "dev" | runtime |
interrogateEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | interrogate; extra == "dev" | runtime |
isortEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | isort; extra == "dev" | runtime |
SphinxEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | Sphinx; extra == "dev" | runtime |
furoEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | furo; extra == "dev" | runtime |
pytestEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | pytest; extra == "dev" | runtime |
bdist_wheel · 33.63 KB · Python py3
sdist · 73.54 KB · Python source
Observed since 21 Oct, 11:30 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:603898d433d1cec8d68ed9043e873ac49d2c9c2bfdf34c6c7125deac16434112