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 src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import * as zarr from "zarrita";

import { Axis, Channel, OmeAttrs } from "./types/ome";
import { renderRgba } from "./render";
import { renderArray } from "./render";
import { NgffImage } from "./image";
import { createRgbDataUrl } from "./utils";

Expand Down Expand Up @@ -76,7 +76,7 @@ export async function renderImage(
sliceIndices: { [k: string]: number | [number, number] | undefined } = {},
autoBoost: boolean = false
): Promise<string> {
let { data, width } = await renderRgba(
let { data, width } = await renderArray(
arr,
axes,
channels,
Expand Down
8 changes: 4 additions & 4 deletions src/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import * as zarr from "zarrita";
import { ImageAttrs, ImageAttrsV5, OmeAttrs, Multiscale, Omero, Axis, Channel, Color } from "./types/ome";
import { createRgbDataUrl, openArray, openGroup, createOmero } from "./utils";
import { renderRgba } from "./render";
import { renderArray } from "./render";
import { generateNeuroglancerStateForOmeZarr, LayerType } from "./helper";

export class NgffImage {
Expand Down Expand Up @@ -372,7 +372,7 @@ export class NgffImage {
return path;
}

async renderRgba(options: {
async renderArray(options: {
// Array can be provided directly, or we will load based on targetSize or arrayPathOrIndex
arr?: zarr.Array<any> | string,
targetSize?: number,
Expand Down Expand Up @@ -452,7 +452,7 @@ export class NgffImage {
calcMinMaxForRange = options.calcMinMaxForRange;
}

let { data, width, height } = await renderRgba(
let { data, width, height } = await renderArray(
arr,
this.axes,
channels,
Expand All @@ -477,7 +477,7 @@ export class NgffImage {
calcMinMaxForRange?: boolean
} = {}
): Promise<string> {
let { data, width } = await this.renderRgba(options);
let { data, width } = await this.renderArray(options);
return createRgbDataUrl(data, width);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export function renderChunkWithColormap(
return renderChunk(chunk, transferFunc, { dst, blending });
}

export async function renderRgba(
export async function renderArray(
arr: zarr.Array<any, zarr.Readable>,
axes: Axis[],
channels: Channel[] | null | undefined,
Expand Down
Loading