Skip to content

Commit

Permalink
BF: adapt sphinx doctests to numpy 1.12
Browse files Browse the repository at this point in the history
Integer indices, array returned instead of memmap.
  • Loading branch information
matthew-brett committed Jan 25, 2017
1 parent 79ff7bf commit 98dcd77
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions doc/source/coordinate_systems.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ middle voxel in the EPI data array like this:
:nofigs:

>>> n_i, n_j, n_k = epi_img_data.shape
>>> center_i = (n_i - 1) / 2.
>>> center_j = (n_j - 1) / 2.
>>> center_k = (n_k - 1) / 2.
>>> center_i = (n_i - 1) // 2 # // for integer division
>>> center_j = (n_j - 1) // 2
>>> center_k = (n_k - 1) // 2
>>> center_i, center_j, center_k
(26.0, 30.0, 16.0)
(26, 30, 16)
>>> center_vox_value = epi_img_data[center_i, center_j, center_k]
>>> center_vox_value
81.549287796020508
Expand Down
2 changes: 1 addition & 1 deletion doc/source/nifti_images.rst
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ Now we save the image and load it again:
The data array has the scaling applied:

>>> scaled_img.get_data()
memmap([[[ 10., 12., 14., 16.],
...([[[ 10., 12., 14., 16.],
[ 18., 20., 22., 24.],
[ 26., 28., 30., 32.]],
<BLANKLINE>
Expand Down

0 comments on commit 98dcd77

Please sign in to comment.