plot voxelized geometry from middle coordinates

4 vues (au cours des 30 derniers jours)
Sara Principi
Sara Principi le 15 Nov 2017
Commenté : Sara Principi le 16 Nov 2017
Hello, I would like to plot the voxelized geometry below. I have the middle coordinates of x,y,z and the corresponding dose. For middle coordinates I intend that if a voxel of the geometry is defined along the x axis from 0 to 10, its middle coordinate is 5. I am doing this but it doesn't work:
{XY=[mid_x mid_y];
Z=[mid_z dose];
surf(XY,Z);}
{
Voxelized geometry
mid_x mid_y mid_z dose
5 0,500000000000000 5 2,52298164367676
15 0,500000000000000 5 2,64519572257996
25 0,500000000000000 5 2,52241730690002
5 0,500000000000000 15 2,64528870582581
15 0,500000000000000 15 2,65645980834961
25 0,500000000000000 15 2,64508199691772
5 0,500000000000000 25 2,52284812927246
15 0,500000000000000 25 2,64546251296997
25 0,500000000000000 25 2,52243471145630
}
Thanks.

Réponse acceptée

KSSV
KSSV le 16 Nov 2017
This is the way to proceed....but there is some problem with your data.
A = [5 0,500000000000000 5 2,52298164367676
15 0,500000000000000 5 2,64519572257996
25 0,500000000000000 5 2,52241730690002
5 0,500000000000000 15 2,64528870582581
15 0,500000000000000 15 2,65645980834961
25 0,500000000000000 15 2,64508199691772
5 0,500000000000000 25 2,52284812927246
15 0,500000000000000 25 2,64546251296997
25 0,500000000000000 25 2,52243471145630] ;
mid_x = reshape(A(:,1),3,[]) ;
mid_y = reshape(A(:,2),3,[]) ;
mid_z = reshape(A(:,3),3,[]) ;
dose = reshape(A(:,4),3,[]) ;
surf(mid_x,mid_y,mid_z,dose)
  1 commentaire
Sara Principi
Sara Principi le 16 Nov 2017
It works but it skips the bounding voxels, should I insert the information about the voxel dimensions (10cm x1cm x10cm)somewhere I guess because I obtain a surface and it is a cube..

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Interpolation dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by