Skip to content

Commit d910ad8

Browse files
committed
DOC: Annotate header fields
1 parent b6141a4 commit d910ad8

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

nibabel/freesurfer/mghformat.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@
2727
DATA_OFFSET = 284
2828
# Note that mgh data is strictly big endian ( hence the > sign )
2929
header_dtd = [
30-
('version', '>i4'),
31-
('dims', '>i4', (4,)),
32-
('type', '>i4'),
33-
('dof', '>i4'),
34-
('ras_good', '>i2'),
35-
('voxelsize', '>f4', (3,)),
36-
('x_ras', '>f4', (3, 1)),
37-
('y_ras', '>f4', (3, 1)),
38-
('z_ras', '>f4', (3, 1)),
39-
('c_ras', '>f4', (3, 1))
30+
('version', '>i4'), # 0; must be 1
31+
('dims', '>i4', (4,)), # 4; width, height, depth, nframes
32+
('type', '>i4'), # 20; data type
33+
('dof', '>i4'), # 24; degrees of freedom
34+
('ras_good', '>i2'), # 28; *_ras fields valid
35+
('voxelsize', '>f4', (3,)), # 30; zooms (X, Y, Z)
36+
('x_ras', '>f4', (3, 1)), # 42; X direction cosine column
37+
('y_ras', '>f4', (3, 1)), # 54; Y direction cosine column
38+
('z_ras', '>f4', (3, 1)), # 66; Z direction cosine column
39+
('c_ras', '>f4', (3, 1)), # 78; mm from (0, 0, 0) RAS to vol center
4040
]
4141
# Optional footer. Also has more stuff after this, optionally
4242
footer_dtd = [

0 commit comments

Comments
 (0)