Re: Regarding the Fit_Ellipse Program [message #58876] |
Tue, 26 February 2008 12:44  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
plim.dreaming@gmail.com writes:
> I finally got the polyfillv to work (after converting my data to
> device coordinates) but it won't plot because of memory (unable to
> allocate memory to make array). I imagine this may be related to the
> fact that the !d.x_size is 17780. Am I wrong in thinking this?
Wow! Where do you work that they bought you a monitor
as big as a city block!?
What, exactly, did you try to "plot", and what
commands did you use to do it?
> I generally see the device size as being 512.
> And I am new to IDLanROI so I have been reading through
> http://www.physics.nyu.edu/grierlab/idl_html_help/objects_an 3.html
> and am still at a loss as to how I can convert the contour plot into a
> ROI and fit an ellipse to it... any links to tutorial pages would be
> stellar! I think I am at a similar stage of confusion as this one guy
> whose post I found and paste below:
You see! These are so easy *anyone* can learn to use them. ;-)
When I was learning to use them, I was still intimidated
by people throwing big words around (polymorphism, inheritance, etc.).
Once I learned they were talking about IDL procedures and functions,
I was fine. Basically, I just load the polygon (the output from your
contour plot) into them in the INIT method, and then I use the method
ComputeMask in place of POLYFILLV and the method ComputeGeometry for
everything else I need to know. It really is very, very simple.
If you can't figure it out in five minutes, let me know, and I'll
see if I can scare up an example.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
|
|
Re: Regarding the Fit_Ellipse Program [message #58971 is a reply to message #58876] |
Tue, 26 February 2008 13:38  |
plim.dreaming
Messages: 22 Registered: February 2008
|
Junior Member |
|
|
So, I used contour to obtain the x and y positions of a certain
contour level and labeled those arrays as posx and posy.
then obtained the positions in terms of the device, because that is
what polyfillv uses:
D = convert_coord(posx,posy, /to_device)
I did a print,!D.x_size to get the device sizes (it gave me the famous
17780) so I did:
result = polyfillv(D(0,*),D(1,*),17780,17780)
plots,fit_ellipse(result)
It is unable to allocate memory for the fit_ellipse part.
Is the !D.x_size related to the monitor size or the monitor resolution
or the postscript resolution or non-of-the-above?
And with the IDLanROI I finally made the object
blob = OBJ_NEW( 'IDLanROI', posx, posy ) and have to say that I
certainly was/am scared by wording such as: "Init methods are special
life cycle methods..."!?
I am right now trying to figure out how to type in this new language
Result = Obj->[IDLanROI::]ComputeMask(
to get from here to fitting an ellipse to the object and getting the
semi-major and semi-minor axis.
Much thanks,
"Bruno Schmidt of Northern Florida State University"
- so honey what did you do at work all day today?
- oh, i drew an ellipse...
|
|
|