what to make of read_interfile.pro ? [message #63135] |
Wed, 29 October 2008 07:17  |
Mike[2]
Messages: 99 Registered: December 2005
|
Member |
|
|
New IDL "idiom"?
Interfile is an aged but quite straight forward image file format used
in nuclear medicine. Turns out that there are some vestiges of it
deep in the bowels of a certain manufacturer's reconstruction codes,
so I decided it was time to come up with an interfile reader for IDL.
I was pleased to see that there is a read_interfile routine that has
been a part of IDL for many versions (since 1993). It doesn't work on
the data I'm trying to read - in their wisdom, the people who wrote
the code that wrote the data I've got called floats "float", rather
than using the interfile specs which call for "short float" and "long
float". I though it would be no problem to modify read_interfile to
handle this, but then I became astonished by a new IDL idiom - new to
me at least.
In the code, there is a structure that handles image headers. Each
header has widget_base associated with it and the uvalue for that that
base is used to store the header data value. There is another
widget_base uvalue that is used to handle valid choices. This is in
an entirely non-gui procedure by the way. At the end of the
procedure, there is a loop that "widget_control, /destroy"s the
widget_bases.
Anyone have an idea of why the author might have made that choice?
Were there no pointers in 1993? Maybe the original author
(Goldstein) just wanted to toy with us here in the future?
Anyway, out of respect/fear/queasiness, I think I may let this
procedure rest in peace and write a header cleaner/fixer to stick in
between reading the header and interpreting it.
Mike
|
|
|