comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: programming with itools
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: programming with itools [message #66993 is a reply to message #66992] Fri, 26 June 2009 10:47 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
Anne Martel wrote:
> I've finally decided to try to figure out how to use iTools and with
> the help of the examples on michael galloys page, searching through
> code in the idl distribution and a lot of trial and error I have
> managed to setup a viewer with 2 windows, one showing a volume and the
> other showing a slice through the volume.
>
> I am stuck on a couple of things (well more than a couple but this is
> my immediate problem)and was hoping that the solutions are obvious to
> people who have played with itools more than I have:
>
> a) why does the line
> oimplane -> setproperty, orientation = 'Z'
> not have any impact on the orientation - it always sets to the default
> x orientation?
>
> b) is there any way of setting the 2nd viewport to iimage, ie no axes
> or rotations
>
> The procedure I have so far is:
>
> ivolume,/test,view_grid=[2,1]
> id = itGetCurrent(tool=otool)
> vol_id = otool->findIdentifiers('*data_space/volume', $
> /visualizations)
> ovol = otool->getByIdentifier(vol_id)
>
> ;this bit sets up an image plane
> ops_id = otool->findIdentifiers('*imageplane*', /operations)
> oimplane = otool->getByIdentifier(ops_id)
> ;this next line doesn't do anything!
> oimplane -> setproperty, orientation = 'Z'
> result = otool->doAction(ops_id)
>
> ;now grap the data for the image plane
> oSelVis = oTool->GetSelectedItems(count=nSelVis)
> oData = oSelVis->GetParameter('IMAGEPIXELS')
> strToolID = IDLitSys_CreateTool("Image Tool",/view_next,initial_data =
> oData, visualization_type='IDLIMAGE')
> oNewTool = oTool->GetByIdentifier(strToolID)
> oCreateVis = oNewTool->GetService("CREATE_VISUALIZATION")
> oParmSet = OBJ_NEW('IDLitParameterSet', $
> DESCRIPTION='Image Plane', NAME='Image Plane',$
> TYPE='Image', ICON='image')
> ; hook up the plane data
> oParmSet->Add, oData, PARAMETER_NAME='IMAGEPIXELS', /
> PRESERVE_LOCATION
> oCommandSet = oCreateVis->CreateVisualization(oParmSet, "IMAGE")
> ; amazingly the plane image updates when the volume plane is moved!
>
> any suggestions gratefully received,
> Anne

Try this:

ivolume, /test, view_grid=[2, 1]
id = itGetCurrent(tool=otool)
vol_id = otool->findIdentifiers('*data_space/volume', /visualizations)
ovol = otool->getByIdentifier(vol_id)

; this bit sets up an image plane
ops_id = otool->findIdentifiers('*imageplane*', /operations)

result = otool->doAction(ops_id)
planeId = otool->findIdentifiers('*image plane*', /vis)
oimplane = otool->getByIdentifier(planeId)
oimplane->setProperty, orientation=2

; now grab the data for the image plane
oSelVis = oTool->GetSelectedItems(count=nSelVis)
oData = oSelVis->GetParameter('IMAGEPIXELS')
strToolID = IDLitSys_CreateTool('Image Tool', /view_next,
initial_data=oData, $
visualization_type='IMAGE')
oNewTool = oTool->GetByIdentifier(strToolID)
oCreateVis = oNewTool->GetService("CREATE_VISUALIZATION")
oParmSet = OBJ_NEW('IDLitParameterSet', $
DESCRIPTION='Image Plane', NAME='Image Plane',$
TYPE='Image', ICON='image')

; hook up the plane data
oParmSet->Add, oData, PARAMETER_NAME='IMAGEPIXELS', /PRESERVE_LOCATION
oCommandSet = oCreateVis->CreateVisualization(oParmSet, 'IMAGE')

Mike
--
www.michaelgalloy.com
Associate Research Scientist
Tech-X Corporation
[Message index]
 
Read Message
Read Message
Previous Topic: programming with itools
Next Topic: "include" a file

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 14:09:58 PDT 2025

Total time taken to generate the page: 1.99930 seconds