How to segment away the skull from the brain in MRI image

matlab

Solution

Looks like the skull is always on the outside of the image, and it's always well-separated from the brain.

Approach 1: First principles

Draw a line across the centre of the image and stop when you find the first white pixel - this will be part of the skull. Find all pixels connected to that pixel. Remove them and you are left with the brain.

Approach 2: Use the image processing toolbox

This is the "connected components segmentation" problem. MATLAB's image processing toolbox has a `bwconncomp()` function that enumerates connected components in a black and white image. See this tutorial about how to count grains of rice in a photo - very similar problem.

Problem

I have been given a data set consisting of image slizes from a MRI scan of a brain. With these images, I am to remove the skull, so that only the brain remains. Are there any good segmentation techniques that can be used on these types of images?

Original source