Model/Markups Coordinate systems

I have a model, that I am exporting from 3D slicer by right clicking the model and exporting to file- selecting stl. There is no option to choose coordinate system. I also have a list of closed curves that I want to output as .fcsv point list to send to SpaceClaim. But when I load the stl, and point cloud, they are no longer in the same coordinate system. What can I do to ensure that they are aligned correctly?

All models and markups are written as left handed coordinate system in the Slicer. I am not sure what coordinate system SpaceClaim uses or assumes with the data. I assume when you mean they no longer in the same coordinate system, markups doesn’t overlap with model? If so, you can try changing the signs the first two coordinates of the markups in your fcsv file and see that helps.

Slicer saves all data (markups, models, images, transforms, etc.) in LPS coordinate system by default. For compatibility with legacy software that uses RAS coordinate system, Slicer can also save in RAS, and it adds this information to the STL file header. However, if you edit the STL file in some software and that software removes the coordinate system information from the header, then Slicer will interpret the file as LPS by default, while the coordinates were actually in RAS. When you load such file, choose to use RAS in the additional options section of the “Add data” window:

By default, the file will be saved in the same coordinate system. You can find out what it is by using this code snippet:

modelNode = getNode('BasePiece')
storageNode = modelNode.GetStorageNode()
print(slicer.vtkMRMLStorageNode.GetCoordinateSystemTypeAsString(storageNode.GetCoordinateSystem()))

If RAS is printed as a result, I would recommend to switch to LPS (as that is assumed by default by most software):

storageNode.SetCoordinateSystem(slicer.vtkMRMLStorageNode.GetCoordinateSystemTypeFromString("LPS"))