Fiducial spheres are distorted near the edge of 3D views in orthographic display

I just noticed an interesting optical feature. I’m not sure if this is a bug or normal. For context, I display CT images with volume rendering in orthographic mode. I need to zoom out a lot to see whole image. I noticed that markup fiducial spheres look distorted near the edges of views, when the camera distance is large (meters). Markups look like an eggs, instead of a spheres.
Orthographic views do not distort the images near the edges, that’s why I’m using that option. E.g. in the screenshot below, the skeleton looks undistorted. It seems like the fiducial spheres are not rendered using the same method as the volume.
Would there be a way to make markup points always look like spheres in orthographic mode, regardless of camera position and zoom?
image

It should not be possible to adjust field of view by adjusting camera distance in parallel projection mode. Maybe if you set the camera distance to extremely large values then numerical issues start to change size of rendered objects as a side effect (effectively it breaks the rendering).

You need to use SetParallelScale to change field of view in parallel projection mode.

Nevertheless, markups should not be rendered using perspective projection (which seems to be the case) if the view is in parallel projection mode. Do you have a script that reproduces this behavior?

Here are the steps to reproduce:

  • Open Slicer (optionally switch to 3D-only layout, so you see better)
  • Add one or more fiducials near the center of the 3D view
  • Set orthographic view in the 3D view
  • In Markups display, set large glyph sizes so you can see them as spheres from far
  • Scroll your mouse wheel to create some distance between the camera and the fiducials
  • Pan the 3D view (shift+drag) so the fiducials get to the edge of the 3D view.
    At this point you will see that the fiducial spheres turn into eggs.

You only need roll your mouse wheel 2-3 times (about 1 meter in RAS) to reproduce very distorted spheres.

Here is a screen recording: https://1drv.ms/v/s!AhiABcbe1DByg9ABrKXWeinra6u56g

I’m sure the problem is that markups are not rendered with the same method as other objects in the 3D view. As a workaround, I can set camera position (in Python) to very far from my markups. In parallel projection, camera position does not matter anyway. Increasing camera-fiducial distance doesn’t change anything in the rendered CT volume, but it reduces the distortion of markups. So it’s a good way to work around this bug (in parallel/orthographic projection at least).

I’ve managed to fix the issue.

It was quite tricky - see here. vtkGlyph3D’s glyph orienting feature only supports facing “towards a point”. To achieve parallel direction, we need to move the reported camera position to a distant point.

1 Like