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

Home » Public Forums » archive » Re: Reading GE MRI data off 1/2" tapes
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 GE MRI data off 1/2" tapes [message #16732] Sat, 21 August 1999 00:00
pln is currently offline  pln
Messages: 10
Registered: September 1991
Junior Member
Several years ago I wrote a program called tapemap which is quite
useful in figuring out the contents of unknown mag tapes. It scans
the tapes, counting files and records and keeping track of their
sizes. It will print samples of records in ASCII, EBCDIC, or hex.
I just posted links on my home page:

http://giants.stanford.edu/~pln

This program was inspired by a similar one that existed on an IBM
mainframe.
Re: Reading GE MRI data off 1/2" tapes [message #16743 is a reply to message #16732] Fri, 20 August 1999 00:00 Go to previous message
David Clunie is currently offline  David Clunie
Messages: 2
Registered: January 1999
Junior Member
Hi Dave

It is a long time since I did this format, but the details
are documented by GE ... see the alt.image.medical FAQ at:

http://idt.net/~dclunie/medical-image-faq/html/

for details and document references, and my notes on the
subject.

Trying to get the files off the tape from within a program
is way hard ... much easier to use the unix command line
utilities to extract individual "files" separated by tape
marks, eg.

mt -f /dev/nrmt0 rewind
dd if=/dev/nrmt0 of=file1 ibs=8192
dd if=/dev/nrmt0 of=file2 ibs=8192
...

obviously one can script this until dd reports error or
the extracted size is zero, etc.

Note the block size ... from memory it is 8k on the GE
tapes but you may need to experiment. Also use the no
rewind device or you will keep getting the same file
over again :)

Once you have the files, you will need to decipher them. The
dicom3tools at my web site have various utilities to help
with this. I haven't used 3X or 4X format for a while so you
probably need the older tools, rather than the current work
in progress snapshot.

david

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/
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~

--
David A. Clunie mailto:dclunie@idt.net
Director, Medical Imaging Technologies http://idt.net/~dclunie/
Quintiles Intelligent Imaging http://www.i2image.com/
521 Plymouth Rd #115 Work 610-238-0572 Fax -0578
Plymouth Meeting PA 19462 Home 570-897-7123 Fax -5117
Re: Reading GE MRI data off 1/2" tapes [message #16746 is a reply to message #16743] Fri, 20 August 1999 00:00 Go to previous message
Nigel Wade is currently offline  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
Re: Reading GE MRI data off 1/2" tapes [message #16752 is a reply to message #16743] Thu, 19 August 1999 00:00 Go to previous message
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
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.

Hey Dave,

Did you try the tcopy command on that tape, e.g.

% tcopy /dev/rmt/xxx

where xxx is your tape device? In this mode, tcopy should scan the whole
tape and display information about the sizes of all records and files on
the tape. You might need to experiment with the different tape devices
in /dev/rmt to find the right one.

If you can get this far, and the results make sense, then you can read
the contents of the tape in IDL (on Unix), assuming the tape records are
of fixed length:

file = '/dev/rmt/xxx'
openr, lun, file, /get_lun, /nostdio
recsize = 16384 ; or whatever size record
record = bytarr(recsize)
transfer_count = recsize
nrecords = 0
while transfer_count eq recsize do begin ; should quit at end-of-file
readu, lun, record, transfer_count=transfer_count
nrecords = nrecords + 1
endwhile
free_lun, lun
print, 'Records read: ', nrecords

Cheers,
Liam.

--
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: idl > memory problems
Next Topic: xmanager /no_block

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

Current Time: Wed Oct 08 15:50:08 PDT 2025

Total time taken to generate the page: 0.00693 seconds