Refactor geometry feature loaders and enhance distributed client status reporting

- Updated GTGeometryLoader to streamline geometry vector computation and caching.
- Introduced UNetGeometryLoader for UNet-derived geometry vectors.
- Added sample collection method in PapilaBundle for better data handling.
- Refined GeometrySegEncoder and ImageEncoder to utilize new sample collection.
- Enhanced distributed client with heartbeat mechanism for improved job tracking.
- Added new configuration files for UNet-derived geometry integration.
This commit is contained in:
rpotter6298
2026-04-29 11:05:19 +02:00
parent 512ebd13b2
commit af813bbb62
11 changed files with 467 additions and 153 deletions
+19
View File
@@ -507,6 +507,25 @@ class PapilaBundle:
"""
return [self._bundle.patient_col, "eyeID"]
# ── Sample collection (for tower early_pass) ─────────────────────────────
def collect_samples(self, df: pd.DataFrame | None) -> list[tuple]:
"""Build (pid, eye, image_path) tuples from a split DataFrame.
Used by tower early_pass implementations that need per-eye image paths
(UNet inference, contour rasterisation, etc.). Returns [] for an
empty/None df.
"""
if df is None or len(df) == 0:
return []
pc = self._bundle.patient_col
out: list[tuple] = []
for _, row in df.iterrows():
pid = int(row[pc])
eye = str(row.get("eyeID", "OD"))
out.append((pid, eye, self.image.get_image_path(pid, eye)))
return out
# ── Backward-compat delegates ────────────────────────────────────────────
@property