Skip to content

Commit 662bcc8

Browse files
committed
If rdefs.model is greyscale, channel is white
1 parent eb2b77f commit 662bcc8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ome.ts

+5
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ async function defaultMeta(loader: ZarrPixelSource, axis_labels: string[]): Prom
332332
function parseOmeroMeta({ rdefs, channels, name }: Ome.Omero, axes: Ome.Axis[]): Meta {
333333
const t = rdefs?.defaultT ?? 0;
334334
const z = rdefs?.defaultZ ?? 0;
335+
const greyscale = rdefs?.model === "greyscale";
335336

336337
const colors: string[] = [];
337338
const contrast_limits: [min: number, max: number][] = [];
@@ -345,6 +346,10 @@ function parseOmeroMeta({ rdefs, channels, name }: Ome.Omero, axes: Ome.Axis[]):
345346
names.push(c.label || `${index}`);
346347
});
347348

349+
if (greyscale && colors.length === 1) {
350+
colors[0] = "FFFFFF";
351+
}
352+
348353
const defaultSelection = axes.map((axis) => {
349354
if (axis.type === "time") return t;
350355
if (axis.name === "z") return z;

0 commit comments

Comments
 (0)