@@ -94,13 +94,14 @@ their call syntax is the same for example.
94
94
mat0_intent: 'MNI152'
95
95
descrip: 'NIFTI-1 Image'
96
96
97
-
97
+
98
98
So, in our (provisional) terms:
99
99
100
- * vol.mat == img.affine
101
- * vol.dim == img.shape
102
- * vol.dt(1) (vol.dt[0] in Python) is equivalent to img.io_dtype
103
- * vol.fname == img.filename
100
+ * ``vol.mat `` == ``img.affine ``
101
+ * ``vol.dim `` == ``img.shape ``
102
+ * ``vol.dt(1) `` (``vol.dt[0] `` in Python) is equivalent to
103
+ ``img.get_data_dtype() ``
104
+ * ``vol.fname `` == ``img.get_filename() ``
104
105
105
106
SPM abstracts the implementation of the image to the ``vol.private ``
106
107
member, that is not in fact required by the image interface.
@@ -126,7 +127,6 @@ Images in SPM are always 3D. Note this behavior:
126
127
127
128
That is, one vol struct per 3D volume in a 4D dataset.
128
129
129
-
130
130
SPM image methods / functions
131
131
=============================
132
132
@@ -176,18 +176,18 @@ Creating an image from scratch, and writing plane by plane (slice by slice):
176
176
177
177
.. sourcecode :: matlab
178
178
179
- >> new_vol = struct();
179
+ >> new_vol = struct();
180
180
>> new_vol.fname = 'yet_another_image.nii';
181
- >> new_vol.dim = [91 109 91];
181
+ >> new_vol.dim = [91 109 91];
182
182
>> new_vol.dt = [spm_type('float32') 0]; % little endian (0)
183
183
>> new_vol.mat = vol.mat;
184
184
>> new_vol.pinfo = [1 0 0]';
185
- >> new_vol = spm_create_vol(new_vol);
185
+ >> new_vol = spm_create_vol(new_vol);
186
186
>> for vox_z = 1:new_vol.dim(3)
187
- new_vol = spm_write_plane(new_vol, img_arr(:,:,vox_z), vox_z);
187
+ new_vol = spm_write_plane(new_vol, img_arr(:,:,vox_z), vox_z);
188
188
end
189
189
190
- I think it's true that writing the plane does not change the
190
+ I think it's true that writing the plane does not change the image
191
191
scalefactors, so it's only practical to use ``spm_write_plane `` for data
192
192
for which you already know the dynamic range across the volume.
193
193
@@ -268,7 +268,6 @@ world coordinates according to the affine looks like:
268
268
269
269
0.6792
270
270
271
-
272
271
Odder sampling, often used, can be difficult to understand:
273
272
274
273
.. sourcecode :: matlab
@@ -288,14 +287,13 @@ Odder sampling, often used, can be difficult to understand:
288
287
289
288
This is the simplest use - but in general any affine transform can go in
290
289
``slice_mat `` above, giving optimized (for speed) sampling of slices
291
- from volumes, as long as the transform is affine.
290
+ from volumes, as long as the transform is an affine.
292
291
293
292
Miscellaneous functions operating on vol structs:
294
293
295
- * spm_conv_vol - convolves volume with seperable functions in x, y, z
296
- * spm_render_vol - does a projection of a volume onto a surface
297
- * spm_vol_check - takes array of vol structs and checks for sameness of
294
+ * `` spm_conv_vol `` - convolves volume with seperable functions in x, y, z
295
+ * `` spm_render_vol `` - does a projection of a volume onto a surface
296
+ * `` spm_vol_check `` - takes array of vol structs and checks for sameness of
298
297
image dimensions and ``mat `` (affines) across the list.
299
298
300
- And then, many SPM function accept vol structs are arguments.
301
-
299
+ And then, many SPM functions accept vol structs as arguments.
0 commit comments