How to find the inner contour of myocardium by using region growing

2 Ansichten (letzte 30 Tage)
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

Akzeptierte Antwort

Image Analyst
Image Analyst am 18 Mär. 2015
Region growing? Why would you want to use that method? Did someone recommend it? This does not look like a situation where region growing is needed. In fact it could even make it worse. If the tolerance is high enough, the region could "jump across" the black or white surround and capture some stuff you don't want. And if the tolerance is small, then you're basically doing thresholding like the method I recommended in your first, related question: http://www.mathworks.com/matlabcentral/answers/183551-how-to-find-the-inner-contour-of-the-myocardium#comment_272631
  2 Kommentare
Neil Liu
Neil Liu am 18 Mär. 2015
Thank you! But actually I don't know how to threshold it in an appropriate way. "then get rid of blobs touching the border with imclearborder()" I cannot realize this step well. Could you please give me some help?
Image Analyst
Image Analyst am 19 Mär. 2015
No time today - sorry. Maybe tomorrow afternoon.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Christiaan
Christiaan am 18 Mär. 2015
Bearbeitet: Christiaan am 18 Mär. 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
  1 Kommentar
Neil Liu
Neil Liu am 18 Mär. 2015
Thank you for answering me, Christiaan! Actually I just need the inner contour, I have found how to find the outer contour. "imfindcircles' is good but it can just find a regular circle

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by