Skip to content

Commit 26d915e

Browse files
authored
feat: port LabelImageLayer and LabelImageSeriesLayer to new chunky LabelLayer (#648)
Summary: This adds LabelLayer, which combines both LabelImageLayer and LabelImageSeriesLayer to a single layer using the same chunk-streaming infrastructure as ImageLayer. Much of the code in src/layers/label_layer.ts is either copied or from or very similar to the existing ImageLayer (formerly ChunkedImageLayer). This also allows removing the now-unused ImageSeriesLoader and a bunch more now-unused loading code, including the "Region" type. I think there may be room for a type like this (for example for describing a global "crop") in the future, but I don't think we need to maintain it until we need it. After consolidating the layers, I also combined the two label examples into one.
1 parent ba5cb2a commit 26d915e

14 files changed

Lines changed: 432 additions & 931 deletions

File tree

examples/image_labels_overlay_with_value_picking/index.html

Lines changed: 0 additions & 51 deletions
This file was deleted.

examples/image_labels_overlay_with_value_picking/main.ts

Lines changed: 0 additions & 141 deletions
This file was deleted.

examples/image_series_labels_overlay/index.html

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
background-color: black;
1717
}
1818
#main {
19+
position: relative;
1920
display: flex;
2021
flex-direction: column;
2122
width: 100%;
@@ -49,14 +50,28 @@
4950
input[type="range"] {
5051
width: 100%;
5152
}
52-
input[type="button"] {
53-
margin-left: 1rem;
53+
input[type="button"],
54+
button {
55+
margin-left: 0.5rem;
56+
}
57+
#pick-info-box {
58+
position: absolute;
59+
top: 1em;
60+
right: 1em;
61+
padding: 0.75em 1em;
62+
background-color: rgba(0, 0, 0, 0.75);
63+
font-family: monospace;
64+
font-size: 0.85em;
65+
pointer-events: none;
5466
}
5567
</style>
5668
</head>
5769
<body>
5870
<div id="main">
5971
<canvas id="canvas"></canvas>
72+
<div id="pick-info-box">
73+
<div id="pick-info">Click to pick a label value</div>
74+
</div>
6075
<div id="controls">
6176
<div class="control-row">
6277
<div class="control-label">Time point:</div>
@@ -68,8 +83,8 @@
6883
</div>
6984
</div>
7085
<div class="control-row">
71-
Layer State: &nbsp; <span id="layer-state">initialized</span>
72-
<input type="button" id="load-all" value="Load all slices" />
86+
<div class="control-label">Pick mode:</div>
87+
<button id="outline-toggle">Fill</button>
7388
</div>
7489
<div class="control-row">
7590
<div class="control-label">Color cycle:</div>

0 commit comments

Comments
 (0)