Mirroring a rotation around the axis for a transform node

Is it possible to mirror a rotation around the axis in a simple way (not making negative specific elements of the matrix) for a transform node?

For example the code:

vtkMRMLLinearTransformNode* gantryToFixedReferenceTransformNode =
this->GetTransformNodeBetween(Gantry, FixedReference);
vtkTransform* gantryToFixedReferenceTransform = vtkTransform::SafeDownCast(gantryToFixedReferenceTransformNode->GetTransformToParent());
gantryToFixedReferenceTransform->Identity();
gantryToFixedReferenceTransform->RotateY(beamNode->GetGantryAngle());
gantryToFixedReferenceTransform->Modified();
... some other code ...
gantryToFixedReferenceTransform->MirrorY(); // mirror the rotation
gantryToFixedReferenceTransform->Modified();

Without mirror (not very good):
Screenshot_2

With mirror (much better):
Screenshot_3

You can mirror by calling vtkTransform::Scale. Use -1 as scale factor for the axes you want to mirror around and 1 for other axes. Note that for moving physical objects it should not be ever necessary to mirror (as you cannot mirror physical objects in real life either), but you can achieve all physically possible displacements by translate and rotate methods.

It’s safer use rotation on a negative angle for a simple task, i think.

transform->Identity();
transform->RotateY(angle);
transform->Modified();
... some other code ...
transform->Identity();
transform->RotateY(-1. * angle); // mirror the rotation
transform->Modified();