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

Home » Public Forums » archive » Regarding the Fit_Ellipse Program
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: Regarding the Fit_Ellipse Program [message #58932 is a reply to message #58903] Wed, 27 February 2008 15:47 Go to previous messageGo to previous message
plim.dreaming is currently offline  plim.dreaming
Messages: 22
Registered: February 2008
Junior Member
> Yes, so what you need to do is to compute the ellipse
> in a way that does not depend on the graphic device used and
> then plot it. Can I just quickly ask what is your starting data
> again (that is, how exactly you define your points in the first
> place)?
>
> Paolo> B


Hi Paolo and David,
So, I went ahead an managed to create ellipses for the blobs!! I
changed set_plot,'x' so now !D.X_size gives me 640 instead which the
computer can crunch and produce nice figures on the screen. I would
still like to convert the values for x,y, semimajor, semiminor, and
center of the ellipse back to data coordinates such that I can place
them on the postscript file again but convert_coord( ... /to_data)
doesn't do the job.

Some code to make this more interesting:

contour_array = [s2c2(0,*),s2c2(1,*)] ; this is the x,y positions of
the vertices of the polygon which defines the contour

blob_x = s2c2(0,*)
blob_y = s2c2(1,*)

set_plot,'x'

polyfill,blob_x,blob_y,color=100,/data

D = convert_coord(blob_x, blob_y, /to_device)

result = polyfillv(d(0,*), d(1,*),640,640)

Ellipse_out = fit_ellipse(result,semiaxes=semiaxes,center=center)

plots,Ellipse_out,/device

set_plot,'ps
device,filename='Surface_Plots.ps'
New_coords = convert_coord(Ellipse_out, /to_device)
plots,s2c2(0,*),s2c2(1,*)
plots,New_coords,/device
device,/close

Much thanks!
Bruno

p.s. I haven't banged my head on the IDLanROI more than being capable
of making the object:
blob_roi = OBJ_NEW('IDLanROI', blob_x,blob_y)
blob_mask = blob_roi->ComputeMask(initialize=0)
because I still don't see how to fit an ellipse and obtain its
parameters using the object functions.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Histogram: Normalised Occurrence Frequency
Next Topic: google summer of code 2008

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

Current Time: Sun Oct 12 10:28:13 PDT 2025

Total time taken to generate the page: 0.01205 seconds