|
1 | 1 | import { expect, test } from 'vitest'; |
2 | 2 | import * as zarr from 'zarrita'; |
| 3 | +import { load as loadOme } from '../src/zarr/ome-zarr'; |
3 | 4 | import { createStoreFromMapContents } from './base64-store'; |
4 | 5 |
|
5 | 6 | import ome_ngff_0_4_fixture from './fixtures/ome-zarr/blobs_image_v04.ome.zarr.json'; |
@@ -35,3 +36,25 @@ test('Check that JSON-based store fixtures can be loaded: NGFF v0.5', async () = |
35 | 36 | expect.arrayContaining(['omero', 'version', 'multiscales']) |
36 | 37 | ); |
37 | 38 | }); |
| 39 | + |
| 40 | +test('Test loadOme function with NGFF v0.4 image', async () => { |
| 41 | + const store = createStoreFromMapContents(ome_ngff_0_4_fixture); |
| 42 | + const { data, metadata } = await loadOme(store); |
| 43 | + |
| 44 | + expect(data).toBeTruthy(); |
| 45 | + expect(metadata).toBeTruthy(); |
| 46 | + expect(metadata.multiscales[0].name).toEqual('/images/blobs_image'); |
| 47 | + expect(data.length).toBe(1); // One resolution |
| 48 | + expect(data[0].labels).toEqual(['c', 'y', 'x']); |
| 49 | +}); |
| 50 | + |
| 51 | +test('Test loadOme function with NGFF v0.5 image', async () => { |
| 52 | + const store = createStoreFromMapContents(ome_ngff_0_5_fixture); |
| 53 | + const { data, metadata } = await loadOme(store); |
| 54 | + |
| 55 | + expect(data).toBeTruthy(); |
| 56 | + expect(metadata).toBeTruthy(); |
| 57 | + expect(metadata.multiscales[0].name).toEqual('/images/blobs_image'); |
| 58 | + expect(data.length).toBe(1); // One resolution |
| 59 | + expect(data[0].labels).toEqual(['c', 'y', 'x']); |
| 60 | +}); |
0 commit comments