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

Home » Public Forums » archive » Re: saving ellipse to image
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: saving ellipse to image [message #80904] Tue, 24 July 2012 13:40
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
On Tuesday, July 24, 2012 3:37:28 PM UTC-4, Kat wrote:
> Hi guys,
> I'm trying to make an image in idl containing an ellipse

You can also use dist_ellipse.pro in the Astron library to create an array in which each element is equal to the semi-major axis of the ellipse of specified center, axial ratio, and position angle, which passes through that element.
This array can then be used to create an ellipse of any size.

;Make a 1000 x 1000 mask array with ellipse centered at [400,500], with an
;axial ratio of 1.5, and a position angle of 15 degrees from the Y axis.
IDL> dist_ellipse,im,1000,400,500,1.5,15
IDL> g = where(im lt 300,comp=gg) ;Get points with major axis lt 300 pixels
IDL> im[g] = 255 ;Pixels within ellipse
IDL> im[gg] = 0 ;Pixels outside ellipse
IDL> cgimage,im
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: saving ellipse to image
Next Topic: Issues with read_png and/or profiler

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

Current Time: Wed Oct 08 18:40:07 PDT 2025

Total time taken to generate the page: 0.00425 seconds