# Diffusion MRI brain extraction

**URL:** <https://discourse.slicer.org/t/diffusion-mri-brain-extraction/7736>\
**Category:** SlicerDMRI\
**Tags:** bug\
**Created:** [July 24, 2019, 1:56am UTC](https://discourse.slicer.org/t/diffusion-mri-brain-extraction/7736 "2019-07-24T01:56:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmukh](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rmukh/32/4249_2.png) [@rmukh](https://discourse.slicer.org/u/rmukh)\
**Post date:** [July 24, 2019, 1:56am UTC](https://discourse.slicer.org/t/diffusion-mri-brain-extraction/7736/1 "2019-07-24T01:56:01Z")

</div>

I found two bugs on the brain mask extraction utility (Diffusion Brain Masking) from diffusion images.

1. It creates a mask which is just a plain square. I think it is the problem with the option ‘Remove islands in Brain Mask’

2. If I disable this option, then inverted mask generated.

Please, find images attached.  
Stable release 4.10 works fine.

Package: Slicer-4.11.0-2019-07-22-linux-amd64  
OS: Ubuntu 18.04.2 LTS

 ![Screenshot%20from%202019-07-23%2015-13-00](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/2/72cf59b907be3aca169323c1e777ae29e4e45763.png)

---

<div class="post-metadata">

**Author:** ![ljod](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ljod/32/652_2.png) [@ljod](https://discourse.slicer.org/u/ljod)\
**Post date:** [August 1, 2019, 3:43pm UTC](https://discourse.slicer.org/t/diffusion-mri-brain-extraction/7736/2 "2019-08-01T15:43:39Z")

</div>

THanks. Yes this is due to a bug in ITK 5. I have not yet had time to push the information upstream somehow. There is a workaround in the nightly but it fails if the background is larger than the brain volume. This is helpful if you can share your dataset at a later time for testing.
