spacr.psf_measurement¶
Explicit PSF intensity selection and compatibility for quantitative Measure.
PSFs operate after Measure’s normal rescaling and preprocessing hooks. Crops retain their existing source intensities; quantitative PSF output stays float. The captured plan, rather than a file path reopened per field, reaches workers.
Functions¶
|
Describe the exact intensity stream given to quantitative features. |
Return stable JSON configuration, or None for standard intensities. |
|
|
Compare active PSF behavior rather than dormant form parameters. |
|
Capture a calibrated kernel only for explicitly processed measurements. |
|
Refuse to mix incompatible intensity sources even when resume is off. |
Module Contents¶
- spacr.psf_measurement.measurement_psf_record(plan, image, *, hooks=(), channels=())[source]¶
Describe the exact intensity stream given to quantitative features.
- Parameters:
plan – captured processing plan or None for original choice.
image – selected intensities after standard preprocessing, before PSF.
hooks – names of registered standard preprocessing hooks, in order.
channels – original intensity-channel indices in measurement order.
- Returns:
JSON-safe field provenance, explicitly distinguishing crop pixels.
- spacr.psf_measurement.measurement_psf_signature(plan)[source]¶
Return stable JSON configuration, or None for standard intensities.
- Parameters:
plan – captured PSF processing plan, or None for original intensities.
- Returns:
deterministically ordered JSON provenance, or None without a plan.
- spacr.psf_measurement.measurement_resume_settings(settings, *, recorded=False)[source]¶
Compare active PSF behavior rather than dormant form parameters.
- Parameters:
settings – recorded or current Measure settings.
recorded – keep a recorded kernel identity without reopening its file.
- Returns:
fresh settings with inactive PSF knobs removed and one captured material signature. Legacy measurements have the original signature None.
- spacr.psf_measurement.prepare_measurement_psf(settings)[source]¶
Capture a calibrated kernel only for explicitly processed measurements.
- Parameters:
settings – PSF settings plus
psf_measurement_source:original(default; standard Measure intensities without PSF) orprocessed. Processed requires convolution/deconvolution and explicit YX or ZYX sampling. Original retains stored PSF parameters without applying them.- Returns:
immutable PSFPlan or None. The caller’s settings are unchanged.
- Raises:
ValueError – for an invalid source, disabled processing when requested, or invalid calibrated kernel settings.
- spacr.psf_measurement.validate_measurement_psf_history(settings, db_path, plan)[source]¶
Refuse to mix incompatible intensity sources even when resume is off.
- Parameters:
settings – current run settings, before its database snapshot is saved.
db_path – measurement database; absence means a new project.
plan – captured plan for this run.
- Raises:
ValueError – when existing measurement rows use another PSF identity or cannot be proved to use the requested processed intensities.