ImageScience 3.0.0

imagescience.transform
Class Turn

java.lang.Object
  extended by imagescience.transform.Turn

public class Turn
extends java.lang.Object

Rotates an image multiples of 90 degrees around its principal axes. The advantage of this class over Rotate is that no interpolations are performed: it merely shuffles the image elements.


Field Summary
 Messenger messenger
          The object used for message displaying.
 Progressor progressor
          The object used for progress displaying.
 
Constructor Summary
Turn()
          Default constructor.
 
Method Summary
 Image run(Image image, int times90z, int times90y, int times90x)
          Turns an image.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

messenger

public final Messenger messenger
The object used for message displaying.


progressor

public final Progressor progressor
The object used for progress displaying.

Constructor Detail

Turn

public Turn()
Default constructor.

Method Detail

run

public Image run(Image image,
                 int times90z,
                 int times90y,
                 int times90x)
Turns an image.

Parameters:
image - The image to be turned.
times90z - times90y - times90x - The number of times the image should be rotated 90 degrees around the z-, y-, and x-axis, respectively. The order of rotation is the same as the parameters. That is to say, first times90z times 90 degrees around the z-axis, then times90y times 90 degrees around the y-axis, and finally times90x times 90 degrees around the x-axis. The algorithm is applied to every x-y-z subimage in a 5D image and assumes a right-handed coordinate system, with the origin in the center of each subimage. A rotation of +90 degrees around the z-axis implies that the positive x-axis is mapped onto the positive y-axis. Similarly, a rotation of +90 degrees around the y-axis maps the positive z-axis onto the positive x-axis, and a rotation of +90 degrees around the x-axis maps the positive y-axis onto the positive z-axis.
Returns:
A new image containing a turned version of the input image. The returned image is of the same type as the input image.
Throws:
java.lang.NullPointerException - If image is null.
java.lang.UnknownError - If for any reason the output image can not be created. In most cases this will be due to insufficient free memory.

ImageScience 3.0.0

Copyright (C) Erik Meijering. Permission to use this software and corresponding documentation for educational, research, and not-for-profit purposes, without a fee and without a signed licensing agreement, is granted, subject to the following terms and conditions.

IT IS NOT ALLOWED TO REDISTRIBUTE, SELL, OR LEASE THIS SOFTWARE, OR DERIVATIVE WORKS THEREOF, WITHOUT PERMISSION IN WRITING FROM THE COPYRIGHT HOLDER. THE COPYRIGHT HOLDER IS FREE TO MAKE VERSIONS OF THE SOFTWARE AVAILABLE FOR A FEE OR COMMERCIALLY ONLY.

IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OF ANY KIND WHATSOEVER, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.

THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE EXPRESS OR IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE AND CORRESPONDING DOCUMENTATION IS PROVIDED "AS IS". THE COPYRIGHT HOLDER HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.