Esophagus 3D Modelling Issue

Hello,
I am trying to build a 3D model of the esophagus (approximated to a cylinder), and I need to define the radius layer-by-layer. I have the data concerning the radius of every cross-section at some instants in time, but I do not know how can I create a dynamic 3D model. I took a look at the function cylinder and patch, but I did not manage to come up with anything.
Any help would be greatly appreciated.

10 comentarios

Sara
Sara el 9 de Jul. de 2014
What do you need? To define the points on the surface? To plot it nicely? What is your goal?
Vittorio
Vittorio el 9 de Jul. de 2014
I would like to have a nice view of the 3D cylinder built using different radii for the layers composing it.
Sara
Sara el 9 de Jul. de 2014
Try this and let us know what you think. the radius and its position x are invented, replace them with your data.
clc
clearvars
close all
radius = [1 1.1 1.2 1.3 1.4 1.5 1.4 1.4 1.1 0.8];
x = linspace(1,30,10);
n = 600;
xx = zeros(numel(x),n);
yy = zeros(numel(x),n);
for i = 1:numel(x)
[xx(i,:),yy(i,:)] = circle(x(i),0,radius(i),n);
end
surf(repmat(x',1,n),xx,yy)
function [xx,yy] = circle(x,y,r,n)
ang=linspace(0,2*pi,n);
xp=r*cos(ang);
yp=r*sin(ang);
xx = x+xp;
yy = y+yp;
Image Analyst
Image Analyst el 9 de Jul. de 2014
sara, post as an official Answer so you can get credit for it.
Vittorio
Vittorio el 10 de Jul. de 2014
Thanks for your answer! This is what I was looking for. Can you please tell me how can I rotate the cylinder to have it displayed vertically?
Ben11
Ben11 el 10 de Jul. de 2014
Editada: Ben11 el 10 de Jul. de 2014
To interactively rotate the cylinder type "rotate3d on" after your call to surf.
doc rotate3d
Vittorio
Vittorio el 10 de Jul. de 2014
Yes, I saw the button there to rotate it, but I would prefer the code to do it from the start, without doing it manually.
Sara
Sara el 10 de Jul. de 2014
Look into
rotate
Vittorio
Vittorio el 11 de Jul. de 2014
I managed to rotate it, thanks for the tip. Still, I need my structure to be symmetric, not shifted with respect to the various radii. What I have now is this:
Vittorio
Vittorio el 11 de Jul. de 2014
Editada: Vittorio el 11 de Jul. de 2014
I searched on file exchange and I found this amazing .m file:
Thanks to all for the support and your answers!

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Preguntada:

el 9 de Jul. de 2014

Cerrada:

el 20 de Ag. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by