Skip to content

discovery

Dataset discovery and project metadata helpers.

default_data_dir

default_data_dir()

Return the data directory without DATA_DIR: data/ of a source checkout, else ./visfem_data, where the fetch commands put the example data.

discover_xdmf

discover_xdmf(directory)

Return stem->path for all .xdmf files with a matching .h5 in directory.

ircadb_organ_names

ircadb_organ_names(patient_dir)

Return sorted organ names available for a patient directory.

format_organ_name

format_organ_name(name)

Return name with a space inserted after a known leading prefix word.

xdmf_display_name

xdmf_display_name(stem)

Return a readable display name for an XDMF stem.

iter_descriptor_paths

iter_descriptor_paths()

Return the sorted paths of every dataset descriptor JSON under DATASETS_DIR.

load_descriptor

load_descriptor(path)

Return the validated ProjectMetadata parsed from the JSON at path; raises ValidationError or OSError.

load_project_metadata

load_project_metadata()

Return ProjectMetadata for each readable, valid dataset JSON under DATASETS_DIR, keyed by file stem and filtered by ALLOWED_DATASETS.

patient_numbers

patient_numbers(ddir)

Return the sorted numeric ids of the patient_<n> folders in ddir.

group_by_organ_system

group_by_organ_system(metadata)

Return the datasets in metadata grouped by first organ_system value, groups sorted by that value and entries by sort_order then name.

dataset_dir

dataset_dir(meta)

Return the dataset directory for meta.

pvd_file_path

pvd_file_path(meta)

Return the PVD file path for PVD-format datasets, else None.

patient_subdir

patient_subdir(ddir, patient)

Return the patient_NN folder for patient under ddir.

active_timeseries_path

active_timeseries_path(meta, state, ddir)

Return the active timeseries file of meta: its PVD for a PVD dataset, else the XDMF in ddir named by state.active_xdmf, else the first XDMF in ddir, else None.

grasp_phase_pvd

grasp_phase_pvd(patient_dir)

Return the per-patient GRASP phase-series PVD path, or None if absent.

grasp_phase_count

grasp_phase_count(pvd_path)

Return the number of contrast phases in a GRASP per-patient PVD.

meta_to_state

meta_to_state(meta)

Return a plain dict of meta for Trame state.