When I reflect a model node using a linear transform node that has a reflection, the visualization of it in 3D unexpectedly turns black. I gather from other posts and LLM consultation that this is because a transform with negative determinant turns the model “inside-out”. The surface normals are properly reflected, but the clockwise/counterclockwise sense of which side of a surface facet is the “front” is reversed by the reflection. Thus when the renderer is trying to figure out how to light a facet, the surface normal for the “front” actually points out the “back” of the facet, and this results in no color or light at that facet, it’s just black (note that this is somehow different than just flipping the normal vectors, in which case you would see the backface color lighting rather than black). The proper way to address this is to apply a vtkReverseSense() filter, which flips the facet orientation back the other way around. My suggestion is that Slicer should do this sense reversal under transformation with negative determinant automatically. I think that even relatively sophisticated users used to applying all sorts of transformations to all sorts of MRML nodes will find the current behavior surprising and undesirable. Is there any use case where a user would actually want their transform to make their surface unlightable in this way?
Background context: I am constructing a heatmap of a brain structure in a standardized coordinate system for something like a probabilistic atlas of its location. Since there is bilateral symmetry in the brain, I am reflecting all of the left side structures to the right to make a combined map with a “lateral” coordinate rather than a R/L coordinate. I was surprised and confused when some of the models turned black and were impervious to lighting changes. I realized that it was all of the reflected versions that were like this and I spent a lot of time trying to figure out what was different before coming across the explanation above. The typical experience of applying transforms to nodes in Slicer is that they “just work”, but in this case it felt like it broke the models in a way that was not easy to understand.
