-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot3DSkeleton.m
More file actions
55 lines (54 loc) · 1.69 KB
/
plot3DSkeleton.m
File metadata and controls
55 lines (54 loc) · 1.69 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
%% ---------------------- 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 plot3DSkeleton(skeletonBin)
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(skel,0),'FaceColor',col,'EdgeColor','none');
hiso2 = patch(isocaps(skel,0),'FaceColor',col,'EdgeColor','none');
axis equal;axis off;
lighting phong;
isonormals(skel,hiso);
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');
title('Skeletonized Section');
set(gcf,'Color','white');
view(-59,52);
title('Skeletonized Section');
tinyaxis(gca,'r','g','b');
%{
addpath('C:\Users\Avik Mondal\Documents\Carlson Lab\Bone Project MATLAB code\phi-max-skeleton3d-matlab-c534cab');
skel = Skeleton3D(skeletonBin);%Color',col,'EdgeColor','none');
axis equal;axis off;
lighting phong;
isonormals(skel);
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');
title('Skeletonized Section');
set(gcf,'Color','white');
view(-59,52);
%}