I’m importing a 3d model created in another program and trying to align it with the same model created in Slicer, and I’m running into a problem with the normals of the model.
If you turn the model inside out (apply a linear transform with a matrix that has negative determinant) then the surface normals will be reversed, too. Using Surface Toolbox module is a good solution. Is there any specific reason you would only want to turn the surface inside out but not flip the normals?
It just seems counter-intuitive to me that reflecting the model through a plane would also flip the normals (but see above re: math & rusty). Hence my original question, is there a Transform matrix to do a reflection without also flipping the normals?
There is not. Inverting direction of axis turns the model inside out (the inside surface of the non-transformed model becomes outside surface in the transformed model).
You could do the flipping in Meshlab (it’s also free) before you import it into Slicer.
There you can flip the axis (Filters->Normals Curvature Orientation ->Transform, flip swap axis) and invert the faces orientation (Filters->Normals Curvature Orientation -> Invert faces orientation).
Thanks, @steffen-o . I’m trying to build a script to import files from another program into Slicer, so I’d prefer to do it all “in-house”.
In case anyone has the same problem in future, I was eventually able to flip surface models without inverting normals using the “Surface Toolbox” module’s Mirror operation.
Surface toolbox is a Python scripted module, which exposes a few VTK filters on the GUI. Of course you can use those VTK filters directly in your script.