Skip to content

Named Spaces for Transformations

John Bogovic edited this page Jan 26, 2022 · 4 revisions

Named Spaces

  • A named space is set of named axes
  • There is a default named space for "raw" data
  • Do we allow a named space to be (S \cross T) where S and T are named spaces?

Examples

{
"name": "raw", 
"axes": [{"name": "dim_0"}, {"name": "dim_1"}, {"name": "dim_2"}]
}
{
"name": "physical", 
"axes": [
  {"name": "z", "type": "space", "unit": "micrometer"}, 
  {"name": "y", "type": "space", "unit": "micrometer"},
  {"name": "x", "type": "space", "unit": "micrometer"}]
}
{
"name": "template", 
"axes": [
  {"name": "template_z", "type": "space", "unit": "micrometer"}, 
  {"name": "template_y", "type": "space", "unit": "micrometer"},
  {"name": "template_x", "type": "space", "unit": "micrometer"}]
}

Transforms

  • A transformation's inputs are points in one named space, and its outputs are points in another
    • so a transform specifies its input and output spaces
    • dimensionality must match of course
  • Transforms should have an id (and/or name).
    • Likely should allow referencing of transformations
    • already need this if we store transform parameters as binary data in ngff datasets for precision purposes

Examples

{
"type": "scale",
"scale" : [1.1, 1.1, 2.2],
"name": "to_physical",
"source_space" : "raw",
"destination_space" : "physical"
}
{
"type": "displacement_field",
"path" : "registration/transform",
"name": "to_template",
"source_space" : "physical",
"destination_space" : "template"
}

Applying transforms and order

In many cases, a stack of transforms can be applied in sequence.

Example: The raw data ijk are converted to xyt through two transforms, one that maps S: ij -> xy, and the other that maps T: k -> t. In this case, because the input / output dimensions are orthogonal, the composed transforms S after T or T after S. These transforms need to be aware of which axes they operate on, slice their inputs appropriately, and write their output to the appropriate dimensions.

This is not the case in general though - if dimensions are mixed, then order matters. Having a sequence of transforms is a useful thing.

Another case to consider - order will matter when performing gamma transforms of color followed by Linear interpolation over space, even though the dimensions these transforms work on are orthogonal.

See also