Mask Creation on an MRI Image

44 views (last 30 days)
Hello to everyone,
I have an image of the size 128*128, and it is a brain MRI image.
The brain is in the middle of the image and around the brain, there are very small values that I want to set them to zero, so that I can have just the brain area in a black background with surrounding pixels of the value 0, in other words: black. Because I will have to do this with lots of other images too i have to come up with a function.
Therefore I coded an algorithm that extracts a brain mask that I can multiply with the orginal image to just get the brain out. This does work fine, but it's not good enough. So I came up with this new idea that I take a default shape that's similar to the brain structure, and I get it to move around in the orginal image as long as the mean signal in that surface gets a maximum value, this would mean in another words that the shape has aligned itself with the brain, so it will have the maximum mean of signal(or sum of the signals of every pixel).
I can't think of anyway to implement this in code. Can someone help me with this problem? or maybe someone has another better idea to extract a mask from different brain structures similar to my problem.
Thanks alot for any tips.
RF.KS
  3 Comments
Gulfam Saju
Gulfam Saju on 21 Apr 2022
Hi! Can you please share the code of creating mask for muliplying with MRI image. TIA
Image Analyst
Image Analyst on 21 Apr 2022
@Gulfam Saju virtually all the code above is dedicated to creating that mask, mask_brain. Then you can use that to multiply it by im1 or im2.

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 23 Sep 2020
See my attached skull stripping demo.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!