Luckybuilding
Member level 1
- Joined
- Oct 8, 2005
- Messages
- 40
- Helped
- 2
- Reputation
- 4
- Reaction score
- 1
- Trophy points
- 1,288
- Activity points
- 1,615
Hi,
I wanna create a 3d surface for my data representing an object.
I have obtained the data for borders of each slice.
However, I can't create any surface!
Used code is:
The output image is shown below:
How can I create the surface out of these borders?
Thanks
I wanna create a 3d surface for my data representing an object.
I have obtained the data for borders of each slice.
However, I can't create any surface!
Used code is:
Code:
for a=1:length(D(1,1,:))
X=D(:,:,a);
BW = im2bw(X,mp,0.75);
CC = bwconncomp(BW);
for b=1:CC.NumObjects
clear TMP;
TMP=cell2mat(CC.PixelIdxList(b));
if isempty(find(TMP==fix(p_f)))
BW(CC.PixelIdxList{b}) = 0;
end
end
O(:,:,a)=imfill(BW,'holes');
end
figure;
phandles = contourslice(O,[],[],[20:57],1);
view(3); axis tight
set(phandles,'LineWidth',2)
Os = smooth3(O);
hiso = patch(isosurface(Os,1),...
'FaceColor',[1,.75,.65],...
'EdgeColor','none');
The output image is shown below:
How can I create the surface out of these borders?
Thanks