im3dtran: 3d image transpose (used for rotates as well)

Package: vol

Usage

im3dtran input output

Parameters

input
Input 3d image (datacube).
output
Transposed datacube.
len_blk = 128
Size in pixels of linear internal subraster. IM3DTRAN will try to transpose a subraster up to len_blk cubed at one time. Runtime is much faster with larger len_blk, but the task may run out of memory.
new_x = 3
New x axis = old axis (1=x, 2=y, 3=z). Default (3) replaces new x with old z.
new_y = 2
New y axis = old axis. Default (2) is identity.
new_z = 1
New z axis = old axis. Default (1) replaces new z with old x.

Description

IM3DTRAN is very similar to IMAGES.IMTRANSPOSE, except that it can accomplish 3d image transposes. In 3 dimensions, it is necessary to specify which old axes map to the new axes. In all cases, IM3DTRAN maps old axis element 1 to new axis element 1, i.e. it does not flip axes, just transposes them.

If one wants to use IM3DTRAN to rotate a datacube 90 degrees in any direction, it is necessary to use a combination of flip and transpose (just like in the 2d case). For example, let the original datacube be visualized with its origin at the lower left front when seen by the viewer, with the abscissa being the x axis (dim1), ordinate the y axis (dim2), and depth being the z axis (dim3), z increasing away from the viewer or into the datacube [this is a left-handed coordinate system]. One then wants to rotate the datacube by 90 degrees clockwise about the y axis when viewed from +y (the "top"); this means the old z axis becomes the new x axis, and the old x axis becomes the new z axis, while new y remains old y. In this case the axis that must be flipped prior to transposition is the x axis; see Example 1.

The parameter len_blk controls how much memory is used during the transpose operation. len_blk elements are used in each axis at a time, or a cube len_blk elements on a side. If len_blk is too large, the task will abort with an "out of memory" error. If it is too small, the task can take a very long time to run. The maximum size of len_blk depends on how much memory is available at the time IM3DTRAN is run, and the size and datatype of the image to be transposed.

Examples

1.  For an input datacube with columns = x = abscissa, lines = y = ordinate,
    and bands = z = depth increasing away from viewer, and with the image
    origin at the lower left front, rotate datacube 90 degrees clockwise
    around the y axis when viewed from +y (top):

    cl> im3dtran input[-*,*,*] output 3 2 1

Timings

[Not available yet]

Bugs

[Not available yet]

See also

pvol i2sun