> 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.
|