Skip to content

Outdated text

John Bogovic edited this page Sep 11, 2022 · 1 revision

inputAxes and outputAxes

inputAxes and outputAxes are optional fields for transformations to express that it applies to a subset or reording of the axes of the input or output coordinate system, respectively. If not present, the inputAxes (outputAxes) are understood to be a list of the input (output) coordinate systems axis names, in the order they appear in the coordinate system's axes list. If present:

  • Values for inputAxes and outputAxes MUST be a list of strings.
  • Every string in the inputAxes list MUST be the name of an axis of the transformation's input coordinate system.
  • Every string in the outputAxes list MUST be the name of an axis of the transformation's output coordinate system.
  • Every axis name in the output coordinate system MUST in the list of outputAxes.

An identity may be used to permute axes by setting the inputAxes and / or outputAxes fields appropriately (see below).

{
    "coordinateSystems" : [
        { "name" : "in", "axes" : [ {"name" : "i"}, {"name" : "j"} ]},
        { "name" : "out", "axes" : [ {"name" : "x"}, {"name" : "y"} ]}
    ],
    "coordinateTransformations" : [ 
        { 
          "type" : "identity",
          "input" : "in",
          "output" : "out",
          "inputAxes" : ["i", "j"],
          "outputAxes" : ["y", "x"]
       }
    ]
}

defines the function:

x = j
y = i

A valid example

"coordinateSystems" : [ 
{ "name " : "in", "axes" : [ {"name" : "x", "name" : "y" }] }
{ "name " : "out", "axes" : [ {"name" : "x", "name" : "y" }] }
]
{
"type": "scale",
"scale" : [2],
"input" : "in"
"output" : "out",
"inputAxes" : ["y"],
"outputAxes" : ["y"]
}

scales the y axis only.

An invalid example

"coordinateSystems" : [ 
{ "name " : "in", "axes" : [ {"name" : "i", "name" : "j" }] }
{ "name " : "out", "axes" : [ {"name" : "x", "name" : "y" }] }
]
"coordinateTransformations" : [
{
    "type": "scale",
    "scale" : [2],
    "input" : "in"
    "output" : "out",
    "inputAxes" : ["j"],
    "outputAxes" : ["y"]
}
]

Is invalid because the axis name x of the output coordinate system does not appear in the list of outputAxes, nor does it appear in the axis names of the coordinate system in. Instead, a sequence transformation can be defined, such that every axis in the output space appears in at least one of the outputAxes of the sequence's transformations. For example (asuming the same coordinate systems as above):

{
"type": "sequence",
"transformations" : [
    {
	"type": "scale",
	"scale" : [2],
	"inputAxes" : ["j"],
	"outputAxes" : ["y"]
    },
    {
	"type": "identity",
	"inputAxes" : ["i"],
	"outputAxes" : ["x"]
    }
],
"input" : "in"
"output" : "out",
}

is valid.

Clone this wiki locally