Keep position and orientation of segmentation when saving

Operating system: Win 10
Slicer version: Current Nightly
Expected behavior: surface model from segmentation should be in correct position with respect to volume
Actual behavior: surface model from segmentation is shifted somewhere

I want to segment a rib from a dataset and save it as a ply file. However, the exported model is not at the correct position but shifted somewhere. How do I keep the transform of the anatomical dataset so that the segmented model remains at the correct position? I would expect this to be the default behaviour.

Does the exported model appear in the correct position in Slicer?
If you save the model to file and load it back to Slicer, does the exported model appear in the correct position?
Have you applied a transform on your Segmentation node?
Do you have this alignment problem when you load the surface mesh and volume in some other software?

It appears at the correct position in slicer, but not in external programs (Meshlab).
I did not apply any transform to it.

When I export the segmented model as a labelmap, import the label map in an other program (MeVisLab), and export it as ply, then it has the correct position.

It seems that I cannot choose a reference volume in model export in slicer; this is possible only for labelmap export. Maybe that’s why it is positioned at origin coordinates?

STL files cannot store in a standard way what unit and coordinate system is used and each software use different conventions. Following the solution described in this topic will most likely resolve the inconsistency for you:

https://discourse.slicer.org/t/misalignment-visualization-problem/821/2