New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix brain extraction example #326

Merged
merged 7 commits into from Feb 24, 2014

Conversation

Projects
None yet
2 participants
@matthieudumont
Contributor

matthieudumont commented Feb 18, 2014

This is a fix for the following issue:
#321

  • Example brain was changed to scil's Siemens 1.5t to have a more explicit background removal.
  • Screenshots go through histogram equalization to make background noise more obvious.
  • Brain is now rotated to face top of the SS.
This was taken from:
http://www.janeriksolem.net/2009/06/histogram-equalization-with-python-and.html
Input

This comment has been minimized.

@Garyfallidis

Garyfallidis Feb 18, 2014

Member

Parameters

Image on which to perform histogram equalization.
num_bins : int
Number of bins used to construct the histogram.
"""

This comment has been minimized.

@Garyfallidis
@@ -115,6 +115,18 @@ def read_scil_b0():
file = dipy_home+'/datasets_multi-site_all_companies/3T/GE/b0.nii.gz'

This comment has been minimized.

@Garyfallidis

Garyfallidis Feb 18, 2014

Member

Oh, I just discovered a serious bug. This file path is not OS independent. We need to use os.path.join (pjoin in the code).

Nifti1Image
"""
dipy_home = os.path.join(os.path.expanduser('~'), '.dipy')
file = dipy_home+'/datasets_multi-site_all_companies/1.5T/Siemens/b0.nii.gz'

This comment has been minimized.

@Garyfallidis

Garyfallidis Feb 18, 2014

Member

Same as above.

sli = data.shape[2] / 2
plt.figure('Brain segmentation')
plt.subplot(1, 2, 1).set_axis_off()
plt.imshow(data[:, :, sli], cmap='gray')
plt.imshow(

This comment has been minimized.

@Garyfallidis

Garyfallidis Feb 18, 2014

Member

Please, break the line in cmap. And align histeq with cmap.

plt.subplot(1, 2, 2).set_axis_off()
plt.imshow(b0_mask[:, :, sli], cmap='gray')
plt.imshow(
histeq(b0_mask[:, :, sli].astype('float')).T, cmap='gray', origin='lower')

This comment has been minimized.

@Garyfallidis

Garyfallidis Feb 18, 2014

Member

Same as above.

matthieudumont added some commits Feb 18, 2014

@Garyfallidis

This comment has been minimized.

Member

Garyfallidis commented Feb 24, 2014

Thank you @matthieudumont :)

Garyfallidis added a commit that referenced this pull request Feb 24, 2014

@Garyfallidis Garyfallidis merged commit e816807 into nipy:master Feb 24, 2014

1 check passed

default The Travis CI build passed
Details

@matthieudumont matthieudumont deleted the matthieudumont:fix_brain_extraction_example branch Jun 22, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment