フィルターのクリア

Change the voxel size from a 3D matrix

3 ビュー (過去 30 日間)
Katharina Hecker
Katharina Hecker 2018 年 6 月 18 日
コメント済み: Katharina Hecker 2018 年 6 月 18 日
Hi everyone,
I wanted to change the voxel size of an image stack in 50x50x50 Right now I loaded the image stack into a matrix inside a .mat file It has the dimensions: 1186x1834x121 Initially I just wanted to change the dimensions of the z axis in mm to 6.05 mm so that I have a the right relation (one image was 0.05mm thick; all dimensions: x = 13 mm y = 10 mm z = 6.05 mm), but I wasn´t able to find the right code, since I´m new to Matlab I need more time to look into every code. I would be really happy about any suggestions!!! Thanks in advance.
  1 件のコメント
Katharina Hecker
Katharina Hecker 2018 年 6 月 18 日
PS: I forgot to add double: 1186x1834x121 double

サインインしてコメントする。

採用された回答

KSSV
KSSV 2018 年 6 月 18 日
Read about interpn
A = rand(1186,1834,121) ;
[m1,n1,p1]= size(A) ;
x0 = 13 ; y0 = 10 ; z0 = 6.05 ;
x1 = x0+(m1-1)*x0 ;
y1 = y0+(n1-1)*y0 ;
z1 = z0+(p1-1)*z0 ;
x = linspace(x0,x1,m1) ;
y = linspace(y0,y1,n1) ;
z = linspace(z0,z1,p1) ;
[X1,Y1,Z1] = ndgrid(x,y,z) ;
xi = linspace(x0,x1,50) ;
yi = linspace(y0,y1,50) ;
zi = linspace(z0,z1,50) ;
[Xi,Yi,Zi] = ndgrid(xi,yi,zi) ;
Ai = interpn(X1,Y1,Z1,A,Xi,Yi,Zi) ;
  1 件のコメント
Katharina Hecker
Katharina Hecker 2018 年 6 月 18 日
Thank you very much! It is working.

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by