11import os
22import re
3- from typing import Dict , Optional , Tuple
3+ from typing import Dict , List , Optional , Tuple
44
55import imageio .v3 as imageio
66import numpy as np
@@ -28,11 +28,13 @@ def _normalize_cochlea_name(name):
2828
2929
3030# TODO enable table component filtering with MoBIE table
31+ # NOTE: the main component is always #1
3132def fetch_data_for_evaluation (
3233 annotation_path : str ,
3334 cache_path : Optional [str ] = None ,
3435 seg_name : str = "SGN" ,
3536 z_extent : int = 0 ,
37+ components_for_postprocessing : Optional [List [int ]] = None ,
3638) -> Tuple [np .ndarray , pd .DataFrame ]:
3739 """
3840 """
@@ -71,6 +73,11 @@ def fetch_data_for_evaluation(
7173 input_key = "s0"
7274 with zarr .open (s3_store , mode = "r" ) as f :
7375 segmentation = f [input_key ][roi ]
76+
77+ # ...
78+ if components_for_postprocessing is not None :
79+ pass
80+
7481 segmentation , _ , _ = relabel_sequential (segmentation )
7582
7683 # Cache it if required.
@@ -80,6 +87,7 @@ def fetch_data_for_evaluation(
8087 return segmentation , annotations
8188
8289
90+ # TODO crop to the bounding box around the union of points and segmentation masks to be more efficient.
8391def compute_matches_for_annotated_slice (
8492 segmentation : np .typing .ArrayLike ,
8593 annotations : pd .DataFrame ,
0 commit comments