Skip to content
Merged
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
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ classifiers = [
"Programming Language :: Python :: 3.13",
]
dependencies = [
"hs2p[asap,cucim,openslide,sam2,vips]>=4.1.2",
"hs2p[asap,cucim,openslide,sam2,vips]>=4.2.0",
"omegaconf",
"matplotlib",
"numpy<2",
Expand Down Expand Up @@ -88,7 +88,7 @@ fm = [
"pandas",
"pillow",
"rich",
"hs2p[asap,cucim,openslide,sam2,vips]>=4.1.2",
"hs2p[asap,cucim,openslide,sam2,vips]>=4.2.0",
"wandb",
"torch>=2.3,<2.8",
"torchvision>=0.18.0",
Expand Down
7 changes: 4 additions & 3 deletions slide2vec/runtime/tiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ def build_hs2p_configs(
if is_hierarchical_preprocessing(preprocessing)
else preprocessing.requested_tile_size_px
)
# Reuse hs2p's tiling-config resolver so the derived tissue_threshold comes from
# masks.min_coverage.tissue (the single source of truth) and independent_sampling
# is threaded consistently. The resolver reads attributes, so wrap the masks dict.
# Reuse hs2p's tiling-config resolver so the resolved min_coverage map comes from
# masks.min_coverage (the single source of truth; min_coverage["tissue"] is the tissue
# threshold) and independent_sampling is threaded consistently. The resolver reads
# attributes, so wrap the masks dict.
tiling_adapter = SimpleNamespace(
tiling=SimpleNamespace(
masks=SimpleNamespace(**dict(preprocessing.masks)),
Expand Down
2 changes: 1 addition & 1 deletion tests/test_regression_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ def test_masks_min_coverage_tissue_drives_derived_tiling_threshold():

tiling_cfg = build_hs2p_configs(preprocessing)[0]

assert tiling_cfg.tissue_threshold == pytest.approx(0.37)
assert tiling_cfg.min_coverage["tissue"] == pytest.approx(0.37)
assert tiling_cfg.independent_sampling is False


Expand Down
2 changes: 1 addition & 1 deletion tests/test_regression_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -2498,7 +2498,7 @@ def test_build_hs2p_configs_constructs_preview_config():
) = runtime_tiling.build_hs2p_configs(preprocessing)

assert tiling_cfg.backend == "asap"
assert tiling_cfg.tissue_threshold == pytest.approx(0.1) # derived from masks.min_coverage.tissue
assert tiling_cfg.min_coverage["tissue"] == pytest.approx(0.1) # resolved from masks.min_coverage.tissue
assert segmentation_cfg.downsample == 64
assert segmentation_cfg.method == "hsv"
assert filtering_cfg.ref_tile_size == 224
Expand Down
Loading