Vertex Sorting of 3D Images

1 view (last 30 days)
Zev Steinberg
Zev Steinberg on 22 Dec 2016
The problem I am dealing with is that I am taking the image data from two 2D images (MRI scans) and to determine which points on the lower slice correspond to the points on the upper slice, then ordering them in order to form a mesh enclosing the boundaries of the image.
for j=1:size(Old_Slice,1)
% Old Slice refers to the Upper slice while Vertices refers to the upper slice
GPx=abs(Old_Slice(j,1)-Vertices(:,1));
GPy=abs(Old_Slice(j,2)-Vertices(:,2));
GP=[GPx GPy];
[val,idx]=min(sum(GP,2));
% Setting a minimum value of how close the two points of the images must be
if val<0.5
if lag==0
k=1;
lag=2;
end
order(k)=idx;
k=k+1;
end
end
k=1;
% Attempting to order the Vertexes so they follow the right order to plot
while k<min([size(Old_Slice,1) size(order,2)])
NData(2*k-1,:)=[Old_Slice(k,:) (i-1)/10];
NData(2*k,:)=[Vertices(order(k),:) i/10];
k=k+1;
end
The main issue comes in that when I try to order the vertexes of the two images so that I can plot them in the sequential order it works for about half of the data points but not all.

Answers (0)

Categories

Find more on Elementary Polygons 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!