Created
January 9, 2017 11:07
-
-
Save lesolorzanov/318739fd826d40ed96afc22fd05f1db6 to your computer and use it in GitHub Desktop.
Iso surface from image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
close all | |
clear all | |
fname ='C:\Users\Administrator\Documents\Leslie\Uppsala\registered161101\crops\b1-2-0001-1757-1887-White Top Hat.tif'; | |
info = imfinfo(fname); | |
num_images = numel(info); | |
w =info.Width; | |
h= info.Height; | |
allg = zeros(h,w,'uint16'); | |
for k = 1:num_images | |
A = imread(fname, k, 'Info', info); | |
allg(:,:,k)=A; | |
end | |
fname ='C:\Users\Administrator\Documents\Leslie\Uppsala\registered161101\crops\b1-3-0001-1757-1887-White Top Hat.tif'; | |
info = imfinfo(fname); | |
num_images = numel(info); | |
w =info.Width; | |
h= info.Height; | |
all1 = zeros(h,w,'uint16'); | |
for k = 1:num_images | |
A = imread(fname, k, 'Info', info); | |
all1(:,:,k)=A; | |
end | |
fname ='C:\Users\Administrator\Documents\Leslie\Uppsala\registered161101\crops\b1-4-0001-1757-1887-White Top Hat.tif'; | |
info = imfinfo(fname); | |
num_images = numel(info); | |
w =info.Width; | |
h= info.Height; | |
all2 = zeros(h,w,'uint16'); | |
for k = 1:num_images | |
A = imread(fname, k, 'Info', info); | |
all2(:,:,k)=A; | |
end | |
fname ='C:\Users\Administrator\Documents\Leslie\Uppsala\registered161101\crops\b1-5-0001-1757-1887-White Top Hat.tif'; | |
info = imfinfo(fname); | |
num_images = numel(info); | |
w =info.Width; | |
h= info.Height; | |
all3 = zeros(h,w,'uint16'); | |
for k = 1:num_images | |
A = imread(fname, k, 'Info', info); | |
all3(:,:,k)=A; | |
end | |
fname ='C:\Users\Administrator\Documents\Leslie\Uppsala\registered161101\crops\b1-6-0001-1757-1887-White Top Hat.tif'; | |
info = imfinfo(fname); | |
num_images = numel(info); | |
w =info.Width; | |
h= info.Height; | |
all4 = zeros(h,w,'uint16'); | |
for k = 1:num_images | |
A = imread(fname, k, 'Info', info); | |
all4(:,:,k)=A; | |
end | |
% green T ,magenta G ,orange C ,cyan A | |
all1=permute(all1,[3,2,1]); | |
all2=permute(all2,[3,2,1]); | |
all3=permute(all3,[3,2,1]); | |
all4=permute(all4,[3,2,1]); | |
allg=permute(allg,[3,2,1]); | |
% p = patch(isosurface(allg,750)); | |
% isonormals(allg,p); | |
% p.FaceColor = 'cyan'; | |
% p.EdgeColor = 'none'; | |
% p.SpecularStrength=0.5; | |
% daspect([1,1,1]) | |
% % view(90,0); | |
% view(225,45); | |
axis([0 63 0 7 0 66]) | |
set(gca,'Ytick',0:1:7); | |
% l1=light('color',[1,1,0.25],'Position',[0 0 1]); | |
% l2=light('color','blue','Position',[0 -1 0]); | |
% lighting gouraud | |
box on | |
grid on | |
% | |
% hold on | |
hold on | |
p = patch(isosurface(all1,450)); | |
isonormals(all1,p); | |
p.FaceColor = 'green'; | |
p.EdgeColor = 'green'; | |
daspect([1,1,0.7]) | |
% set(gca,'Ztick',0:1:7); | |
camlight | |
lighting gouraud | |
hold on | |
p = patch(isosurface(all2,300)); | |
isonormals(all2,p); | |
p.FaceColor = 'magenta'; | |
p.EdgeColor = 'magenta'; | |
daspect([1,1,0.7]) | |
% set(gca,'Ztick',0:1:7); | |
camlight | |
lighting gouraud | |
hold on | |
p = patch(isosurface(all3,400)); | |
isonormals(all3,p); | |
p.FaceColor = [1,0.5,0.1]; | |
p.EdgeColor= [1,0.5,0.1]; | |
% 'blue'; | |
daspect([1,1,1]) | |
% set(gca,'Ztick',0:1:7); | |
camlight | |
lighting gouraud | |
hold on | |
p = patch(isosurface(all4,400)); | |
isonormals(all4,p); | |
p.FaceColor = 'cyan'; | |
p.EdgeColor = 'cyan'; | |
daspect([1,0.7,1]) | |
axis([0 63 0 7 0 66]) | |
view(225,30); | |
% set(gca,'Ytick',0:1:7); | |
camlight | |
lighting gouraud | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment