Subject: VIFF -> HDF & xdataslicer

From: [email-masked] (Patrick Haggard)
Date: Fri, 2 Jul 1993 17:39:51 GMT

Sorry for the cross posting, folks, but I need your help.  I have
multiple MRI images, which I process in khoros, and want to try
reformatting in an arbitrary plane.  I'm trying to used NCSA's
xdataslicer, which I happen to think is suboptimal.  If anyone
knows of any alternative for planar reformatting, I'ld be 
interested to know.  Otherwise, I need a reliable way to get
khroros multiband VIFF's (1 band per MRI slice) into NCSA's
hdf/sds format.  I have tried going through raster8, but
NCSA's r8tohdf utility makes incorrect assumptions about header
size, and the images are not correctly aligned.  What size
does r8tohdf expect the headers to be?  Alternatively, can
anyone suggest reliable ways to get multiband image data into
xdataslicer?

Thanks
--------------------------------------------------------------------------
Patrick Haggard                         Email (WORLD): [email-masked]
University Laboratory of Physiology     Email (JANET): [email-masked]
Parks Road,                             Tel. (0865) 272116
Oxford, OX1 3PT                         Fax. (0865) 272469
England
--------------------------------------------------------------------------

---

From: [email-masked] (Doug Ilg)
Date: Tue, 6 Jul 1993 16:39:53 GMT

[email-masked] (Patrick Haggard) writes:

>does r8tohdf expect the headers to be?

r8tohdf expects there to be no header on the image.  It just wants to see
raw 8-bit data.  If you strip the headers off your image data, it should
work okay, but I don't think that's really what you want to do, if you want
to use XDataslice.  You really need to use the SDS interface, as you said
above.

>Alternatively, can

I don't know if anyone has written a converter for exactly that purpose, but
it shouldn't be too terribly difficult.  If you know the overall dimensions
of your complete data cube, you can use the latest full release of HDF (3.2r4)
by calling any setup routines you need (DFSDsetdims, DFSDsetNT, DFSDstartslice,
etc.) then reading in each MRI slice and using DFSDputslice to write the data.
A final call to DFSDendslice finishes the job.

The main drawback of the method I described above is that you must set your
dimensions and write out the slices in such a way as to simulate contiguous
serial writes.  In other words, 40 slices of 50 rows by 30 columns would
require a dimension array (for DFSDsetdims) like this:
	int32 dims[3] = {40, 50, 30};
and the slices should be written out in order from 0 to 39.

If it turns out that you can't live with those restrictions, you'll have to
go with the new beta release of HDF (3.3b1) and use either the hyperslab
routines that have been added or a new-style SDS with an "unlimited"
dimension (ala netCDF).

It's really not as difficult as my description probably makes it sound :-)

			-Doug Ilg
			 Hughes STX
			 [email-masked]
			 Voice: (301) 794-5362
			 FAX: (301) 306-1010