749855e9d1b5bd1aa7b46db144503922fbc0a336,doc/examples/brain_extraction_dwi.py,,,#,8
Before Change
dipy_home+"/datasets_multi-site_all_companies/1.5T/Siemens/b0.nii.gz",
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]
b0_mask, mask = medotsu(data, 4, 4, autocrop=False)
mask_img = nib.Nifti1Image(mask.astype(np.float32), img.get_affine())
b0_img = nib.Nifti1Image(b0_mask.astype(np.float32), img.get_affine())
nib.save(mask_img, fname+"_binary_mask.nii.gz")
nib.save(b0_img, fname+"_mask.nii.gz")
b0_mask_crop, mask_crop = medotsu(data, 4, 4, autocrop=True)
mask_img_crop = nib.Nifti1Image(mask_crop.astype(np.float32), img.get_affine())
b0_img_crop = nib.Nifti1Image(b0_mask_crop.astype(np.float32), img.get_affine())
nib.save(mask_img_crop, fname+"_binary_mask_crop.nii.gz")
nib.save(b0_img_crop, fname+"_mask_crop.nii.gz")
After Change
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
number of backgroud voxels. This makes outputted data significantly smaller.
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances Project Name: nipy/dipy
Commit Name: 749855e9d1b5bd1aa7b46db144503922fbc0a336
Time: 2013-08-06
Author: matthieu.dumont@usherbrooke.ca
File Name: doc/examples/brain_extraction_dwi.py
Class Name:
Method Name:
Project Name: kymatio/kymatio
Commit Name: 44e510ee7d49fe9e9126b2e1ecbd916a18450e84
Time: 2018-11-25
Author: edouard.oyallon@centralesupelec.fr
File Name: examples/2d/plot_filters.py
Class Name:
Method Name:
Project Name: interactiveaudiolab/nussl
Commit Name: 97b74b011d7f4e3a144be6417a7285c0fc91fd72
Time: 2017-09-16
Author: ethanmanilow@gmail.com
File Name: demos/demo_ica.py
Class Name:
Method Name: main