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 
Switch to threaded view of this topic Create a new topic Submit Reply
creating elliptically shaped images [message #37099] Mon, 24 November 2003 07:12 Go to next message
mruschin is currently offline  mruschin
Messages: 3
Registered: November 2003
Junior Member
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?

Mark
Re: creating elliptically shaped images [message #37175 is a reply to message #37099] Wed, 03 December 2003 15:03 Go to previous message
Paul Sorenson is currently offline  Paul Sorenson
Messages: 48
Registered: May 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?
>
This sounds like a job for IDLanROI::ContainsPoints. It can identify what
points are in a region without requiring a loop.

-Paul Sorenson
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'
  Switch to threaded view of this topic Create a new topic Submit Reply
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: Wed Oct 08 14:55:54 PDT 2025

Total time taken to generate the page: 0.00470 seconds