Skip to main content

BrightEyes-MCS-DataPrep

Calibration and data-preparation utilities for BrightEyes MCS HDF5 files.

brighteyes-mcs-dataprep contains the writer-side and processing helpers for BrightEyes MCS data. It calibrates FLIM histograms, estimates channel skew, creates schema-compatible /output groups, appends derived analysis products, and provides plotting and HDF5 inspection helpers.

Reader functionality is intentionally kept in BrightEyes-MCS-Reader and is imported from brighteyes_mcs_reader where needed.

Install

pip install brighteyes-mcs-dataprep

For local development:

pip install -e .
pytest

Usage

Calibrate a file

from brighteyes_mcs_dataprep import calibrate_h5_file

calibrated_path = calibrate_h5_file(
    "measurement.h5",
    "reference.h5",
    data_key=("data", "data_channels_extra"),
    reference_key=None,
    reference_type="ref",
    period_ns=12.5,
)

By default the calibrated copy is written next to the input file with a _calib.h5 suffix. Calibration results are stored under /calibration/results/<product>/, and the /output group is created unless create_output=False is passed.

Build standard outputs

from brighteyes_mcs_dataprep import build_h5_output

build_h5_output(
    "measurement_calib.h5",
    create_virtual_channels=True,
    create_sum_channels=True,
    create_sum_channels_with_skew_correction=True,
)

The output builder creates virtual per-channel datasets and summed SPAD/AUX products under /output. It reads current schema paths such as /raw/spad and /raw/aux by default. Legacy root-level datasets can be selected explicitly, for example spad_data_key="data" or aux_data_key="data_channels_extra".

Append analysis products

import numpy as np

from brighteyes_mcs_dataprep import H5OutputProduct, write_h5_output_run

written_path, run_id = write_h5_output_run(
    "measurement_calib.h5",
    "apr_001",
    [
        H5OutputProduct(
            "spad",
            np.ones((256, 256)),
            attrs={
                "data_role": "image",
                "axis_order": "y,x",
                "source_data_path": "/raw/spad",
                "units": "counts",
            },
        )
    ],
    tool_name="APR reassignment",
    algorithm_name="adaptive_pixel_reassignment",
    set_default=True,
)

Existing run IDs are versioned automatically, so a second write to apr_001 becomes apr_002 unless output_key_overwrite=True is passed.

Public API

Common imports are exposed directly from brighteyes_mcs_dataprep:

from brighteyes_mcs_dataprep import (
    H5DataCalibrator,
    H5OutputBuilder,
    H5OutputProduct,
    build_h5_output,
    calibrate_h5_file,
    estimate_channel_skew,
    show_h5_structure,
    write_h5_output_run,
)

Alignment and plotting helpers are also available through Alignment or as lazy top-level exports.

HDF5 Schema Notes

Current BrightEyes files store measured data under /raw, metadata under /raw/metadata, calibration artifacts under /calibration, and derived analysis runs under /output/<run_id>. The data-preparation helpers preserve this layout and add provenance attributes, source-file hashes, and default output pointers where appropriate.

Metadata

Release files for brighteyes-mcs-dataprep 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 brighteyes-mcs-dataprep 0.1.0
File Size Uploaded Provenance Actions
brighteyes_mcs_dataprep-0.1.0.tar.gz 416.6 kB With provenance Details for brighteyes_mcs_dataprep-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 507.9 kB

Release files / brighteyes_mcs_dataprep-0.1.0.tar.gz

Download URL brighteyes_mcs_dataprep-0.1.0.tar.gz
Size 416.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f61092abb44a9c0d622e0e352adec9bbd0db45adccde62429059e00ba62450ae
BLAKE2b-256 checksum
How to use checksums
1e264002c6bc68ba773476c3263a69a904760e8ef38ae6c8f757d43761e0ddc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 9, 2026.

Transparency log

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

Download URL brighteyes_mcs_dataprep-0.1.0-py3-none-any.whl
Size 91.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
02de7b110a85d0b13631312e07de653804fe93eaa93ec0741a883b1e22ca0c4f
BLAKE2b-256 checksum
How to use checksums
e3a90ff902915a0d896a29f93514c621a3349c8b716f1e04096e94c7f44b8f31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 9, 2026.

Transparency log

Security for brighteyes-mcs-dataprep 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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for brighteyes_mcs_dataprep-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 9, 2026.

Transparency log

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 Full 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