Help understanding the algorithms used in this code.
Afficher commentaires plus anciens
Hello! I came across this volumetric imaging code and I'm trying to better understand how the algorithms work. Could someone help explain what each algorithm is doing?
clear;
vol=zeros(98,98,111);
fp = fopen('pigSmall.img','r');
for z=1:110;
z
for i=1:97
for j=1:97
rho=fread(fp,1,'char');
vol(i,j,z)=rho;
end
end
end
img=zeros(98,98);
minth=20;
P=eye(4);
P(3,3)=0;
vox=zeros(4,1);
pos=zeros(4,1);
for i=1:97
for j=1:97
for z=1:110
vox=transpose([i,j,z,1]);
pos=P*vox;
rho=vol(i,j,z);
if pos(1,1) > 0 & pos(1,1) < 98 & pos(2,1) > 0 & pos(2,1) < 98
if rho > img(pos(1,1),pos(2,1)) & rho > minth
img(pos(1,1),pos(2,1)) = rho;
end
end
end
end
end
minint=min(min(img));
img=img-minint;
maxint = max(max(img));
img=img/maxint*64;
colormap(gray)
image(img)
Since mathworks wont let me attach the pigSmall.img file this is the output of the code:

Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Color Segmentation dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!