vtkInteractorStyleMPRSlice setSliceNormal not working consistently

Hi guys,

I’m facing a problem with rendering for vtkInteractorStyleMPRSlice. I’m not sure if it’s a React issue, but it seems like this bug only happens when I try to set the slice normal to [0, 1, 0] in the Y axis.

My idea is to have the 3D view of a volume with the X/Y/Z orientation in a split screen like in vtk glance. I have done this by setting up the volume and volumeMapper and setting the slice normal to [1, 0 ,0] , [0, 1, 0] and [0, 0, 1] for X/Y/Z orientations respectively. Each of the view you see are all different renderers/renderWindow/volumes (but from the same reader).

At first render, everything seems to be working fine. The trouble comes in when I upload another file (different set of data) and render everything again. The Y Orientation view now displays blank:

I have tried to change my code to see if it’s really the orientation that’s causing the problem. Sure enough, when I changed all my slice normals to [0, 1, 0]. Nothing renders for any file after the first file has been loaded.

Anyone has any clue why is this happening?

You might want to double check on your Y view camera (position, focal point, clipping planes…).
maybe your new dataset has very different bounds.

Even if that were the case, I have tried uploading the old dataset back again (so dataset_1 → dataset_2 → dataset_1) and the Y still displays blank.

It appears I may have solved it. Apparently the view up vector wasn’t set right for Y axis upon computation within the interactor style (some floating precision error). Once I fixed that, the view started showing up.

Hi Darren, I am facing a similar issue wherein I am unable to render for slice normal [1,0,0].
Can you tell me how you recomputed the view up vector for the floating precision error?

I didn’t do anything special haha. I just recomputed the vector following the source code, but accounting for the error. Then, I get the active camera from the renderer and set the view up vector from there. All this happens after setting the slice normal. (Double computation but what can you do :frowning: )