k-Wave Toolbox |
Form 3D matrix from revolution of 2D matrix
mat3D = revolve2D(mat2D)
revolve2D
revolves the values of a 2D matrix about the x axis (or matrix rows) to form a 3D matrix. A single point is taken as the x-axis origin, thus for an input matrix of size m by n, the output matrix will be m by (2n-1) by (2n-1). Values outside the interpolation range are set to zero. An example of revolving a 2D triangle is shown below.
% create a triangle in a 2D grid triangle = tril(ones(10, 10)); % rotate in 3D triangle_3D = revolve2D(triangle); % plot the revolved triangle voxelPlot(triangle_3D);
|
2D input matrix |
|
3D output matrix |
interp1
resize | saveTiffStack |
© 2009-2014 Bradley Treeby and Ben Cox.