Рассчитать объем маски
import nibabel as nb
import numpy as np
img = nb.load("path/to/img.nii")
num_vox = np.sum(img.get_data() > 0)
Confused Cobra
import nibabel as nb
import numpy as np
img = nb.load("path/to/img.nii")
num_vox = np.sum(img.get_data() > 0)