IDL crashes using CONTAINSPOINTS when array exceeds 16x16? [message #29205] |
Thu, 07 February 2002 01:32  |
dw
Messages: 10 Registered: February 2001
|
Junior Member |
|
|
Hi,
I have a little bit of code that removes background around my
cylindrical samples by setting the points outside a prescribed circle
to a non-zero value (I have to do this to stop SEARCH2D from growing
into the background), but I can only do it for an array of 16x16
pixels (and need to go to 370x370). Once I let the indices go to 17x17
or higher it crashes IDL. Any experiences like that out there?
Cheers,
Dorthe
This is my code:
************************************
FUNCTION CIRCLE, xcenter, ycenter, radius
points = (2 * !PI / 99.0) * FINDGEN(100)
x = xcenter + radius * COS(points )
y = ycenter + radius * SIN(points )
RETURN, TRANSPOSE([[x],[y]])
END
;*********************************************************** *********************************
;*********************************************************** *********************************
PRO Remove_background
topColor = !D.N_COLORS-1
LOADCT,0,NCOLORS=!D.N_COLORS-1
; Read volume file containing 3-D data set
vol = read_tomo_volume
('d:\recon_volumes\May2001\8_20_I_segm.volume')
; Extract one 2-d slice
image=vol[*,*,40]
siz = SIZE(image)
x = siz[1]
y = siz[2]
; Remove 'background' outside sample circle
bytimage = BYTSCL(image,min=0,max=10,TOP=topColor)
WINDOW,1,/PIXMAP,XSIZE=x,YSIZE=y
TV,bytimage
Xcentre = 330
Ycentre = 330
Radius = 140
circ_roi= CIRCLE(Xcentre,Ycentre,Radius)
PLOTS, circ_roi[0,*], circ_roi[1,*],/DEVICE
mask = image * 0
area = POLYFILLV(circ_roi[0,*],circ_roi[1,*],x,y)
mask[area] =1
CircleImage = mask * image
image_display, CircleImage
; Set pixels outside circle to non-zero value
For i = 0,17 do begin
For j = 0,17 do begin
inside_circle=obj_new('IDLanROI',circ_roi)
circleOK=inside_circle -> containspoints([i,j])
print, 'circleok:', circleOK
If circleok eq 0 then begin
image[i,j]=30
endif
endfor
endfor
image_display, image
END
|
|
|
Re: IDL crashes [message #36921 is a reply to message #29205] |
Sat, 15 November 2003 16:52  |
the_cacc
Messages: 104 Registered: October 2001
|
Senior Member |
|
|
lucianor@sinectis.com.ar (Luciano) wrote in message news:<902633c3.0311150920.1ea6b08b@posting.google.com>...
> Oh, I see that I'm not alone. Hopefully you'll have more luck with
> C++. I cannot convert evertything to C++, but I could try with IDL
> under linux
> but then linux is so... agh... (I better shut up :))
> I guess that I'll go back to win 2000, where IDL was mucho more
> stable, at least for me...
>
>
Hey but at least with IDL you get a zillion GUI widget toys, instead
of decent numerical tools. No wait, uhh, forget that.
|
|
|
Re: IDL crashes [message #36922 is a reply to message #29205] |
Sat, 15 November 2003 09:20  |
lucianor
Messages: 12 Registered: June 2002
|
Junior Member |
|
|
Oh, I see that I'm not alone. Hopefully you'll have more luck with
C++. I cannot convert evertything to C++, but I could try with IDL
under linux
but then linux is so... agh... (I better shut up :))
I guess that I'll go back to win 2000, where IDL was mucho more
stable, at least for me...
dcw_yip@yahoo.com (David Yip) wrote in message news:<201431cc.0311141513.474307a4@posting.google.com>...
> Join the club. I'm using 6.0 and it crash fairly regularily. I love
> it when it crashes and I lose all the changes I've just typed in. I'm
> running XP as well. I can't wait until the project converts over to
> C++ and then I can run a real development environment. IDL is
> insanity. Not to mention it's the culmination of all the things you
> aren't supposed to do in computer science. I always understood why
> you aren't supposed to do those things, now I feel it in my bones.
>
> David
|
|
|
Re: IDL crashes [message #36926 is a reply to message #29205] |
Fri, 14 November 2003 15:13  |
dcw_yip
Messages: 22 Registered: October 2003
|
Junior Member |
|
|
Join the club. I'm using 6.0 and it crash fairly regularily. I love
it when it crashes and I lose all the changes I've just typed in. I'm
running XP as well. I can't wait until the project converts over to
C++ and then I can run a real development environment. IDL is
insanity. Not to mention it's the culmination of all the things you
aren't supposed to do in computer science. I always understood why
you aren't supposed to do those things, now I feel it in my bones.
David
|
|
|
Re: IDL crashes [message #36931 is a reply to message #29205] |
Fri, 14 November 2003 10:29  |
lucianor
Messages: 12 Registered: June 2002
|
Junior Member |
|
|
Thanks David, but I already tried with 6.0 in demo mode and the 7
minutes you get for trial were enough to crash the whole thing!
I'm not sure if buying the full version is a clever idea... I guess
I'll wait till anybody near me gets it, and try there first...
Luciano
David Fanning <davidf@dfanning.com> wrote in message news:<MPG.1a1e7a8f7e54d4ee989683@news.frii.com>...
> I'd get a version of IDL that was written some time
> *after* Windows XP was just a twinkle in the developer's
> eye. :-)
>
> Cheers,
>
> David
|
|
|
Re: IDL crashes [message #36934 is a reply to message #29205] |
Fri, 14 November 2003 08:07  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
lucianor@sinectis.com.ar writes:
> crazy isn't it?
Oh, no. This is *exactly* why some of us start working
with computers in the first place. :-)
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http:/www.dfanning.com/
Phone: 970-221-0438, IDL Book Orders: 1-888-461-0155
|
|
|
Re: IDL crashes [message #36936 is a reply to message #29205] |
Fri, 14 November 2003 07:31  |
lucianor
Messages: 12 Registered: June 2002
|
Junior Member |
|
|
Me again with some updates to the problem:
I found a routine which crashes always. It's part of a very large
package but basically I put a 'stop' command inside a big loop, I run
it, it gets to the stop the first time without problems, the second
and third time also, but the 4th time it gets there, IDL crashes
giving me the messages listed on the previous post. When I click the
close button on this msgs I get the following:
"The instruction at 0x73dd1351" referenced memory at "0x00000004". The
memory could not be "read", Click on OK to terminate the program."
This happens in 3 different PCs with windows XP and IDL 5.4.
This doesn't happen on win 2000 or linux, there it works perfectly.
The funny thing is that IDL does not crash between the stops in some
offending command, it crashes just while writing:
"% Stop encountered: PROMAIN 109 C:\RSI\IDL54\NEW06-03\promain.pro
Now comes the strange, if I replace the stop command by
stop, 'stop'
it doesn't crash anymore!! If I avoid the stop command to write on the
log panel the "% Stop encountered...." it works perfectly...
crazy isn't it?
|
|
|
Re: IDL crashes [message #36939 is a reply to message #29205] |
Fri, 14 November 2003 04:37  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
lucianor@sinectis.com.ar writes:
> I have tried reinstalling IDL, I also installed the version 6.0 in
> demo mode. Everything! But the crashes are still there. Any ideas??
> Reinstall windows? Remove all the other software? Change the RAM? (I
> have 512Mb by the way)
>
> Any help would be apreciatted!
I'd get a version of IDL that was written some time
*after* Windows XP was just a twinkle in the developer's
eye. :-)
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http:/www.dfanning.com/
Phone: 970-221-0438, IDL Book Orders: 1-888-461-0155
|
|
|