Skip to content

N5 Metadata Dialects

John Bogovic edited this page Aug 26, 2021 · 11 revisions

N5 Metadata Dialects

This page contains a list and description of known n5 metadata dialects.

N5-viewer

The n5-viewer metadata style is briefly described here.

Dataset-level attributes

Datasets may contain a pixelResolution field that is either

"pixelResolution": {
   "unit": "um",
   "dimensions": []
}

or

"pixelResolution": []

Datasets may contain a downsamplingFactors field.

  • pixelResolution: number[] or object
    • physical scale factors and units (see Physical space)
  • downsamplingFactors: number[]
    • factors by which the image is downsampled (see Downsampling)

BigCat

This metadata specification is used by BigCat, the predecessor to Paintera.

Example

{
    "resolution": [ ],
    "offset": [ ],
    "downsamplingFactors": [ ]
}
  • resolution: number[]
    • physical scale factors (see Physical space)
  • offset: number[]
    • physical translation (see Physical space)
  • downsamplingFactors: number[]
    • factors by which the image is downsampled (see Downsampling)

COSEM

The COSEM metadata style is described here.

Dataset-level attributes

Datasets shall contain a transform field that describes how the discrete pixel grid should be arranged in physical space.

"transform": {
    "axes": [ ], 
    "units": [ ],
    "scale": [ ],
    "translate": [ ]
}

All fields below must have lengths equal to the dimensionality of the n5 dataset they describe.

  • axes: String[]
    • gives a label to axis indexes
    • examples: ["x","y","z"], ["z","y","x"]
  • units: String[]
    • the physical
    • examples ["nm","nm","nm"], ["microns","microns","microns"]
  • scale: number[]
    • physical scale factors (see physical space)
  • translate: number[]
    • physical translation (see physical space)

ImageJ

The ImageJ metadata dialect mirrors the metadata stored in ImageJ's ImagePlus class. Images of up to five dimensions are supported, i.e. 3D, multi-channel, time-series can be described with this dialect. This standard does not support multiscale datasets.

Dataset-level attributes

Concepts

Physical space

Call the 0th, 1st, and 2nd dimensions of the dataset i, j, and k, respectively. Then if axis: ["x","y","z"], then The discrete point at (i,j,k), should be mapped to the physical point (x,y,z) as follows:

x = (scale[0] * i) + translate[0]
y = (scale[1] * j) + translate[1]
z = (scale[2] * k) + translate[2]

Downsampling

The N5-viewer and BigCat dialects assume downsampling is done in a particular way such that it affects both the scale and translation of the physical space. Given a scale and downsamplingFactors discrete coordinates are mapped to physical space with:

x = (scale[0] * downsamplingFactors[0] * i) + (scale[0] * (downsamplingFactors[0] - 1))
y = (scale[1] * downsamplingFactors[1] * j) + (scale[1] * (downsamplingFactors[1] - 1))
z = (scale[2] * downsamplingFactors[2] * k) + (scale[2] * (downsamplingFactors[2] - 1))

similar to the above.