Have you updated your camera as well? The rendered slice respects world orientation, so showing a Y-slice when the camera is looking down the Z axis will “disappear” from the camera’s POV.
I’m switching between different slicing modes (X, Y, Z) within the image-slicing.js to view the volume from different planes (axial, sagittal or coronal).
If I change mapper.setSlicingMode(SlicingMode.Z) to mapper.setSlicingMode(SlicingMode.Y) or mapper.setSlicingMode(SlicingMode.X), the renderWindow just turns black. I know that I have to update the camera properties, just not sure which values to set for each slicing mode.
When you change slicing mode, your camera focal point does not change.
You only need to change the camera position.
It should be newCameraPosition = focalPoint + distance * newSlicingNormal. where distance could be the one before changing the slicing mode: distance = cameraPosition - focalPoint.