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

Home » Public Forums » archive » need help on ROI subscript
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
need help on ROI subscript [message #17256] Fri, 17 September 1999 00:00
lsyrkin is currently offline  lsyrkin
Messages: 9
Registered: May 1999
Junior Member
Hi,

I need to calculate total counts inside a defined ROI in the multyframed
image im256=IntArr(256,256,30). I define ROI in the first frame
im256(*,*,0). Q is a subscript. Then I am trying to to calculate total
counts inside ROI for every image. It starts fine for the first frame
and gives the error on the second cycle:

% Subscript range values must be >= 0, < size: IM256.
% Execution halted at: DISPLXE_DEFR 381
/export/home/rsi/idl_5.2/myfiles/DisplXe.pro
% WIDGET_PROCESS_EVENTS
% $MAIN$


What does it mean? Why subscript Q works fine for the first frame and
stops on the second?


Below I placed the problem event handler:

;****************************************************
Pro DisplXe_DEFR, event


widget_Control, event.top, Get_UValue=info, /No_Copy
im=IntArr(64,64,30)

FOR k=0, 29 DO BEGIN
im[*,*,k]=(*info.image)[*,*,4*k]+(*info.image)[*,*,4*k+1]+(* info.image)[*,*,4
*k+2]+(*info.image)[*,*,4*k+3] ENDFOR

new_base=Widget_Base(Title=info.pname+' Define ROI ',
Group_leader=event.top)
draw20ID=Widget_Draw(new_base, Xsize=256, YSize=256, /BUTTON,
/MOTION);Create a draw widget
;that will return both button and motion events

Widget_Control, new_base, /Realize
Widget_Control, draw20ID, Get_Value=wid
wset,wid;

; rebin 20 sec slices to 256x256

im256=IntArr(256,256,30)
FOR j=0, 29 DO BEGIN
im256=rebin (im[*,*,j],256,256)
ENDFOR


TVScl, im256(*,*,0)


; define ROI
Q=CW_DEFROI(draw20ID)
help, Q

; array for counts
cnts=LonArr(30)

; to find TOTAL counts inside ROI in every image !!!!!!!!! gives the
;error on the second pass (k=1)
FOR k=0, 29 DO BEGIN
tmp=im256(*,*,k)
cnts[k]= TOTAL(tmp(Q))
ENDFOR

PRINT, cnts

plot, cnts



widget_Control, event.top, Set_UValue=info, /No_Copy
END

;*********************************************************** *******



Thanks in advance,

Leonid Syrkin


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
[Message index]
 
Read Message
Previous Topic: Re: need help on ROI subscript
Next Topic: passing structures to CALL_EXTERNAL

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

Current Time: Sun Oct 12 11:23:53 PDT 2025

Total time taken to generate the page: 0.71946 seconds