MATLAB Answers

How to create isotropic voxels in an image stack without loosing original dimensions?

7 views (last 30 days)
Katharina Hecker
Katharina Hecker on 18 Jun 2018
Answered: Sayyed Ahmad on 18 Jun 2018
Hi everyone, I was wondering how to change the voxels of an image stack into isotropic voxels (50x50x50) without loosing the dimensions of an image: x = 13 mm, y = 10 mm z = 6.05 mm).
The problem is that I have to adjust the z axis of the stack to get 6.05 mm.
The matrix of the image stack is 1186x1834x121 double.
I was looking over the functions interp3, meshgrid formation and so on, but I could not find the right example, so that I understand which codes to use in which way... Thank you very much for your help!!!
Sayyed Ahmad
Sayyed Ahmad on 18 Jun 2018
in matlab you have to diffrent kind of visualisation. 1. one is to visualiasing some vectorial behaviour of the nature for example wind. You kann find in m atlab a very googd example to do that aim.
load wind
xmin = min(x(:));
xmax = max(x(:));
ymax = max(y(:));
zmin = min(z(:));
wind_speed = sqrt(u.^2 + v.^2 + w.^2);
hsurfaces = slice(x,y,z,wind_speed,[xmin,100,xmax],ymax,zmin);
colormap jet
hcont = ...
set(hcont,'EdgeColor',[0.7 0.7 0.7],'LineWidth',0.5)
[sx,sy,sz] = meshgrid(80,20:10:50,0:5:15);
hlines = streamline(x,y,z,u,v,w,sx,sy,sz);
axis equal
The other one is the Image manipulation. for example put the Image in the space.
[xSphere,ySphere,zSphere] = sphere(16); %# Points on a sphere
scatter3(xSphere(:),ySphere(:),zSphere(:),'.'); %# Plot the points
axis equal; %# Make the axes scales match
hold on; %# Add to the plot
img = imread('peppers.png'); %# Load a sample image
xImage = [-0.5 0.5; -0.5 0.5]; %# The x data for the image corners
yImage = [0 0; 0 0]; %# The y data for the image corners
zImage = [0.5 0.5; -0.5 -0.5]; %# The z data for the image corners
surf(xImage,yImage,zImage,... %# Plot the surface

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by