Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/ops_model/data/data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,14 @@ def __getitem__(self, index):
fov = self.stores[ci.store_key][well]["0"]
mask_label = getattr(ci, "mask_label", "cell_seg")
cell_mask_fov = self.stores[ci.store_key][well]["labels"][mask_label]["0"]
nuc_mask_fov = self.stores[ci.store_key][well]["labels"]["nuclear_seg"]["0"]
# Nuclear mask: prefer native-20x `nuclei_seg` (from the
# `submit_nuclei_segmentation_jobs` step), fall back to legacy
# `nuclear_seg` (5x-upscaled, from `segment_and_stitch_pheno`).
# Both labels are 20x-shaped at level 0 so bbox slicing is unchanged.
# See ops_process PR #113.
_labels_group = self.stores[ci.store_key][well]["labels"]
_nuc_label = "nuclei_seg" if "nuclei_seg" in _labels_group else "nuclear_seg"
nuc_mask_fov = _labels_group[_nuc_label]["0"]
bbox = ast.literal_eval(ci.bbox)
gene_label = self.label_int_lut[ci.gene_name]
total_index = ci.total_index
Expand Down
9 changes: 8 additions & 1 deletion src/ops_model/features/cp_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,14 @@ def extract_cp_features_bulk_read(
img_arr = stores[store_key][well]["0"]
mask_label = getattr(first_row, "mask_label", "cell_seg")
cell_seg_arr = stores[store_key][well]["labels"][mask_label]["0"]
nuc_seg_arr = stores[store_key][well]["labels"]["nuclear_seg"]["0"]
# Nuclear mask: prefer native-20x `nuclei_seg` (from the
# `submit_nuclei_segmentation_jobs` step), fall back to legacy
# `nuclear_seg` (5x-upscaled, from `segment_and_stitch_pheno`).
# Both labels are 20x-shaped at level 0; bbox slicing unchanged.
# See ops_process PR #113.
_labels_group = stores[store_key][well]["labels"]
_nuc_label = "nuclei_seg" if "nuclei_seg" in _labels_group else "nuclear_seg"
nuc_seg_arr = _labels_group[_nuc_label]["0"]
chunk_size = img_arr.chunks[-1] # 512

# Phase 1: Identify unique chunks from bounding boxes
Expand Down
Loading