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

Home » Public Forums » archive » Re: object IDLanROI and polyfillv
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: object IDLanROI and polyfillv [message #26588] Thu, 13 September 2001 07:12 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Karsten Rodenacker (Karsten@Rodenacker.de) writes:

> Thank you, David. The first answer helped. Do you think that other values for
> mask_rule exist?

It wouldn't appear so.

> Attached is a piece of code illustrating at least differences of ComputeMask
> and polyfillv...
> The behaviour has not become clear, but maybe there is some expertise for
> explanation. I am not so involved with graphics. Switching between
> Mask_rule=1 and Mask_rule=2 shows only deviations on the lower left side of
> the mask in contrast to the upper right side. Seemingly the understanding of
> interior, boundary and 'interior and boundary' differs a bit throughout idl.

The object graphics system and the direct graphics system are
two completely different ways of doing graphics, so I am not
terribly surprised to find differences between them. There
are always about a dozen different ways to accomplish
something with a computer program and no firm basis for
calling one method "right" and another "wrong".

This is especially true (as I learned in my
graduate school days) of any contouring algorithm you
care to write. There is (quite literally) no "right"
way to draw a contour line. There are some ways that
are more internally "consistent" with one another, but
no right way.

Since what we are seeing here has to do with boundaries
around a contour, I'm not at all surprised to see
differences in the two methods. And, frankly, I wouldn't
worry about which was "right". I would urge you to pick
a method and stick with it, so as to get consistent results.

I ran into exactly this problem several months ago
myself, when I thought an IDLanROI object would make
my life easier. But I couldn't get its answers for
perimeter, centroid, and area to match with answers
I was getting by performing the same calculations on
contour lines returned by the Contour command. In the
end, I ripped the object graphics stuff out of my code
so my answers could be internally consistent.

(I could probably just as well have gone with the
ISOCONTOUR command for creating my contours, but
frankly the time required to decipher the seemingly
incomprehensible documentation appeared overwhelming
at the time. It was much faster to just write my
own methods for calculating the perimeter, centroid,
and area for contours with which I was much more
familiar.)

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Converting Miscrosoft Date/Time into JS?
Next Topic: Re: Error in function js2ymds (JHU/APL/S1R IDL Lib)?

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

Current Time: Fri Oct 10 08:58:08 PDT 2025

Total time taken to generate the page: 0.63933 seconds