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

Home » Public Forums » archive » creating elliptically shaped images
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: creating elliptically shaped images [message #37182 is a reply to message #37099] Wed, 03 December 2003 09:24 Go to previous message
condor is currently offline  condor
Messages: 35
Registered: January 2002
Member
mruschin@hotmail.com (mark) wrote in message news:<a9116224.0311240712.618f4088@posting.google.com>...
> I'd like to form an image which has an elliptical shape and where all
> the pixels within this ellipse have values corresponding to any given
> function that I would specify, the simplest example being a uniform
> image (i.e. a value of 1 for all the pixels in the ellipse). Is there
> any nice way to do this in IDL or MATLAB other than looping through
> all the pixels and determining whether any given one lies within the
> ellipse?


In IDL at least, you can send raw strings to your output device.
Depending on the device, you could use that to send clipping
instructions.

If you were plotting into a PostScript file for example, this might
look vaguely like this:

;; Some random dots to plot:
x=randomu(seed,5000)
y=randomu(seed,5000)

set_plot,'PS'
device,/landscape

;; plot without clipping to show where the dots are:

plot,x,y,psym=3

;; PS clipping path -- here vaguely elliptical, but could be anything:

clipstring='currentpoint 37 rotate 1 .5 scale '+$
'newpath 15000 5000 5000 0 360 arc clip '+$
'1 2 scale -37 rotate newpath moveto'

device,output=clipstring

;; plot again with different psym to illustrate clipping:

oplot,x,y,psym=4

device,/close
set_plot,'X'
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Two little questions:
Next Topic: Active Contours and Snakes! Oh, my!

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

Current Time: Sun Oct 12 04:43:09 PDT 2025

Total time taken to generate the page: 1.11885 seconds