-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot3DSkeletonOverlay.m
More file actions
35 lines (33 loc) · 1.21 KB
/
plot3DSkeletonOverlay.m
File metadata and controls
35 lines (33 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
%% ---------------------- plot3DSkeleton --------------------------------
% Avik Mondal
%
% Aim:
% - create a void function that plots the medial axis of a skeletal VOI
% (this is effectively a functional form of Test_Skeleton3D
%
% Parameters:
%
% array skeletonBin - contains the binarized skeletal VOI
%--------------------------------------------------------------------------
function plot3DSkeletonOverlay(skeletonBin)
%addpath('C:\Users\avik2\Documents\Carlson Lab\Bone Project MATLAB code\phi-max-skeleton3d-matlab-c534cab');
addpath('C:\Users\Avik Mondal\Documents\Carlson Lab\Bone Project MATLAB code\phi-max-skeleton3d-matlab-c534cab');
skel = Skeleton3D(skeletonBin);
figure();
col=[.7 .7 .8];
%hiso = patch(isosurface(skeletonBin,0),'FaceColor',col,'EdgeColor','none');
hiso2 = patch(isocaps(skeletonBin,0),'FaceColor',col,'EdgeColor','none');
axis equal;axis off;
lighting phong;
isonormals(skeletonBin,hiso2);
alpha(0.5);
set(gca,'DataAspectRatio',[1 1 1])
camlight;
hold on;
w=size(skel,1);
l=size(skel,2);
h=size(skel,3);
[x,y,z]=ind2sub([w,l,h],find(skel(:)));
plot3(y,x,z,'square','Markersize',4,'MarkerFaceColor','r','Color','r');
set(gcf,'Color','white');
view(140,80)