accessing Siemens magnetom MR images [message #11664] |
Tue, 19 May 1998 00:00  |
Jonas
Messages: 23 Registered: May 1998
|
Junior Member |
|
|
I could spend some time doing this myself, but there have to be lots of
codes doing this already.
I want to read image files originating from our two Simens MR scanners
(Magnetom Vision/Expert) into IDL. I only need the image information, the
other information (TE, TR, flip, Patient info...) is just a bonus.
Any info/help/code is welcome
/Jonas, the IDL newbie
|
|
|
|
Re: accessing Siemens magnetom MR images [message #11863 is a reply to message #11664] |
Thu, 28 May 1998 00:00  |
Jonas
Messages: 23 Registered: May 1998
|
Junior Member |
|
|
thanx!
however, is there really a read_dicom-procedure in IDL? the help file didn't
tell me about it...
I got some more help from Lars in denmark (thanx Lars, hope you don't mind
me forwarding this):
> The first 6144 bytes in the image file is header information. If you
> know the image dimensions and type, you can use the following simple
> procedure:
>
> pro read_file, filename, xres, yres, ima
> openr,fileid, filename, /get_lun
> header=bytarr(6144)
> readu, fileid, header
> ima=fltarr(xres,yres) ;change type when appropriate
> readu, fileid, ima
> end
>
> This is, of couse, not very general and all "bonus" information is
> lost. Please forward any better answer to me.
>
> Cheers, Lars
Jonas
|
|
|
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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
|
|
|