Re: How to export programmatically a volume with IVOLUME to images [message #60334 is a reply to message #60330] |
Mon, 19 May 2008 19:08   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
yingjie, Peng writes:
> 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 =3D itgetcurrent(TOOL=3DoTool)
> temp =3D oTool->FindIdentifiers('*DATA SPACE',/VISUALIZATIONS)
> idDataSpace =3D temp[0]
> oDataSpace =3D oTool->GetByIdentifier(idDataSpace)
> oDataSpace->GetProperty, PARENT=3DoDataSpaceRoot
> oDataSpaceRoot->Rotate, [0,0,1], 20
> oTool->RefreshCurrentWindow
>
> But after hours=92 attempt, I still do not know how to export the image
> from the ivolume. Of course I can choose =93export=94 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=85
>
> I am not experienced at all with iTools Object Classes and any
> suggestions or clues would be greatly appreciated.
Somehow (I don't have the foggiest idea about how) you have
to get the ID of the draw widget the volume is displayed in.
From there you can get the window object:
Widget_Control, drawWidgetID, Get_Value=windowObject
Then, you can take a snapshot of the window as an image:
windowObject -> GetProperty, Image_Data=snapshot
From there, you can just write any kind of file you like:
Write_JPEG, 'frame_1.jpg', snapshot, TRUE=1
I guess the key would be figuring out how to get the draw
widget ID.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|