[Insight-developers] MetaImage lists for more than 3D data

Bradley Wyman bwyman@insightful.com
Fri, 20 Sep 2002 10:58:36 -0700


I composed a MetaImage header for 4D data that I am trying to read in =
slice by slice.  The .mhd file is:

NDims =3D 4
DimSize =3D 204 256 8 9
ElementSpacing =3D 0.784314 0.785156 11.0 1.0
HeaderSize =3D -1
ElementType =3D MET_USHORT
ElementByteOrderMSB =3D False
ElementDataFile =3D LIST
t00\p01_t00_s00.dcm
t00\p01_t00_s01.dcm
t00\p01_t00_s02.dcm
t00\p01_t00_s03.dcm
t00\p01_t00_s04.dcm
t00\p01_t00_s05.dcm
t00\p01_t00_s06.dcm
t00\p01_t00_s07.dcm
t01\p01_t01_s00.dcm
t01\p01_t01_s01.dcm
...
and so on for all the files.

It appears that MetaImage::Read requires that the datafiles be =
dimensioned of size one less than the desired dimension.  This works =
great for NDims =3D 3, but in the case for NDims=3D4 it requires that =
the data needs to be stored in files as 3D imagestacks and not 2D image =
stacks.  The problem arises with the looping and the call to =
M_ReadElements which is as follows:

M_ReadElements(readStreamTemp,
                         &(((char =
*)m_ElementData)[i*m_SubQuantity[m_NDims-1]*
                                                   elementSize]),
                         m_SubQuantity[m_NDims-1]);

Given I want to read the data in slice by slice it appears that the code =
needs to be modified.  First, I want to make sure that I'm not missing =
something.  Second, does anybody mind if I add an m_ElementDataFileName =
option to read 2D slice by 2D slice.  Or should the defalt =
if(!strcmp("LIST", m_ElementDataFileName) routine assume 2D slice by 2D =
slice?  Also, would anybody else like to make this change (before I go =
messin' with someone elses code)?=20

Finally, does this change need to be propogated to any of the other IO =
readers?

Thanks,

_____________________________________________
Brad Wyman, Ph.D.         Insightful Corp.
1700 Westlake Ave. N      (206)802-2256
Seattle, WA 98109         Fax: (206)283-6310=20
bwyman@insightful.com=20