mymesh.converter.voxel2im#
- mymesh.converter.voxel2im(VoxelCoords, VoxelConn, Vals)[source]#
Convert a rectilinear voxel mesh (grid) to an 3D image matrix.
- Parameters:
VoxelCoords (array_like) – Node coordinates of the voxel mesh
VoxelConn (array_like) – Node connectivity of the voxel mesh
Vals (array_like) – Values associated with either the nodes (len(Vals)=len(VoxelCoords)) or elements (len(Vals)=len(VoxelConn)) that will be stored in the image matrix.
- Returns:
I – 3D array of image data. This data is ordered such that the three axes of the array (0, 1, 2) correspond to (z, y, x). I.e. I[i,:,:] will give a 2D array in the yx plane at z-position i.
- Return type:
np.ndarray