Skip to content

Commit 2331e9d

Browse files
JulianKlugeffigies
andauthored
Apply suggestions from code review
Co-authored-by: Chris Markiewicz <[email protected]>
1 parent 93532de commit 2331e9d

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

nibabel/imagestats.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,23 @@
1616
def count_nonzero_voxels(img):
1717
"""
1818
Count number of non-zero voxels
19+
1920
Parameters
2021
----------
2122
img : ``SpatialImage``
2223
All voxels of the mask should be of value 1, background should have value 0.
2324
2425
Returns
2526
-------
26-
non zero voxel volume: int
27+
count : int
2728
Number of non-zero voxels
2829
2930
"""
3031
return np.count_nonzero(img.dataobj)
3132

3233
def mask_volume(img):
3334
""" Compute volume of mask image.
35+
3436
Equivalent to "fslstats /path/file.nii -V"
3537
3638
Parameters
@@ -41,7 +43,7 @@ def mask_volume(img):
4143
4244
Returns
4345
-------
44-
mask_volume_mm3: float
46+
volume : float
4547
Volume of mask expressed in mm3.
4648
4749
Examples

nibabel/tests/test_imagestats.py

-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
from .. import imagestats
1414
from .. import Nifti1Image
1515

16-
import pytest
17-
1816

1917
def test_mask_volume():
2018
# Test mask volume computation
@@ -28,4 +26,3 @@ def test_mask_volume():
2826

2927
assert vol_mm3 == 1000.0
3028
assert vol_vox == 1000
31-

0 commit comments

Comments
 (0)