Skip to content

Commit 88e2889

Browse files
authored
Minor update to move edge-related attributes to border (#689)
1 parent 26749a1 commit 88e2889

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

micro_sam/sam_annotator/_annotator.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ def _create_layers(self):
2929
self._point_prompt_layer = self._viewer.add_points(
3030
name="point_prompts",
3131
property_choices={"label": self._point_labels},
32-
edge_color="label",
33-
edge_color_cycle=vutil.LABEL_COLOR_CYCLE,
32+
border_color="label",
33+
border_color_cycle=vutil.LABEL_COLOR_CYCLE,
3434
symbol="o",
3535
face_color="transparent",
36-
edge_width=0.5,
36+
border_width=0.5,
3737
size=12,
3838
ndim=self._ndim,
3939
)
40-
self._point_prompt_layer.edge_color_mode = "cycle"
40+
self._point_prompt_layer.border_color_mode = "cycle"
4141

4242
# Add the shape layer for box and other shape prompts.
4343
self._viewer.add_shapes(

micro_sam/sam_annotator/annotator_tracking.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,16 @@ def _create_layers(self):
109109
"state": self._track_state_labels,
110110
"track_id": ["1"], # we use string to avoid pandas warning
111111
},
112-
edge_color="label",
113-
edge_color_cycle=vutil.LABEL_COLOR_CYCLE,
112+
border_color="label",
113+
border_color_cycle=vutil.LABEL_COLOR_CYCLE,
114114
symbol="o",
115115
face_color="state",
116116
face_color_cycle=STATE_COLOR_CYCLE,
117-
edge_width=0.4,
117+
border_width=0.4,
118118
size=12,
119119
ndim=self._ndim,
120120
)
121-
self._point_prompt_layer.edge_color_mode = "cycle"
121+
self._point_prompt_layer.border_color_mode = "cycle"
122122
self._point_prompt_layer.face_color_mode = "cycle"
123123

124124
# Using the box layer to set divisions currently doesn't work.
@@ -132,9 +132,9 @@ def _create_layers(self):
132132
edge_color="green",
133133
property_choices={"track_id": ["1"]},
134134
# property_choces={"track_id": ["1"], "state": self._track_state_labels},
135-
# edge_color_cycle=STATE_COLOR_CYCLE,
135+
# border_color_cycle=STATE_COLOR_CYCLE,
136136
)
137-
# self._box_prompt_layer.edge_color_mode = "cycle"
137+
# self._box_prompt_layer.border_color_mode = "cycle"
138138

139139
# Add the label layers for the current object, the automatic segmentation and the committed segmentation.
140140
dummy_data = np.zeros(self._shape, dtype="uint32")

test/test_prompt_generators.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ def _debug(self, mask, coordinates=None, labels=None, box=None, deformed_mask=No
3434
data=coordinates,
3535
name="prompts",
3636
properties={"label": labels},
37-
edge_color="label",
38-
edge_color_cycle=["#00FF00", "#FF0000"],
37+
border_color="label",
38+
border_color_cycle=["#00FF00", "#FF0000"],
3939
symbol="o",
4040
face_color="transparent",
41-
edge_width=0.5,
41+
border_width=0.5,
4242
size=5,
4343
ndim=2
4444
) # this function helps to view the (colored) background/foreground points
45-
prompts.edge_color_mode = "cycle"
45+
prompts.border_color_mode = "cycle"
4646

4747
if deformed_mask is not None:
4848
v.add_labels(deformed_mask.astype("uint8"), name="deformed mask / prediction")

0 commit comments

Comments
 (0)