Hi, I want to display one single 2D image in 3D view. I input the image as a volume node and apply a transform to it. However, if I try to make rotation / translation, the image in 3D view will become incomplete or disappeared. I think it is because the image in 3D view is only a slice with a fixed section and a limited area. How to display it under any transform? Thank you.
Displaying objects in the 3D view may require re-centering the view.
There is a button in the 3D view widget for re-centering the view:
(extracted from How, from python-scritps, to trigger the click-function of "center of the 3D view on the scene"? - #8 by aiden.zhu)
You can use the following python snippet if you prefer to do that programmatically (from Script repository — 3D Slicer documentation):
layoutManager = slicer.app.layoutManager() threeDWidget = layoutManager.threeDWidget(0) threeDView = threeDWidget.threeDView() threeDView.resetFocalPoint()
Thank you. I tried the "center view: button. Only when both the image and its rotation are on the plane of the slice, it works. In other cases, the image will also become incomplete or disappeared. I am looking for a method which can reformat the slice according to a given transform.
The Slice views represent planes in patient space (RAS). Your 2D image is also a plane in patient space, so if you move it with a transform it will no longer be the same as the slice view. You can reset a slice view to match the displayed volume with the Rotate to volume plane button. If you need to do this in python you can research the underlying logic API.