dipy_home+"/datasets_multi-site_all_companies/Stanford/b0.nii.gz"]
for f in files :
print(f)
img = nib.load(f)
data = img.get_data()
fname = os.path.splitext(os.path.splitext(f)[0])[0]
After Change
slice = data.shape[2]/2
plt.figure("Brain segmentation")
plt.subplot(1,2,1)
plt.imshow(data[:,:,slice])
plt.subplot(1,2,2)
plt.imshow(b0_mask[:,:,slice])
plt.show()
`medostu` can also automaticaly crop the outputs to remove the largest possible