cellmap_flow.io.ome
OME-NGFF coordinate conventions.
OME-NGFF places translation at the centre of voxel 0 (Neuroglancer’s
ome.ts subtracts half a voxel for the same reason), while everything in
cellmap-flow works with the lower corner of voxel 0. Readers convert with
ome_corner and writers with ome_translation; nothing else should
add or subtract half a voxel. multiscales_attrs writes the attributes.
Attributes
Functions
|
The lower corner of voxel 0, from an OME-NGFF |
|
The OME-NGFF |
|
OME-NGFF |
|
|
Module Contents
- cellmap_flow.io.ome.ome_corner(translation: Sequence[float], scale: Sequence[float]) List[float]
The lower corner of voxel 0, from an OME-NGFF
translation.Janelia pyramids store
translation = scale/2 - 4per level, so every level’s corner is -4 nm; read as a corner, each level sat half its voxel off (s1 8 nm, s2 16 nm) and the levels did not even agree with each other.translationandscalemust be in the same units.
- cellmap_flow.io.ome.ome_translation(corner: Sequence[float], scale: Sequence[float]) List[float]
The OME-NGFF
translation(voxel-0 centre) for a lowercorner.
- cellmap_flow.io.ome.CHANNEL_AXIS_NAMES = ('c', 'c^', 'channel')
- cellmap_flow.io.ome.multiscales_attrs(axes: Sequence[str], units: Sequence[str], levels: Sequence[Tuple[str, Sequence[float], Sequence[float]]], name: str = '', version: str = '0.4') Dict[str, Any]
OME-NGFF
{"multiscales": [...]}attributes for a pyramid.levelsare(path, voxel_size, corner), one entry per axis inaxesorder, withcornerthe lower corner of voxel 0. Spatial axes gettranslation = corner + voxel_size / 2and the unit fromunits; the channel axes (named “c”, “c^” or “channel”) are written as they are, with type “channel” and no unit.voxel_sizeis written as given.
- cellmap_flow.io.ome.singlescale_attrs(arr_name: str, voxel_size: Sequence[float], offset: Sequence[float], units: Sequence[str], axes: Sequence[str]) Dict[str, Any]
multiscales_attrsfor one arrayarr_namewhose voxel 0 has its lower corner atoffset.Writing the corner as the translation put every output half a voxel off in Neuroglancer and in any OME reader.