spacr.qt.widgets.metadata_table¶
Editable metadata table for image ingestion.
When a dataset’s plate / well / field / channel assignment is inferred
— from a container file’s internal structure or from a folder layout —
the guess is rarely perfect. This widget shows those inferred rows in an
editable QTableWidget so the user can correct wells, split
conditions, relabel channels, etc. before committing, then writes a
filename_map.csv the pipeline consumes.
Rows are the plain dicts produced by spacr.qt.ingest_preview
(original / plate / well / field / channel / time / canonical). The
canonical column is recomputed live from the editable columns so the
generated filenames always reflect the user’s edits.
MetadataTablePanel is the reusable widget (embeddable / testable
without an event loop); MetadataTableDialog wraps it with
Apply / Cancel buttons for the drop flow.
Classes¶
Modal wrapper around |
|
An editable grid of ingestion metadata rows. |
Module Contents¶
- class spacr.qt.widgets.metadata_table.MetadataTableDialog(rows: List[Dict[str, Any]], dst: Any, on_apply: Callable[[pathlib.Path], None] | None = None, parent: PySide6.QtWidgets.QWidget | None = None)[source]¶
Bases:
PySide6.QtWidgets.QDialogModal wrapper around
MetadataTablePanelfor the drop flow.- Parameters:
rows – preview rows to edit.
dst – where the
filename_map.csvis written on Apply.on_apply – optional callback invoked with the written CSV path.
parent – parent widget; ownership only.
Wrap the metadata table in a modal review dialog.
- Parameters:
rows – the extracted metadata to review.
dst – where
filename_map.csvis written on Apply.on_apply – called with the written path once it lands.
parent – parent widget, or
None.
- property written_path: pathlib.Path | None[source]¶
Path of the CSV written on Apply, or None if cancelled.
- class spacr.qt.widgets.metadata_table.MetadataTablePanel(rows: List[Dict[str, Any]] | None = None, parent: PySide6.QtWidgets.QWidget | None = None)[source]¶
Bases:
PySide6.QtWidgets.QWidgetAn editable grid of ingestion metadata rows.
- Parameters:
rows – initial preview rows (see
spacr.qt.ingest_preview).parent – optional Qt parent.
Build the metadata review table.
- Parameters:
rows – the extracted metadata to show;
Nonestarts empty.parent – parent widget, or
None.
- set_rows(rows: List[Dict[str, Any]]) None[source]¶
Replace the table contents with
rows.- Parameters:
rows – one dict per row, keyed by column; missing keys show blank.
- write_filename_map(dst: Any) pathlib.Path[source]¶
Write the current rows to
dstas afilename_map.csv.- Parameters:
dst – path of the CSV to write, converted to
Path; its parent folders are created.- Returns:
the path written.