| Re: accessing Siemens magnetom MR images [message #11874 is a reply to message #11664] |
Wed, 27 May 1998 00:00  |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
Jonas -
If you would like a routine to do what Patrick Ford suggests below,
get READ_IMG.PRO from:
ftp://bial8.ucsd.edu/ : pub/software/idl/share/idl_share.tar.gz
There is also a READ_IMG.DOC that explains how to use it.
Basically, you can read any square 8-bit or 16-bit image with
dimensions 64, 128, 256 or 512; any existing header will be returned
as argument. This routine assumes that the image is larger than the
header!
You can also get SHOW_IMG.PRO/.DOC to allow you to view a series
of these images easily and in a variety of useful formats.
There is a README file that lists other routines; if you're working
with MR images then you will probably find a number of them useful.
Dave
Patrick V. Ford wrote:
>
> (A case of where the visually impaired is leading the blind.)
>
> A quick and dirty method is to create two arrays, one for the header and
> the other for the image(s). This assumes that the common format is to have
> a header block followed by the image data. Image sets may have multiple
> sub headers.
>
> header = bytarr(size_of_header)
> images = intarr(X,Y,Z); assuming a 3-D array of 2 byte pixels.
>
> open the file. ( I would have to look this up, but I could e-mail an
> example. )
> read the header and do nothing with it
> read the image.
>
> display the image.
> tvscl, image(*,*,0)
> etc.
> You may have to swap the byte order.
>
> To calculate the header size look at the number of bytes in the file and
> subtract the image size in bytes.
>
> Or if it is in DICOM format, I think there is a read_DICOM in IDL.
>
> Patrick Ford, MD
> Baylor College of Medicine
> pford@bcm.tmc.edu
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2240
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
|
|
|
|