napari_track_edit.import_export =============================== .. py:module:: napari_track_edit.import_export Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/napari_track_edit/import_export/geff_io/index /autoapi/napari_track_edit/import_export/menus/index /autoapi/napari_track_edit/import_export/sql_io/index Classes ------- .. autoapisummary:: napari_track_edit.import_export.ImportDialog Package Contents ---------------- .. py:class:: ImportDialog(import_type: str = 'csv') Bases: :py:obj:`qtpy.QtWidgets.QDialog` Dialog for importing external tracks from CSV or geff. .. py:attribute:: import_type :value: 'csv' .. py:attribute:: seg :value: None .. py:attribute:: df :value: None .. py:attribute:: incl_z :value: False .. py:attribute:: source_path :type: pathlib.Path | None :value: None .. py:attribute:: name :value: 'Tracks from ' .. py:attribute:: button_layout .. py:attribute:: cancel_button .. py:attribute:: finish_button .. py:attribute:: prop_map_widget .. py:attribute:: scale_widget .. py:attribute:: content_widget .. py:attribute:: scroll_area .. py:method:: _update_field_map_and_scale(checked: bool | None = None) -> None Update field map and scale widget based on segmentation selection. .. py:method:: infer_dims_from_segmentation() -> None Infer whether to include z dimension based on the selected segmentation file, if present. If not present, we do allow incl_z (but the user can select 'None' if it is 2D + time data without segmentation.). .. py:method:: _update_segmentation_widget() -> None Refresh the geff segmentation widget based on the geff root group. .. py:method:: _resize_dialog() -> None Dynamic widget resizing depending on the visible contents .. py:method:: _update_finish_button() -> None Update the finish button status depending on whether a segmentation is required and whether a valid geff root or pandas dataframe is present. Duplicate region properties are not allowed. .. py:method:: _cancel() -> None Close the dialog without loading tracks. .. py:method:: _generate_axes_metadata(name_map: dict[str, str | None], scale: list[float] | None, segmentation_path: pathlib.Path) -> None Generate axes metadata when missing from geff file. Uses the user-provided name_map and scale information to construct axes metadata that matches the segmentation dimensionality. :param name_map: Mapping from standard fields (t, z, y, x) to node property names :param scale: Scale values from scale widget [t, (z), y, x] :param segmentation_path: Path to segmentation file to determine ndim .. py:method:: _ensure_area_enabled() -> None Enable the area feature when segmentation is present. Recomputes only when area is missing from the graph schema (e.g. a GEFF imported without an area attribute); otherwise reuses existing values. .. py:method:: _maybe_convert_legacy_masks(geff_dir: pathlib.Path) -> bool Offer to convert masks stored in an older, memory-heavy dtype. Geff files written by older versions of tracksdata store segmentation masks as integers (e.g. ``uint64``) rather than ``bool``, using ~8x more memory when read, which can run out of memory on large datasets. If such masks are detected, warn the user and offer a lossless, in-place conversion of the mask buffer (the rest of the geff is untouched). :returns: True to continue the import, False if the user cancelled or the conversion failed. :rtype: bool .. py:method:: _finish() -> None Tries to read the csv/geff file and optional segmentation image and apply the attribute to column mapping to construct a Tracks object