|
Re: Expanding IDL's list of approved image formats [message #19935 is a reply to message #19934] |
Tue, 09 May 2000 00:00  |
Ben Tupper
Messages: 186 Registered: August 1999
|
Senior Member |
|
|
Wow!
What a great offer!
You know, this would be a great for nudging slobs, such as yours truly, toward
writing readable/ well documented code.
Now if I could just get my newly readable/well documented code to work!
Ben
David Fanning wrote:
>
>
>>> It is a shame there isn't a public repository of IDL code to read/write these
>>> obscure but 'standard' formats.
>>
>> We shall have to make one...
>
> I would be more than happy to host a repository, so long as it
> is crystal clear to the contributors and the users that I an
> NOT in the business of supporting the code that resides there. :-)
>
--
Ben Tupper
Bigelow Laboratory for Ocean Science
tupper@seadas.bigelow.org
pemaquidriver@tidewater.net
|
|
|
Re: Expanding IDL's list of approved image formats [message #19937 is a reply to message #19934] |
Tue, 09 May 2000 00:00  |
Ben Tupper
Messages: 186 Registered: August 1999
|
Senior Member |
|
|
Hello,
You might incorporate the built in DIALOG_PICKFILE function into your own reader.
Something like the following might do it.
;-----------
FUNCTION READ_ThisData, File, Group = Group, Cancel = Cancel
Cancel = 0
If N_Elements(File) EQ 0 Then Begin
File = Dialog_PickFile(Group = Group)
; if user cancels then return -1 and set the cancel flag
If File[0] EQ '' Then Begin
Cancel = 1
Return, -1
EndIf
EndIf
.... Your other stuff here to read in the data ...
Return, ThisData
END
;-----------------
The other way to work around this is don't use DIALOG_READ_IMAGE function. Use
the DIALOG_PICKFILE function, then read in the data based upon which type of
format the user chooses. You can use the result of QUERY_IMAGE to determine if
the image is a 'standard' image format according to IDL's definitions.
Good luck,
Ben
Michael Cugley wrote:
>
>
> Well, yes. To rephrase what I meant [which may not be what I *wrote* :)], I've
> written a routine to load ACR/NEMA files, but it sure would be convenient to be
> able to tell IDL about my nice new READ_ACRNEMA function so that, say, the
> DIALOG_READ_IMAGE popup will show ACR/NEMA files as "images". As it stands it
> looks like I'm going to have to add my own cludgy routine after the fact, or
>
--
Ben Tupper
Bigelow Laboratory for Ocean Science
tupper@seadas.bigelow.org
pemaquidriver@tidewater.net
|
|
|
Re: Expanding IDL's list of approved image formats [message #19939 is a reply to message #19934] |
Tue, 09 May 2000 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Michael Cugley (mjcugley@medphys.dundee.ac.uk) writes:
> Well, yes. To rephrase what I meant [which may not be what I *wrote* :)], I've
> written a routine to load ACR/NEMA files, but it sure would be convenient to be
> able to tell IDL about my nice new READ_ACRNEMA function so that, say, the
> DIALOG_READ_IMAGE popup will show ACR/NEMA files as "images". As it stands it
> looks like I'm going to have to add my own cludgy routine after the fact, or
> rewrite QUERY_IMAGE or something.
Leaving aside my feelings for Dialog_Read_Image, I don't
think it would be a huge job to write a QUERY_NEMA program
that would work with it. The code (if you can call it that)
is there for you to work with.
>> It is a shame there isn't a public repository of IDL code to read/write these
>> obscure but 'standard' formats.
>
> We shall have to make one...
I would be more than happy to host a repository, so long as it
is crystal clear to the contributors and the users that I an
NOT in the business of supporting the code that resides there. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: Expanding IDL's list of approved image formats [message #19940 is a reply to message #19934] |
Tue, 09 May 2000 00:00  |
Michael Cugley
Messages: 9 Registered: May 2000
|
Junior Member |
|
|
Ben Tupper wrote:
> I think David's hidden suggestion is, 'you better write it yourself'.
Well, yes. To rephrase what I meant [which may not be what I *wrote* :)], I've
written a routine to load ACR/NEMA files, but it sure would be convenient to be
able to tell IDL about my nice new READ_ACRNEMA function so that, say, the
DIALOG_READ_IMAGE popup will show ACR/NEMA files as "images". As it stands it
looks like I'm going to have to add my own cludgy routine after the fact, or
rewrite QUERY_IMAGE or something.
> It is a shame there isn't a public repository of IDL code to read/write these
> obscure but 'standard' formats.
We shall have to make one...
|
|
|
Re: Expanding IDL's list of approved image formats [message #19942 is a reply to message #19934] |
Tue, 09 May 2000 00:00  |
Ben Tupper
Messages: 186 Registered: August 1999
|
Senior Member |
|
|
Hello,
I think David's hidden suggestion is, 'you better write it yourself'.
Your question does raise an important issue. It seems like a common issue,
too. There are ten gazillion 'standard' formats for data as produced by
different companies. Your example, ACR/NEMA, is just one. I have been
wrestling with IPLAB image formats (an complex of binary header, binary data,
and PICT vector overlays) and the NOAA raster charts (ASCII header and
run-length compressed binary data.), neither of which have I fully figured
out. More recently, I have been working on code to read the output logs
from SEABIRD CTD instruments. David has a recent example of reading 12bit
images stored in a 16bit format or some such thing. While these images may
be 'standards' for the commercial outfit that produces them, they are
certainly not universal, like TIFF, JPEG, ...
It is a shame there isn't a public repository of IDL code to read/write these
obscure but 'standard' formats.
Good luck!
Ben
David Fanning wrote:
> Michael Cugley (mjcugley@medphys.dundee.ac.uk) writes:
>
>> Is there a (relatively) painless way to convince IDL to accept a new
>> image format? I'm writing an application that has to load in the
>> currently approved types *and* ACR/NEMA files. It'd be most convenient
>> if I could just get IDL to add ACR/NEMA to its list of formats, and then
>> use the inbuilt image loading/writing dialogs and routines...
>>
>> Can anyone help?
>
> I think the most effective strategy would be a hunger strike.
> Not only is it (relatively) painless, but with a handful of
> us dying every day, RSI would have no choice but to capitulate
> quickly. The hard part will be publicising that there are
> thousands of us out here willing to die for...what was
> the name of that format, again?
>
> Power to the people!
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting
> Phone: 970-221-0438 E-Mail: davidf@dfanning.com
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Toll-Free IDL Book Orders: 1-888-461-0155
--
Ben Tupper
Bigelow Laboratory for Ocean Science
tupper@seadas.bigelow.org
pemaquidriver@tidewater.net
|
|
|
Re: Expanding IDL's list of approved image formats [message #19943 is a reply to message #19934] |
Tue, 09 May 2000 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Michael Cugley (mjcugley@medphys.dundee.ac.uk) writes:
> Is there a (relatively) painless way to convince IDL to accept a new
> image format? I'm writing an application that has to load in the
> currently approved types *and* ACR/NEMA files. It'd be most convenient
> if I could just get IDL to add ACR/NEMA to its list of formats, and then
> use the inbuilt image loading/writing dialogs and routines...
>
> Can anyone help?
I think the most effective strategy would be a hunger strike.
Not only is it (relatively) painless, but with a handful of
us dying every day, RSI would have no choice but to capitulate
quickly. The hard part will be publicising that there are
thousands of us out here willing to die for...what was
the name of that format, again?
Power to the people!
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|