MATLAB: How i segment medical image using active contour

below code how i set maski need code of image segmentation using deformable model/ active contouri want to detect edges of mri image using active contourImage Processing Toolbox

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

That could be about right. If it's not, then you might try to get a better starting mask. I have attached my activecontour() demo.