Skip to content
This repository was archived by the owner on Aug 27, 2025. It is now read-only.

Commit c933d7a

Browse files
add known channels + lower tol step
1 parent 348f19a commit c933d7a

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

spatialdata_xenium_explorer/_constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class ExplorerConstants:
1313
MICRONS_TO_PIXELS = 4.705882
1414

1515
COLORS = [400, 500, 550, 600, 650, 700]
16-
KNOWN_CHANNELS = {"DAPI": 400}
16+
KNOWN_CHANNELS = {"DAPI": 400, "DNA1": 400, "DAPI (000)": 400}
1717

1818

1919
class Versions:

spatialdata_xenium_explorer/core/shapes.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@
1212

1313
log = logging.getLogger(__name__)
1414

15+
TOLERANCE_STEP = 0.5
1516

16-
def pad_polygon(polygon: Polygon, max_vertices: int, tolerance: float = 1) -> np.ndarray:
17+
18+
def pad_polygon(
19+
polygon: Polygon, max_vertices: int, tolerance: float = TOLERANCE_STEP
20+
) -> np.ndarray:
1721
"""Transform the polygon to have the desired number of vertices
1822
1923
Args:
@@ -37,7 +41,7 @@ def pad_polygon(polygon: Polygon, max_vertices: int, tolerance: float = 1) -> np
3741

3842
# TODO: improve it: how to choose the right tolerance?
3943
polygon = polygon.simplify(tolerance=tolerance)
40-
return pad_polygon(polygon, max_vertices, tolerance + 1)
44+
return pad_polygon(polygon, max_vertices, tolerance + TOLERANCE_STEP)
4145

4246

4347
def write_polygons(

0 commit comments

Comments
 (0)