Architecture
Package layout
Section titled “Package layout”| Area | Path | Role |
|---|---|---|
| Orchestrator | phenome.pipeline |
PhenoMe class; user-facing workflow. |
| Mixins | phenome.mixins |
Behaviour split into dataset, embeddings, properties, distances, analysis, visualization, interactive. |
| Core algorithms | phenome.core |
DR, correlation, interpretability, results container (PhenoMeResults), export, validation. |
| I/O | phenome.io |
Images, checkpoints, file discovery. |
| Metadata | phenome.metadata |
MetadataBase and concrete extractors. |
| Utilities | phenome.utils |
Model wrappers, transforms, metadata helpers, property factories. |
| Plugins | phenome.plugins |
Registries for properties, metadata extractors, report sections. |
| Report | phenome.report |
HTML report generation. |
Imports for users are mostly from phenome (re-exports). See the
Function location guide for a full symbol
index.
The PhenoMe orchestrator composes the mixins in phenome.mixins and
delegates to phenome.io (discovery, HDF5), phenome.metadata
(MetadataBase and helpers), phenome.core (DR, correlations,
interpretability, PhenoMeResults), phenome.utils (model wrappers,
property factories), phenome.plugins (user registries), and
phenome.report (HTML output).
Data flow (typical run)
Section titled “Data flow (typical run)”
The typical data flow maps directly to the pipeline overview components:
- Discovery (Input) — Gather raw image paths and experimental metadata.
- Embeddings (A) — Batch inference through a
ModelWrapperto extract visual fingerprints. - Properties (B) — Parallel computation of classical features from images/masks.
- Analysis & Visualization (C) — Combine embeddings and properties for quantification and plotting.
Extension points
Section titled “Extension points”| Goal | Where to start |
|---|---|
| Custom metadata from paths or tables | Experiment details, MetadataBase, get_metadata_from_path, make_dataframe_metadata_fn. |
| Custom image features | Select properties, phenome.plugins.register_property. |
| Custom vision backbone | Model wrapper API; subclass ModelWrapper. |
| Report sections | Extending PhenoMe, register_report_section. |
Rule of thumb: prefer hooks (metadata_fn, property factories,
plugins) before forking PhenoMe internals.
Where should I add code?
Section titled “Where should I add code?”| Adding… | Prefer |
|---|---|
| New user-facing workflow step | phenome.pipeline or relevant phenome.mixins. |
| Reusable algorithm (DR, stats, export) | phenome.core. |
| File formats, HDF5, discovery | phenome.io. |
| User-registerable extension | phenome.plugins. |
