Rotate3D

Overview

Rotate3D can reorient an input image arbitrarily in 3D. It can also resample the data to a finer or coarser grid. Quadratic interpolation is used to determine the output values.

Topics

Overview | Region processing | Angle | Pixel size | Output dimensions | Rotation center | Translation | Fill value | Rolloff distance | Command line

Related Priism Topics

Priism | Flip | Resample2D


Angle

The three values in this field in the main menu are the rotation angles applied to the x'', y', and z coordinate axes. As suggested by the primes, The order in which the rotations are applied is the opposite of the order in which the values are listed in the field: the first rotation is about z and the last rotation is about the rotated x axis.

The angles are assumed to be in degrees. The sign convention is:

When only rotating about the z axis, this sign convention is opposite of that used in Resample2D.

The point which remains fixed during the rotation is set by the rotation center controls in the Options Menu. By default, it is the geometric center of the selected input region.

Topics

Overview | Region processing | Angle | Pixel size | Output dimensions | Rotation center | Translation | Fill value | Rolloff distance | Command line


Pixel size

This field in the main menu controls the x, y, and z pixel spacings for the output volume. The units are the same as the units on the pixel spacings for the input data. When a new input data set is selected, the pixel spacings in the field are updated to be the same as the input pixel spacings.

Topics

Overview | Region processing | Angle | Pixel size | Output dimensions | Rotation center | Translation | Fill value | Rolloff distance | Command line


Output dimensions

The x, y, and z sizes of the output file are set by two controls in the Options Menu. The first is the Autosize toggle. When it is on, the output size is such that the full volume of the input region is included in the output file. When it is off, you can use the second control, the text field just below the toggle, to directly set the x, y, and z sizes. By default, the Autosize toggle is on.

Topics

Overview | Region processing | Angle | Pixel size | Output dimensions | Rotation center | Translation | Fill value | Rolloff distance | Command line


Rotation center

The rotation center is the point which remains fixed during the rotation, and, unless a non-zero translation is applied, it is the point at the center of the output volume.

If the input region has only one wavelength and one time point, you can turn the Use center of intensity toggle on in the Options Menu to have the rotation center be located at the center of intensity of the input volume. Otherwise, the x, y, and z coordinates of the rotation center are shown in the text field just below the toggle and can be changed. The coordinate system used has (0, 0, 0) at one corner of a z stack in the input source and (nx, ny, nz) at the opposite corner where nx, ny, and nz are the full dimensions of the input source (i.e. not necessarily the dimensions of the region to process). The lower lefthand corner of the ith z section (i running from 0 to nz - 1) in the input source is at (0, 0, i - 0.5).

Whenever a new region or file is selected, the rotation center is reset to the geometric center of the new region.

Topics

Overview | Region processing | Angle | Pixel size | Output dimensions | Rotation center | Translation | Fill value | Rolloff distance | Command line


Translation

The translation field in the Options Menu sets the x, y, and z displacement of the center of the output volume from the rotation center. The displacements are measured in units of output pixels.

Topics

Overview | Region processing | Angle | Pixel size | Output dimensions | Rotation center | Translation | Fill value | Rolloff distance | Command line


Fill value

In the output volume, points which map to back to points outside of the input and more than the rolloff distance from the input volume's edges, are filled with a fixed value. When the Use perimeter average toggle in the Options Menu is on, this fill value is the average of the pixel values from the perimeter of the input volume. When that toggle is off, the value shown just below it is used. The value may be complex; the imaginary component is only used when the output data is complex.

Topics

Overview | Region processing | Angle | Pixel size | Output dimensions | Rotation center | Translation | Fill value | Rolloff distance | Command line


Rolloff distance

In the output volume, points which map back to points that are outside of the input volume but which are within the rolloff distance of the input volume's edges have their values calculated from a linearly weighting of the fill value and the value interpolated at the closest point which maps back to a point in the input volume.

The rolloff distance is measured in the same units as are used for the input data's pixel spacing. The interpolation algorithm employed is more efficient (~25%) when the rolloff distance is zero.

Topics

Overview | Region processing | Angle | Pixel size | Output dimensions | Rotation center | Translation | Fill value | Rolloff distance | Command line


Command Line

Rotate3D accepts the command-line arguments described in Region.html. In addition, it also has the following options (optional parts are show in brackets):

-ang=xrot[:yrot[:zrot]]
Specifies the rotation angles, in degrees, about the x'', y', and z coordinate axes. Consult the Angle topic for details about the order of rotations and the sign conventions. If you do not specify -ang on the command line, Rotate3D will not apply a rotation to the input data. If you omit yrot and zrot or just zrot, Rotate3D assumes rotation angles of 0 for the omitted values.
-delo=xdel[:ydel[:zdel]]
Specifies the pixel spacing for the output. If you do not specify -delo on the command line, Rotated3D will use the pixel spacings from the input data for the output data. If you omit ydel and zdel or just zdel, Rotate3D uses the corresponding pixel spacings from the input data.
-out=nx[:ny[:nz]]
Specifies the x, y, and z dimensions for the output. If you do not specify -out on the command line or omit the trailing dimensions, then Rotate3D computes the minimum dimensions necessary to hold the transformed input region and uses the components of the minimum dimensions to fill in the missing values.
-cenxyz=xcen[:ycen[:zcen]]
Specifies the pixel coordinates, relative to the entire input data set, for the center of rotation. If you do not specify -cenxyz on the command line or omit the coordinates for the trailing dimensions, Rotate3D uses the coordinates of the geometric center of the input region to replace the missing values. If you also specify -cofi on the command line, Rotate3D ignores the values supplied with -cenxyz.
-cofi
Specifies that Rotate3D should rotate the input data about its center of intensity. You may only use this option if the input region has one wavelength and one time point.
-tran=xoff[:yoff[:zoff]]
Specifies a displacement, measured in units of output pixels, of the geometric center of the output volume from the center of rotation. If you do not specify -tran on the command line, the geometric center of the output volume is the same as the center of rotation. If you omit the displacements for the trailing dimensions, Rotate3D assumes displacements of zero for the missing values.
-fill=real_part[:imag_part]
Specifies the value Rotate3D uses to fill parts of the output volume which map back to areas that are more than the rolloff distance beyond the boundaries of the input volume. If you do not specify -fill or -perim on the command line, Rotate3D uses zero as the fill value. You may omit imag_part; if you do so, Rotate3D uses a assumes that the fill value as an imaginary component of zero. Rotate3D ignores -fill if you specify -perim.
-perim
Specifies that Rotate3D should use the average edge intensity from the input region to fill the parts of the output volume which map back to areas that are more than the rolloff distance beyond the boundaries of the input volume.
-roll_dist=r
Specifies the rolloff distance (see the Rolloff distance topic for details). If you do not specify -roll_dist on the command line, Rotate3D assumes a rolloff distance of zero.

As an example the command-line below rotates the in.dat by 15 degrees about the y axis and then 5 degrees about the rotated x axis. Along with the rotation it resamples the data to a grid with a uniform pixel spacing of .1. The result is written to out.dat.

    Rotate3D in.dat out.dat -ang=5:15:0 -delo=.1:.1:.1

Topics

Overview | Region processing | Angle | Pixel size | Output dimensions | Rotation center | Translation | Fill value | Rolloff distance | Command line