As I read in another thread link and have been observing when I export the coordinates from slicer to .json the coordinates are saved in LPS instead of RAS.

I wanted to transform some coordinates by using the transformation matrix given in Slicer, however, the transformation matrix is based on RAS. Is there a quick way to solve this? I’ve tried to just change the T(1,4)=T(1,4)-1 and T(2,4)=T(2,4)-1, but as I also have rotation this is not sufficient. My question is, what can I do with the rotation part to get the correct transformation matrix? When I store the transformation it is not converting to LPS as the spatial coordinates.

I am using the transformation matrix because I was not able to store my sequence of points in the transformed location. If there is a quick way to do this, that would also be perfect.

RAS to LPS involves negating values of the first two coordinates (X,Y). However, if you are going to save this, you also need to make sure that you change the coordinate system definition from 0 (RAS) to 1 (LPS) in the JSON header, so that Slicer interprets it correctly.

Why weren’t you able to save your points in the transformed location? You can either save the whole scene which should preserve all nodes, and hierarchies. Or you can “harden” (i.e., apply) the transform to the fiducial node and save. if you do this all points would be in the new transformed coordinates.

Transforms (and all other node types) are saved to files in LPS coordinate system.

When your save transforms to files then there is a switch of direction (modeling/resampling) as well, because ITK transform files store the resampling transform (that is the inverse of the modeling transform). Probably that was what you did not expect. See detailed description here and example code to convert between RAS/LPS and modelling/resampling transform here.

Thanks. I was able to save the Closed Curves and Fiducial nodes by “hardening”, but not with a sequence of curves. For context, I have annoted the annulus during the cardiac cycle, and wanted to transform all the annular curves to a new location, not only one.

By saving i mean exporting them to .json. I got problems when I exported the coordinates to .json which then converted the points from RAS to LPS, but I was using the same T-matrix as given in Slicer (i.e in RAS).

Thanks.
Problem for me was that i was not able to save the sequence of points in the transformed location, even with the hardening.
Thanks for the example code, it seems easier than what I ended up doing. Which was:

Import coordinate from .json (LPS)
Convert to RAS
Apply T-matrix from transformation to RAS coordinate
Convert back to LPS.