How to find the inner contour of myocardium by using region growing
Show older comments
Hello everybody! Wish you have a good day. I want to use region growing to automatically find the inner contour of the myocardium, is this possible? Here is the orignal image:

and here is what I want:

the code I am using is:
function [l,s] = growcut(image,labels)
img = double(image);
si = size(image);
sl = size(labels);
assert(numel(unique(labels))==3,...
'labels must be comprised of -1, 0, 1');
assert(all(sl(1:2)==si(1:2)),...
'labels and image must be the same size');
[l s] = growcutmex(img,labels);
load test_data
subplot(2,2,1), imshow(img); title('Image'); subplot(2,2,2), imshow(labels,[]); title('Seeds');
[labels_out, strengths] = growcut(img,labels); labels_out = medfilt2(labels_out,[9,9]);
subplot(2,2,3), imshow(img); hold on; contour(labels_out,[0 0],'g','linewidth',4); contour(labels_out,[0 0],'k','linewidth',2); hold off; title('Output');
subplot(2,2,4), imshow(labels_out); title('Binary Output');
I always met some problems, and the code cannot work, just like:
Error using growcut (line 21) Not enough input arguments. or
Undefined function 'growcutmex' for input arguments of type 'double'.
Error in growcut (line 29) [l s] = growcutmex(img,labels);
Error in test (line 8) [labels_out, strengths] = growcut(img,labels);
Could you please help me to find the problem or modify the code? Best regards
Accepted Answer
More Answers (1)
Christiaan
on 18 Mar 2015
Edited: Christiaan
on 18 Mar 2015
Dear Neil,
The MATLAB function imfindcircles can find circles for you. The diameter and center also is given. If you know the size of the image (in meters) you can convert the radius of the cell in a length.
clc;clear all;close all
figure(1)
A = imread('imagecircle.jpg');imshow(A);
level = graythresh(A);BlackWhite = im2bw(A, 0.2);
[centers, radii, metric] = imfindcircles(BlackWhite,[25 100],'Sensitivity',0.92)
[a1 a2]= max(radii)
viscircles(centers, radii,'EdgeColor','b')
Good Luck! Christiaan
Categories
Find more on Image Segmentation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!