Rotate the 3D View

I know I can rotate the 3D view through the code.

layoutManager = slicer.app.layoutManager()
threeDView = layoutManager.threeDWidget(0).threeDView()
threeDView.yaw()

But how can I rotate 3D view at any angle I need?For example,I need to rotate it 7.2 degrees.

I really need your help!Deeply grateful!

For your case (7.2 deg to the right) you could use:

layoutManager = slicer.app.layoutManager()
threeDView = layoutManager.threeDWidget(0).threeDView()
threeDView.yawDirection = threeDView.YawRight
threeDView.setPitchRollYawIncrement(7.2)
threeDView.yaw()

Kind regards

3 Likes