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

Home » Public Forums » archive » issues appending roi from IDLanROI to IDLanROIGroup
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
issues appending roi from IDLanROI to IDLanROIGroup [message #93243] Wed, 18 May 2016 12:39
Ayla P is currently offline  Ayla P
Messages: 3
Registered: May 2012
Junior Member
Hi,

I've got a little GUI into which I load a 3D volume and individual 2D slices are displayed (the z-position through the volume changes with a slider). At any given slice, I would like to be able to draw an ROI, add that ROI to an ROIGroup, and then use ComputeMesh to generate the 3D vertex and connectivity lists from all the ROIs I've drawn. Things seem to work on each individual slice, in so much as I can draw the ROI and computes the centroid of that ROI (x, y, z). However, when I try to then compute the mesh from the group of ROIs (after making 3 or 4 individual ROIs) the result is 0 (failed) and the vlist and plist aren't populated. Plus, I get a notification that 'Temporary variables are still checked out - cleaning up...'

Any thoughts on what I might be doing wrong here? Thanks! Ayla

Here's the relevant section of the code:


ROI_Group = OBJ_NEW('IDLanROIGroup')
ROI = OBJ_NEW('IDLanROI', TYPE=2, interior=0)

if uval eq 'button_roi' then begin

;using roi_ex.pro as a template

; Collect first vertex for the region.
CURSOR, xOrig, yOrig, /UP, /DEVICE
ROI->AppendData, xOrig, yOrig, position
PLOTS, xOrig, yOrig, PSYM=1, /DEVICE

;Continue to collect vertices for region until right mouse button.
x1 = xOrig
y1 = yOrig
while !MOUSE.BUTTON ne 4 do begin
x0 = x1
y0 = y1
CURSOR, x1, y1, /UP, /DEVICE
PLOTS, [x0,x1], [y0,y1], /DEVICE
ROI->AppendData, x1, y1, position
ROI_Group->Add,ROI
endwhile
PLOTS, [x1,xOrig], [y1,yOrig], /DEVICE

; Draw the the region with a line fill.
DRAW_ROI, ROI, /LINE_FILL, SPACING=0.2, ORIENTATION=45, /DEVICE
centroid = ROI ->ComputeGeometry(centroid=center)
print, center

;Add to ROI group, compute mesh
; ROI_Group->Add,ROI
mesh = ROI_Group->ComputeMesh(vlist, plist)
print, vlist
print, plist

endif
[Message index]
 
Read Message
Previous Topic: Convert Function to Procedure
Next Topic: IDL to Python bridge and "file-like" Python object

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

Current Time: Wed Oct 08 15:19:42 PDT 2025

Total time taken to generate the page: 0.00241 seconds