@@ -32,7 +32,7 @@ and we have made a temporary directory for the files we are going to write:
32
32
and we've got the path to the nifti example data:
33
33
34
34
>>> from nibabel.testing import data_path as example_data_path
35
-
35
+
36
36
Loading and saving NIfTI files
37
37
==============================
38
38
@@ -77,7 +77,7 @@ The relevant header information is extracted from the NumPy array. If you
77
77
query the header information about the dimensionality of the image, it returns
78
78
the desired values:
79
79
80
- >>> print nim.get_header() [' dim' ]
80
+ >>> print nim.header [' dim' ]
81
81
[ 4 32 32 16 100 1 1 1]
82
82
83
83
First value shows the number of dimensions in the datset: 4 (good, that's what
@@ -110,8 +110,8 @@ preserving as much header information as possible
110
110
111
111
>>> nim2 = nib.Nifti1Image(nim.get_data()[... , :10 ],
112
112
... nim.get_affine(),
113
- ... nim.get_header() )
114
- >>> print nim2.get_header() [' dim' ]
113
+ ... nim.header )
114
+ >>> print nim2.header [' dim' ]
115
115
[ 4 32 32 16 10 1 1 1]
116
116
>>> # a filename in our temporary directory
117
117
>>> fname = pjoin(tmpdir, ' part.hdr.gz' )
@@ -136,7 +136,7 @@ will first create a NIfTI image with just a single voxel and 50 timepoints
136
136
>>> nim = nib.Nifti1Image(
137
137
... (np.linspace(0 ,100 ) + np.random.randn(50 )).reshape(1 ,1 ,1 ,50 ),
138
138
... np.eye(4 ))
139
- >>> print nim.get_header() [' dim' ]
139
+ >>> print nim.header [' dim' ]
140
140
[ 4 1 1 1 50 1 1 1]
141
141
142
142
Depending on the datatype of the input image the detrending process might
@@ -154,4 +154,4 @@ source image.
154
154
155
155
>>> nim_detrended = nib.Nifti1Image(data_detrended,
156
156
... nim.get_affine(),
157
- ... nim.get_header() )
157
+ ... nim.header )
0 commit comments