| Re: Reading GE MRI data off 1/2" tapes [message #16746 is a reply to message #16743] |
Fri, 20 August 1999 00:00   |
Nigel Wade
Messages: 286 Registered: March 1998
|
Senior Member |
|
|
David Foster wrote:
>
> Problem:
>
> Cannot read General Electric Signa 3.x/4.x MRI data off
> 9-track 1/2" tapes.
>
> The program I am writing is in Fortran (historical reasons, of course);
> I have tried using the Sun f77 topen,tread... routines, but these are
> record-oriented and don't work in this case. I've tried opening the
> tape device with open(...,form='unformatted') and can read the first
> file on tape, the label. But I cannot seem to get past the first file
> marker (tried mt, tskip).
>
> These tapes seem to be in a "unique" format, as a third-party program
> that is used to read files off of these tapes (sorry, can't remember
> the name, the folks I'm consulting for tried using it) doesn't work
> with them.
>
> Any pointers, hints, or code, in *whatever* language, would be
> greatly appreciated. I am getting desperate, as this project's
> deadline has long since passed.
>
> I apologize if this is off-topic for this newsgroup; I'm trying to reach
> an audience that is most likely to have experience with reading MRI
> data off tapes. Not many of those posting to the Fortran newsgroups.
>
> Thanks!
>
> Dave Foster
>
> --
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~
> David Foster National Center for Microscopy and Imaging Research
> dfoster@ucsd.edu UCSD/Department of Neuroscience
> (858) 534-7968 http://www-ncmir.ucsd.edu/
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~
Unfortunately, FORTRAN is not a good language for doing this sort of
thing.
It requires additional, system dependent, support to be able to read
data from
external storage devices, especially if the data were not written by
FORTRAN.
The actual format of FORTRAN UNFORMATTED data is system dependent. All
it
really means is that the data should be stored in binary rather than
text.
What often happens is that each record is preceeded by an arbitrary
sized byte
count, and maybe terminated with the same. If the data was not generated
by the
same FORTRAN as you are reading it with you probably will not be able to
read
the data as UNFORMATTED.
What you have to do is delve into the system dependant IO routines. If
you are using UNIX you need to use the system calls (NOT FORTRAN calls)
of open/read to access the device. The easiest way to do this is to have
a library of tape handling rouines written in C, and then provide a
FORTRAN callable wrapper for each of these. As it happens...
Well, yes, actually I do have a library of routines for reading tapes
which work on Solaris and IRIX. You are welcome to a copy if you would
like them.
--
-----------------------------------------------------------
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523568, Fax : +44 (0)116 2523555
|
|
|
|