How to plot a 3-Dimensional model

3 views (last 30 days)
Aik Hong
Aik Hong on 28 Feb 2015
Edited: Aik Hong on 28 Feb 2015
Hi all, I have 170 slices of 512 x 512 image in binary form (manual segmentation from a data set of medical images). I would like to get a 3 dimensional visualization/model of the object, something like in the picture below:
I used concatenation function to stack all the 170 images into one 3D matrix, D. My coding as below:
C = cell(1, 170);
for k = 1:170;
% Create a mat filename, and load it into a structure called matData.
matFileName = sprintf('AAAmanual%d.mat', k);
if exist(matFileName, 'file')
load(matFileName);
C{k} = BW; %BW is the name of saved matrix
else
fprintf('File %s does not exist.\n', matFileName);
end
end
D = cat(3, C{:});
I'm not sure whether this is the correct way to do so. So i need your advice and help to proceed from here. How should i write in Matlab code, or what is the function suitable to use to visualize the model?

Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!