I use an approach that makes sure to rotate the whole dataspace of the iTool on display. Below is an example based on the built-in IDL example data in file 'head.dat':
PRO ex_ivolume_rotate_on_open
; Example data installed in every IDL
file = FILEPATH('head.dat', SUBDIRECTORY = ['examples', 'data'])
data = READ_BINARY(file, DATA_DIMS = [80, 100, 57])
ivolume, data
; Routine way to access iTools programatically
idTool = itgetcurrent(TOOL=oTool)
; In rotating a view most users want to rotate the whole data space
; of the iTool visualization. The safest place to do this is in a
; data space superclass object called the IDLitVisDataspaceRoot. If
; you were to rotate just the IDLitVisVolume object, the axes would
; be left behind, and that would not look so good.
temp = oTool->FindIdentifiers('*DATA SPACE',/VISUALIZATIONS)
idDataSpace = temp[0]
oDataSpace = oTool->GetByIdentifier(idDataSpace)
oDataSpace->GetProperty, PARENT=oDataSpaceRoot
; Rotate the whole visualization 20 deg around the Z-axis.
oDataSpaceRoot->Rotate, [0,0,1], 20
; The syntax for method ROTATE is in Online Help for "IDLitVisualization".
; You won't see the above change, if you do not do this.
oTool->RefreshCurrentWindow
; The above call will show the rotation, but it still does not render
; the IDLitVisVolume object (unless its AUTO_RENDER property is turned
; on). To render the volume in the display, do the following:
temp = oTool->FindIdentifiers('*VOLUME',/VISUALIZATIONS)
idVisVolume = temp[0]
oVisVolume = oTool->GetByIdentifier(idVisVolume)
oVisVolume->RenderVolume
END
|