How to find the inner contour of myocardium by using region growing
조회 수: 2 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
채택된 답변
Image Analyst
2015년 3월 18일
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
추가 답변 (1개)
Christiaan
2015년 3월 18일
편집: Christiaan
2015년 3월 18일
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
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!