Image segmentation using the Expectation-Maximization (EM) algorithm that relies on a Gaussian Mixture Model (GMM) for the intensities
and a Markov Random Field (MRF) model on the labels.
This is based on "Segmentation of brain MR images through a hidden Markov random field model and the expectation-maximization algorithm" (Zhang, Y et al., 2001)
See code/main.mlx
and run it cell by cell.
code/main.mlx
: The main script/driver programcode/EM.m
: Implements the EM algorithmcode/G.m
: Returns the Gaussian PDF's value at the given pointcode/ICM.m
: Finds the optimal labelling using a modified Iterated Conditional Modes (ICM) algorithmcode/KMeans.m
: Returns the initial segmentation using the standard K-means algorithmcode/logPosterior.m
: Computes the log of the posterior probability for the labels (up to a constant)code/priorPenalty.m
: The prior penalty for the given pixel using a 4 neighbourhood system, without wrap-around (uses the Potts Model)code/showSegmented.m
: Plots the segmented image using a custom colormap
(This was done as a course assignment for CS736: Medical Image Computing, Spring 2021, IIT Bombay)