aschampion / h2n5

HTTP 2 N5: Serve N5 datasets over HTTP as tiled image stacks
Apache License 2.0
7 stars 0 forks source link

Advantages over Cloud Optimized Geotiff ? #67

Open Farkal opened 4 years ago

Farkal commented 4 years ago

Does h2n5 have any advantage to be used for tiled image instead of cog ? I know h2n5 serve n5 dataset so my question is more about the advantages between n5 and cog.

aschampion commented 4 years ago

N5 is for n-dimensional images and is in practice most often used for 3D to 5D data, whereas GeoTIFF, while it can be abused for higher dimensions, is primarily 2D. Also, N5 is a chunked format frequently used for petascale images where the data is split across many (often millions or more) separate files (or buckets, etc.) which may be important for particular mutation patterns or filesystem performance properties. COG's intra-file chunking behavior is more similar to other n-dimensional formats like KLB (or older HDF5), in contrast to N5's many file approach which is similar to Zarr.

As for H2N5 vs COG: for 2D data COG is going to be much more efficient because by my quick reading it's using range information to read out from the GeoTIFF files directly, while H2N5 is decompressing, slicing, and re-encoding from potentially many N5 files on the fly.

H2N5 is generally used as a bridge to connect legacy bioimage analysis software that expects 3D image tile pyramids in a format for a tool called CATMAID to the more recent N5 format, so if you don't already have that use case is unlikely to be the best option for your problem.

Farkal commented 4 years ago

Waow quick and precise answer ! Thx very much ! I am also interested in the Zarr format but it's not mature enough :confused: