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

Home » Public Forums » archive » Re: Reading a Gzipped file in IDL?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Reading a Gzipped file in IDL? [message #7536] Thu, 21 November 1996 00:00
Ken Kump is currently offline  Ken Kump
Messages: 8
Registered: February 1996
Junior Member
Phil Alvin wrote:
>
> Does anyone know of an IDL routine that can un-gzip a file?
> I realize we could span a gzip process, but we are trying to be
> platform independent and the easiest way to do this would be to
> have an IDL routine which can un-gzip the file before it is read
> with a standard reading routine.

I'm not aware of any, but here is my solution.
I've written a C-routine which I use
a call_external from IDL. Since my volume is a known size, I
define the volume in IDL, and pass this to C with the filename
which is to be uncompressed.
Here is a code segment for a 2D read:

cmdline ='zcat temp.Z';
cons=popen(cmdline,"r");
for(i=0;i<ImageYsize;i++) for(j=0;j<ImageXsize;j++)
{ fscanf(cons,"%c%c",&high,&low);
xx[i*ImageXsize + j]=low+(unsigned int)(256)*high;
}
pclose(cons);


I don't claim this to be terribly efficient...and I'd be
happy to see some improvements...but this worked.


--

Ken Kump

Department of Biomedical Engineering
Case Western Reserve University
Cleveland, Ohio 44106, USA

E-mail: ksk3@po.cwru.edu
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: orthogonal array projections
Next Topic: Question on: IDL link with External C program

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

Current Time: Wed Oct 08 17:36:39 PDT 2025

Total time taken to generate the page: 0.00576 seconds