Re: How to export programmatically a volume with IVOLUME to images [message #60330 is a reply to message #60321] |
Mon, 19 May 2008 20:12   |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
yingjie, Peng wrote:
> Dear all,
>
> I would like to make a short animation of my rotating volume data. I
> think this could be done by rotating the volume a small angle each
> time and export corresponding image and then put the images sequence
> together. One can use XVOLUME, XVOLUME_ROTATE and XVOLUME_WRITE_IMAGE
> to get this job done easily, however iVOLUME offers more possible
> choices of configurations, which I prefer to.
>
> I already figured out how to rotate the ivolume object
> programmatically by:
> idTool = itgetcurrent(TOOL=oTool)
> temp = oTool->FindIdentifiers('*DATA SPACE',/VISUALIZATIONS)
> idDataSpace = temp[0]
> oDataSpace = oTool->GetByIdentifier(idDataSpace)
> oDataSpace->GetProperty, PARENT=oDataSpaceRoot
> oDataSpaceRoot->Rotate, [0,0,1], 20
> oTool->RefreshCurrentWindow
>
> But after hours� attempt, I still do not know how to export the image
> from the ivolume. Of course I can choose �export� to file from the
> ivolume menu and then I have to do this hundreds of times to make a
> animation :(
> I found David had some similar explanations here:
> http://www.dfanning.com/itool_tips/newdata.html
> but it seems to me this will only work with iImage�
>
> I am not experienced at all with iTools Object Classes and any
> suggestions or clues would be greatly appreciated.
>
> with best regards,
> Yingjie
Just get the iTools window object and ask for its data:
IDL> f = filepath('head.dat', subdir=['examples', 'data'])
IDL> head = bytarr(80, 100, 57)
IDL> openr, lun, f, /get_lun
IDL> readu, lun, head
IDL> free_lun, lun
IDL> ivolume, head ; hit the "Render" button after it comes up
IDL> toolId = itgetcurrent(tool=tool)
IDL> win = tool->getByIdentifier('/tools/volume tool/window')
IDL> help, win
WIN OBJREF = <ObjHeapVar16322(IDLITGRWINSCENE)>
IDL> win->getProperty, image_data=im
IDL> help, im
IM BYTE = Array[3, 824, 589]
IDL> window, xsize=824, ysize=589
IDL> tv, im, true=1
This could be made more robust by using findIdentifiers (like in you
example) to get the ID since it won't always be '/tools/volume
tool/window' (like if you have multiple iVolume tools open).
Mike
--
www.michaelgalloy.com
Tech-X Corporation
Software Developer II
|
|
|