function [ BW ] = segmentImage( img )
%UNTITLED2 Summary of this function goes here
%   Detailed explanation goes here
    
    % segmentation using fast marching method
    imshow(img);
    [seedPointR, seedPointC] = getpts();
    mask = false(size(img)); 
    mask(round(seedPointR), round(seedPointC)) = true;
    W = graydiffweight(img, mask, 'GrayDifferenceCutoff', 10);
    thresh = 0.01;
    [BW, ~] = imsegfmm(W, mask, thresh);
    
    imshowpair(img, BW, 'montage')

end

