# Fast Marching in 3D¶


This tour explores the use of Fast Marching methods in 2D.

In [2]:
warning off
warning on


## 3D Volumetric Datasets¶

A volumetric data is simply a 3D array.

In [3]:
name = 'vessels';
options.nbdims = 3;
M = rescale(M);


Size of the image (here it is a cube).

In [4]:
n = size(M,1);


Such a volumetric dataset is more difficult to visualize than a standard 2D image. You can render slices along each X/Y/Z direction.

In [5]:
clf;
imageplot(M(:,:,50), 'X/Y slice', 1, 3, 1);
imageplot(squeeze(M(:,50,:)), 'X/Z slice', 1, 3, 2);
imageplot(squeeze(M(50,:,:)), 'Y/Z slice', 1, 3, 3);


We can display some horizontal slices.

In [6]:
slices = round(linspace(10,n-10,4));
clf;
for i=1:length(slices)
s = slices(i);
imageplot( M(:,:,s), strcat(['Z=' num2str(s)]), 2,2,i );
end


You can also perform a volumetric rendering. In order to do so, you need to set up a correct alpha mapping to make transparent some parts of the volume. Here, each time the options.center value is increased.

In [7]:
clf;
h = vol3d('cdata',M,'texture','2D');
view(3); axis off;