Calibration, output-building, and data preparation utilities for BrightEyes MCS HDF5 files.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file brighteyes_mcs_dataprep-0.1.0.tar.gz.
File metadata
- Download URL: brighteyes_mcs_dataprep-0.1.0.tar.gz
- Upload date:
- Size: 416.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f61092abb44a9c0d622e0e352adec9bbd0db45adccde62429059e00ba62450ae
|
|
| MD5 |
9dcdfb32acfb08662d6f28fed08c3dea
|
|
| BLAKE2b-256 |
1e264002c6bc68ba773476c3263a69a904760e8ef38ae6c8f757d43761e0ddc7
|
Provenance
The following attestation bundles were made for brighteyes_mcs_dataprep-0.1.0.tar.gz:
Publisher:
release.yml on VicidominiLab/BrightEyes-MCS-DataPrep
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brighteyes_mcs_dataprep-0.1.0.tar.gz -
Subject digest:
f61092abb44a9c0d622e0e352adec9bbd0db45adccde62429059e00ba62450ae - Sigstore transparency entry: 2125098469
- Sigstore integration time:
-
Permalink:
VicidominiLab/BrightEyes-MCS-DataPrep@d3d739e5de27193ea322a03c8fc31ab1a5746501 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/VicidominiLab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d3d739e5de27193ea322a03c8fc31ab1a5746501 -
Trigger Event:
push
-
Statement type:
File details
Details for the file brighteyes_mcs_dataprep-0.1.0-py3-none-any.whl.
File metadata
- Download URL: brighteyes_mcs_dataprep-0.1.0-py3-none-any.whl
- Upload date:
- Size: 91.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02de7b110a85d0b13631312e07de653804fe93eaa93ec0741a883b1e22ca0c4f
|
|
| MD5 |
0f50acc24557a6ea7a311c245938867a
|
|
| BLAKE2b-256 |
e3a90ff902915a0d896a29f93514c621a3349c8b716f1e04096e94c7f44b8f31
|
Provenance
The following attestation bundles were made for brighteyes_mcs_dataprep-0.1.0-py3-none-any.whl:
Publisher:
release.yml on VicidominiLab/BrightEyes-MCS-DataPrep
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brighteyes_mcs_dataprep-0.1.0-py3-none-any.whl -
Subject digest:
02de7b110a85d0b13631312e07de653804fe93eaa93ec0741a883b1e22ca0c4f - Sigstore transparency entry: 2125098628
- Sigstore integration time:
-
Permalink:
VicidominiLab/BrightEyes-MCS-DataPrep@d3d739e5de27193ea322a03c8fc31ab1a5746501 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/VicidominiLab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d3d739e5de27193ea322a03c8fc31ab1a5746501 -
Trigger Event:
push
-
Statement type: