clc;
A = imread('mri.jpg'); I = rgb2gray(A); imshow(I) title('Original Image')
mask = zeros(size(I)); mask(25:end-25,15:end-15) = 1; figure imshow(mask) title('Initial Contour Location')
bw = activecontour(I,mask,500);
figure imshow(bw) title('Segmented Image')
Best Answer