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

Home » Public Forums » archive » create oval shape
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: create oval shape [message #91738 is a reply to message #91737] Tue, 18 August 2015 10:11 Go to previous messageGo to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On Tuesday, August 18, 2015 at 11:41:13 AM UTC-5, g.na...@gmail.com wrote:
> Hi
>
> I want to create two oval shapes where the enclosed pixels have fixed values. I tried the following but are rectangles, as expected of course.
>
> Im = fltarr(300,300)
>
> A[19:68,40:115] = 2.
> A[40:55,62:82] = 1.
>
> Can anyone help with this? Instead of rectangles creating oval shapes with fixed values.

I would use DIST_ELLIPSE from the idl astronomy library to get the distances from the center of the ellipse to each point in the image, and then use that distance to decide whether to set it or not.

I.e. to fill in an ellipse with an axis ratio of 2:1 centered at (x_center, y_center) with a semi-major axis length of length "radius":

dist_ellipse, ellipse_distances, [300,300], x_center, y_center, 2.0
A = ellipse_distances le radius

-Jeremy.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: calling C++ from within IDL
Next Topic: Apply a shapefile to raster images in IDL

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

Current Time: Fri Oct 10 01:17:39 PDT 2025

Total time taken to generate the page: 0.16014 seconds