Re: Annoying ROIs [message #53496 is a reply to message #53494] |
Wed, 18 April 2007 08:10   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Robbie writes:
> I've been using IDLanROI and IDLgrROI for a while and each time I use
> them I come to a different conclusion as to how they actually work. I
> seem to always get slightly offset masks from ComputeMask when I
> compare the mask and verticies on object graphics.
>
> I've written a small article and program to demonstrate the problem.
> http://barnett.id.au/idl/annoying_rois/annoying_rois.html
It's pretty clear I got up on the wrong side of the
bed this morning because my usual early morning stroll
though the newsgroup has left me irritable and annoyed.
I really dislike the often sanctimonious tone of "perversion"
articles. If I had to spend all my time thinking about
and protecting my programs from the unintended consequences
of people who intend to use them in perverse ways, I would
never write another line of code. I'd find something else
to do.
Anyway...
While Robbie's complaint doesn't fall exactly in this
category, he is going to suffer the brunt of my irritation
this morning. (Reminds me of baboon behavior in a very
interesting book I've been reading this week.)
IDLanROI and CONVERT_COORD are separated in time and place
by about 20 years of software development. I suppose
reasonable people can make good arguments about whether
a pixel "location" refers to the center of the pixel or
to some point along its edge. Here, clearly, two software
developers made different decisions. My guess would be,
and I have no data to support it, that centered pixels
probably make more sense (and follow the convention of
much modern software, including OpenGL, probably) in
object graphics than it originally did in direct graphics.
Since these two graphics systems were COMPLETELY different,
the opportunity to choose a convention that made things easier
in object graphics probably trumped the desire to have a single
convention for IDL.
Since CONVERT_COORDS is so useful, I understand why you use
it. But I don't thing the person who designed the object graphics
system even knew it existed. He probably assumed that if you
knew anything about object graphics at all, you would probably
be writing your own conversion routines. (I can agree it was
a lousy assumption, but I can see him making it. People who
design complete graphics systems sometimes have a hard time
imagining how the rest of us think.)
I can believe you are annoyed, but I also think you should get
over it. There are one or two things about IDL that annoy me, too. :-)
I would get behind a movement to ask ITTVIS to write a
CONVERT_COORD routine for object graphics. It could be very,
very useful.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|