Rotation center moves in Ctrl+Alt+Drag

Dear All,

I’m trying to use the Ctrl+Alt+Drag to rotate the volume interactively. However the Center seems moving with rotation.

But this only seems happen when I have a customized layout (shown in the video). This moving-center does not happen in standard layout such as the Four-Up and others.

Thanks for any hint!


Slice rotation centerpoint is computed automatically as the average of all slice intersections visible in that view (see implementation here). Probably the issue is that the theoretically parallel G1 slice is not perfectly parallel (due to numerical precision issues) with the G slice, therefore it intersects with the G slice (the intersection appears just outside the displayed image region at the bottom), moving the average intersection position lower.

If you want your (R, G, Y) and (R1, G1, Y1) views move in two groups then assign two different view group IDs to them (e.g., 0 and 1). If you want them all move together then in the if (vtkLine::Intersection... line add a check that if the two lines are almost parallel (e.g., angle difference is less than 3 degrees) and if they are parallel then ignore that intersection.

Thanks Andras! I’ll follow this direction and investigate more.

Hi Andras,

I followed your suggestion on the “checking for parallelism” and it worked. I submitted a pull request.

On the other hand, towards your other suggestion about “assigning group IDs to different views”, could I have some suggestions on how to achieve that? or could i have some example modules to study?


1 Like

See description of view groups and API to set it here: Slicer: vtkMRMLAbstractViewNode Class Reference

You can set the view group of a view node in the GUI in “View controllers” module’s Advanced section.

Thanks Andras! Will check that.