Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
froyo-np committed Dec 4, 2024
1 parent 1c62f2e commit 22e8aa0
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion packages/dzi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@
"lodash": "^4.17.21",
"regl": "^2.1.0"
}
}
}
6 changes: 3 additions & 3 deletions packages/dzi/src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type GpuProps = {
pixels: CachedTexture;
};
/**
*
*
* @param regl a valid REGL context (https://github.com/regl-project/regl)
* @returns an object which can fetch tiles from a DeepZoomImage, determine the visibility of those tiles given a simple camera, and render said tiles
* using regl (which uses webGL)
Expand Down Expand Up @@ -57,7 +57,7 @@ export function buildDziRenderer(regl: REGL.Regl): Renderer<DziImage, DziTile, R
};
};
return {
destroy: () => { }, // no private resources to destroy
destroy: () => {}, // no private resources to destroy
cacheKey: (item, _requestKey, _data, _settings) => `${item.url}`,
fetchItemContent: fetchDziTile,
getVisibleItems: (dzi, settings) => {
Expand All @@ -81,7 +81,7 @@ export function buildDziRenderer(regl: REGL.Regl): Renderer<DziImage, DziTile, R
};
}
/**
*
*
* @param regl a valid REGL context (https://github.com/regl-project/regl)
* @returns a function which creates a "Frame" of actions. each action represents loading
* and subsequently rendering a tile of the image as requested via its configuration -
Expand Down
2 changes: 1 addition & 1 deletion packages/omezarr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@
"regl": "^2.1.0",
"zarrita": "0.4.0-next.14"
}
}
}
24 changes: 12 additions & 12 deletions packages/omezarr/src/sliceview/loader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,22 +194,22 @@ describe('omezarr basic tiled loading', () => {
});
describe('sizeInUnits', () => {
it('respects scale transformations', () => {
const pyramid = exampleOmeZarr.multiscales[0]
const { axes, datasets } = pyramid
const pyramid = exampleOmeZarr.multiscales[0];
const { axes, datasets } = pyramid;

const layer9xy = sizeInUnits('xy', axes, datasets[9])
const layer0xy = sizeInUnits('xy', axes, datasets[0])
const layer9xy = sizeInUnits('xy', axes, datasets[9]);
const layer0xy = sizeInUnits('xy', axes, datasets[0]);

const layer9yz = sizeInUnits('yz', axes, datasets[9])
const layer0yz = sizeInUnits('yz', axes, datasets[0])
const layer9yz = sizeInUnits('yz', axes, datasets[9]);
const layer0yz = sizeInUnits('yz', axes, datasets[0]);
// we're looking at the highest resolution and lowest resolution layers.
// I think in an ideal world, we'd expect each layer to end up having an exactly equal size,
// however I think that isnt happening here for floating-point reasons - so the small differences are acceptable.
expect(layer9xy).toEqual([13.9776, 10.3936])
expect(layer0xy).toEqual([13.9993, 10.4993])
expect(layer9xy).toEqual([13.9776, 10.3936]);
expect(layer0xy).toEqual([13.9993, 10.4993]);
// note the Y coordinate (last above, first below) is as expected:
expect(layer9yz).toEqual([10.3936, 14.200000000000001])
expect(layer0yz).toEqual([10.4993, 14.200000000000001])
})
})
expect(layer9yz).toEqual([10.3936, 14.200000000000001]);
expect(layer0yz).toEqual([10.4993, 14.200000000000001]);
});
});
});
4 changes: 2 additions & 2 deletions packages/omezarr/src/sliceview/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ function getVisibleTilesInLayer(
return visibleTiles;
}
/**
* get tiles of the omezarr image which are visible (intersect with @param camera.view).
* @param camera an object describing the current view: the region of the omezarr, and the resolution at which it
* get tiles of the omezarr image which are visible (intersect with @param camera.view).
* @param camera an object describing the current view: the region of the omezarr, and the resolution at which it
* will be displayed.
* @param plane the plane (eg. 'xy') from which to draw tiles
* @param planeIndex the index of the plane along the orthogonal axis (if plane is xy, then the planes are slices along the Z axis)
Expand Down
2 changes: 1 addition & 1 deletion packages/omezarr/src/sliceview/tile-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type Props = {
B: REGL.Texture2D;
};
/**
*
*
* @param regl an active REGL context
* @returns a function (regl command) which renders 3 individual channels as the RGB
* components of an image. Each channel is mapped to the output RGB space via the given Gamut.
Expand Down
14 changes: 7 additions & 7 deletions packages/omezarr/src/zarr-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async function mapAsync<T, R>(arr: ReadonlyArray<T>, fn: (t: T, index: number) =
return Promise.all(arr.map((v, i) => fn(v, i)));
}
/**
*
*
* @param url a url which resolves to an omezarr dataset
* @returns a structure describing the omezarr dataset. See
* https://ngff.openmicroscopy.org/latest/#multiscale-md for the specification.
Expand Down Expand Up @@ -114,7 +114,7 @@ export type ZarrRequest = Record<OmeDimension, number | Interval | null>;
* an example relative view of [0,0],[1,1] would suggest we're trying to view the entire slice at the given resolution.
* @param displayResolution
* @returns an LOD (level-of-detail) layer from the given dataset, that is appropriate for viewing at the given
* displayResolution.
* displayResolution.
*/
export function pickBestScale(
dataset: ZarrDataset,
Expand Down Expand Up @@ -146,7 +146,7 @@ export function pickBestScale(
const choice = datasets.reduce(
(bestSoFar, cur) =>
dstToDesired(vxlPitch(planeSizeInVoxels(plane, axes, bestSoFar)!), pxPitch) >
dstToDesired(vxlPitch(planeSizeInVoxels(plane, axes, cur)!), pxPitch)
dstToDesired(vxlPitch(planeSizeInVoxels(plane, axes, cur)!), pxPitch)
? cur
: bestSoFar,
datasets[0]
Expand All @@ -172,9 +172,9 @@ export function sizeInUnits(
plane:
| AxisAlignedPlane
| {
u: OmeDimension;
v: OmeDimension;
},
u: OmeDimension;
v: OmeDimension;
},
axes: readonly AxisDesc[],
dataset: DatasetWithShape
): vec2 | undefined {
Expand Down Expand Up @@ -211,7 +211,7 @@ export function sizeInVoxels(dim: OmeDimension, axes: readonly AxisDesc[], datas
}
/**
* get the size of a plane of a volume (given a specific layer) in voxels
* see @function sizeInVoxels
* see @function sizeInVoxels
* @param plane the plane to measure (eg. 'xy')
* @param axes the axes metadata of an omezarr object
* @param dataset a layer of the ome-zarr resolution pyramid
Expand Down
2 changes: 1 addition & 1 deletion packages/scatterbrain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@
"lodash": "^4.17.21",
"regl": "^2.1.0"
}
}
}
8 changes: 4 additions & 4 deletions packages/scatterbrain/src/abstract/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export type Renderer<Dataset, Item, Settings, GpuData extends Record<string, Reg
* fetch raw, expensive-to-load content (an "Item" is a placeholder for that content)
* @param item An item to fetch content for
* @param dataset the dataset which owns the given item
* @param settings
* @param settings
* @param signal an AbortSignal that allows the fetching of content to be cancelled
* @returns a map of meaningful names (eg. position, color, amplitude, etc) to functions that promise raw content, like pixels or other raw, renderable information.
* expect that the functions returned in this way have closures over the other arguments to this function -
Expand All @@ -38,7 +38,7 @@ export type Renderer<Dataset, Item, Settings, GpuData extends Record<string, Reg
signal?: AbortSignal
) => Record<string, () => Promise<ReglCacheEntry>>;
/**
*
*
* @param cacheData the results of fetching all the content for an Item
* @returns true if the content matches the expectations of our rendering function
*/
Expand All @@ -65,15 +65,15 @@ export type Renderer<Dataset, Item, Settings, GpuData extends Record<string, Reg
* @param item the item we're caching the data for
* @param requestKey a key of gpuData (TODO: make this fact official via Typescript if possible)
* @param data the dataset that owns the given item
* @param settings the configuration of the current rendering task
* @param settings the configuration of the current rendering task
* @returns a string, suitable for use in a cache
*/
cacheKey: (item: Item, requestKey: string, data: Dataset, settings: Settings) => string;
/**
* in some cases, rendering may rely on non-item-specific rendering resources (lookup tables, buffers, etc)
* this function is the place to release those
* @param regl the regl context (the same that was used to create this renderer)
* @returns
* @returns
*/
destroy: (regl: REGL.Regl) => void;
};

0 comments on commit 22e8aa0

Please sign in to comment.