# Plane markup json files - how to create "baseToNode" and "orientation" matrices

Hi,
I’m looking into using slicer for the visualisation of results from another tool. Therefore, I’d like to import plane definitions to quickly inspect whether they are as expected.
I use a point and normal vector in world coordinates. I keep the rest of a slicer generated json file as template while replacing “center” and “normal”.
The “objectToBase” matrix seems straight forward enough the conversion between the image orientation to the default LPS orientation of the markups.
But it’s not immediately clear how the “baseToNode” and “orientation” matrices are defined and I can’t find a reference. I hoped I could omit those in the definition as the point and normal should be sufficient for defining a plane (to my needs). This does not seem to be the case so I assume I will have to calculate the matrices to make Slicer read my file.

Could someone point me to a resource of how these should behave or how they would be calculated based on the point and normal vector? Much appreciated!

Definition of these coordinate systems are here.

If you specify a plane by a single point (`"planeType": "pointNormal"`) then you only need to specify:

• plane position: position of the one and only control point
• plane orientation: `baseToNode` matrix. Note that a plane in mathematical sense is specified by a position and a normal, but if you want to display a plane then you need to specify its rotation around that normal. `baseToNode` contains the two axis of the plane and the plane normal. If you don’t care about the rotation then you can choose an arbitrary orientation and use cross product with the normal vector to make it orthogonal to the normal vector. Translation component of `baseToNode` matrix is ignored (because position is set by the control point), so it can be set to `0.0, 0.0, 0.0`.
• plane bounds: specifies how far the plane extends in 4 directions (-x, +x, -y, +y) from the plane position

Example:

``````{
"markups": [
{
"type": "Plane", "coordinateSystem": "LPS", "planeType": "pointNormal",
"baseToNode": [
-0.7177763971220261, -0.48438183588553957, -0.5001712514716112, 0.0,
0.3974111999339178, -0.8748566951587867, 0.2769297764830091, 0.0,
-0.5717179216201003, -1.1102230246251565e-16, 0.820450253274623, 0.0,
0.0, 0.0, 0.0, 1.0],
"planeBounds": [-50.0, 50.0, -50.0, 50.0],
"controlPoints": [{ "position": [60.6068749511193, -26.833897399804197, -175.25000000000006] }],
"display": { "visibility": true, "opacity": 1.0, "color": [0.4, 1.0, 1.0] }
}
]
}``````