-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSimpleHttpTest.cs
More file actions
25 lines (21 loc) · 827 Bytes
/
Copy pathSimpleHttpTest.cs
File metadata and controls
25 lines (21 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using ZarrNET.Core.Helpers;
using ZarrNET;
using ZarrNET.Core;
using ZarrNET.Core.OmeZarr;
namespace ZarrNET
{
public static class SimpleHttpTest
{
public async static void Start()
{
// Simple test with public IDR dataset
var url = "https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.4/idr0062A/6001240.zarr";
await using var reader = await OmeZarrReader.OpenAsync(url);
var image = reader.AsMultiscaleImage();
var level = await image.OpenResolutionLevelAsync(0);
Console.WriteLine($"Array shape: [{string.Join(", ", level.Shape)}]");
var plane = await level.ReadPlaneAsync(t: 0, c: 0, z: 0);
Console.WriteLine($"Downloaded plane: {plane.Width}x{plane.Height}, {plane.Data.Length:N0} bytes");
}
}
}