Hi folks,
I’m trying to create an extension which will calculate the angle of the default scene camera w.r.t. the subject in the slicer 3D scene. This would be analogous determining the C-Arm LAO/RAO and CRA/CAU angles for proper image orientation.
The calculation is pretty straightforward and can be done with nothing but the camera position and focal point, but I can’t seem to obtain these values using GetPosition and GetFocalPoint. Here are some code snips:
>>> defaultCam = slicer.mrmlScene.GetNodeByID('vtkMRMLCameraNode1')
>>> defaultCamPosition = defaultCam.GetPosition()
>>> print(defaultCamPosition)
_000001eb844fabd8_p_void
On the other hand, GetCameraAngle does function as expected:
>>> viewAngle1 = defaultCam.GetViewAngle()
>>> print(viewAngle1)
30.0
Additionally, both SetPosition and SetFocalPoint function as expected. In fact, all of these are listed as valid member functions for the vtkMRMLCameraNode Class:
Finally, if I browse to this node in the slicer data module, all of these values are listed in the node information.
Any ideas on how to programmatically obtain the default scene camera position and focal point values?
Thanks for the help.