Folks: (Probably Nick S?)
Comments on the MghFormat wiki doc page:
https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial_2fMghFormat
1. Width/Height/Depth confusion. -------------------------------- Doc says...
width integer first dimension of the image buffer (slowest) height integer second dimension of the image buffer (2nd slowest) depth integer fastest dimension when reading the buffer
... yet mriio mghWrite(...) source code says...
for (frame = start_frame ; frame <= end_frame ; frame++) { for (z = 0 ; z < depth ; z++) { for (y = 0 ; y < height ; y++) { [...] for (x = 0 ; x < width ; x++)
Ie: width should be fastest, and depth slowest, contrary to doc.
Further, the statement "the bytes being read in the order Z --> Y --> X" is either incorrect or doesn't have any meaning.
2. "image data starts at specified offset, which is currently ???". --------------------------------------------------------------------
Looks like from the source code that the header is padded to 24 + 256, which means image starting at byte 280 (counting from zero).
3. Other Data -------------- In the doc, the Other Data section ends at "FoV". Actually the source code shows that mghWrite writes out other stuff beyond that, which in the examples I looked at appears to be a history of commands performed on the image so far, for example (abbreviated [...] and wrapped by me):
=========================== [...] mri_convert /data/[...]/39174a/mri/rawavg.mgz [output filepath] --conform ProgramVersion: $Name: stable3 $ TimeStamp: 06/06/07-04:10:32-GMT CVS: $Id: mri_convert.c,v 1.121 2006/02/22 05:39:36 greve Exp $ User: graham Machine: gwlin[...] CompilerName: GCC Compile[...]
mri_ca_normalize -mask brainmask.mgz nu.mgz [...] norm.mgz ProgramVersion: $Name: stable3 $ TimeStamp: 06/06/11-05:41:45-GMT CVS: $Id: mri_ca_normalize.c,v 1.31 2005/08/15 14:14:22 fischl Exp $ User: graham Machine: gwlin[...] GCC CompilerVersion: [...] ===========================
(Plus the source code suggests that if a Talairach transform has been applied it appears here in some form).
-----------------------------
Graham
Graham,
Thanks for pointing these out. We've corrected the page (but it still needs quite a bit more work to make it a true 'file spec').
Nick
On Wed, 2006-07-12 at 20:05 -0700, Graham Wideman wrote:
Folks: (Probably Nick S?)
Comments on the MghFormat wiki doc page:
https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial_2fMghFormat
- Width/Height/Depth confusion.
Doc says...
width integer first dimension of the image buffer (slowest) height integer second dimension of the image buffer (2nd slowest) depth integer fastest dimension when reading the buffer
... yet mriio mghWrite(...) source code says...
for (frame = start_frame ; frame <= end_frame ; frame++) { for (z = 0 ; z < depth ; z++) { for (y = 0 ; y < height ; y++) { [...] for (x = 0 ; x < width ; x++)
Ie: width should be fastest, and depth slowest, contrary to doc.
Further, the statement "the bytes being read in the order Z --> Y --> X" is either incorrect or doesn't have any meaning.
- "image data starts at specified offset, which is currently ???".
Looks like from the source code that the header is padded to 24 + 256, which means image starting at byte 280 (counting from zero).
- Other Data
In the doc, the Other Data section ends at "FoV". Actually the source code shows that mghWrite writes out other stuff beyond that, which in the examples I looked at appears to be a history of commands performed on the image so far, for example (abbreviated [...] and wrapped by me):
=========================== [...] mri_convert /data/[...]/39174a/mri/rawavg.mgz [output filepath] --conform ProgramVersion: $Name: stable3 $ TimeStamp: 06/06/07-04:10:32-GMT CVS: $Id: mri_convert.c,v 1.121 2006/02/22 05:39:36 greve Exp $ User: graham Machine: gwlin[...] CompilerName: GCC Compile[...]
mri_ca_normalize -mask brainmask.mgz nu.mgz [...] norm.mgz ProgramVersion: $Name: stable3 $ TimeStamp: 06/06/11-05:41:45-GMT CVS: $Id: mri_ca_normalize.c,v 1.31 2005/08/15 14:14:22 fischl Exp $ User: graham Machine: gwlin[...] GCC CompilerVersion: [...] ===========================
(Plus the source code suggests that if a Talairach transform has been applied it appears here in some form).
Graham
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
freesurfer@nmr.mgh.harvard.edu