MATLAB: How to measure the thickness of an object having inner & outer irregular circle like shapes

measure the thickness of an object in 2d

I have segmented left ventricle in a MRI image using Random-Walker as shown in below image. Now I want to measure the thickness of Myocardium i.e. the gap between the inner & outer shape as shown in the following figure. Can someone please help me with this. Thanks in advance for your help! http://img690.imageshack.us/img690/9152/output1.jpg

Best Answer

You might also define an average thickness as follows
thickness = mean(min(interdists(A,B),[],2));
where the columns of the matrix A are the coordinates of the points on the outer boundary and B are the points on the inner boundary. This requires my interdists() utility function below.
function Graph=interdists(A,B)
%Finds the graph of distances between point coordinates
%




% (1) Graph=interdists(A,B)
%
% in:
%




% A: matrix whose columns are coordinates of points, for example
% [[x1;y1;z1], [x2;y2;z2] ,..., [xM;yM;zM]]
% but the columns may be points in a space of any dimension, not just 3D.
%
% B: A second matrix whose columns are coordinates of points in the same
% Euclidean space. Default B=A.
%
%
% out:
%
% Graph: The MxN matrix of separation distances in l2 norm between the coordinates.
% Namely, Graph(i,j) will be the distance between A(:,i) and B(:,j).
%
%
% (2) interdists(A,'noself') is the same as interdists(A), except the output
% diagonals will be NaN instead of zero. Hence, for example, operations
% like min(interdists(A,'noself')) will ignore self-distances.
%
% See also getgraph
noself=false;
if nargin<2
B=A;
elseif ischar(B)&&strcmpi(B,'noself')
noself=true;
B=A;
end
N=size(A,1);
B=reshape(B,N,1,[]);
Graph=sqrt(sum(bsxfun(@minus, A, B).^2,1));
Graph=squeeze(Graph);
if noself
n=length(Graph);
Graph(linspace(1,n^2,n))=nan;
end
Related Question