de.lmu.ifi.dbs.elki.visualization.projections
Class AffineProjection

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.result.AbstractHierarchicalResult
      extended by de.lmu.ifi.dbs.elki.visualization.projections.AbstractProjection
          extended by de.lmu.ifi.dbs.elki.visualization.projections.AffineProjection
All Implemented Interfaces:
HierarchicalResult, Result, Projection, Projection2D

public class AffineProjection
extends AbstractProjection
implements Projection2D

Affine projections are the most general class. They are initialized by an arbitrary affine transformation matrix, and can thus represent any rotation and scaling, even simple perspective projections. However, this comes at the cost of a matrix multiplication.


Field Summary
private  AffineTransformation proj
          Affine transformation used in projection
 
Fields inherited from class de.lmu.ifi.dbs.elki.visualization.projections.AbstractProjection
scales
 
Fields inherited from interface de.lmu.ifi.dbs.elki.visualization.projections.Projection
SCALE
 
Constructor Summary
AffineProjection(LinearScale[] scales, AffineTransformation proj)
          Constructor with a given database and axes.
 
Method Summary
static AffineTransformation axisProjection(int dim, int ax1, int ax2)
          Compute an transformation matrix to show only axis ax1 and ax2.
 String estimateTransformString(double margin, double width, double height)
          Get a SVG transformation string to bring the contents into the unit cube.
 Pair<DoubleMinMax,DoubleMinMax> estimateViewport()
          Estimate the viewport requirements
 double[] fastProjectDataToRenderSpace(NumberVector<?,?> data)
          Project a data vector from data space to rendering space.
 double[] fastProjectDataToRenderSpace(Vector data)
          Project a data vector from data space to rendering space.
 double[] fastProjectRelativeDataToRenderSpace(NumberVector<?,?> data)
          Project a data vector from data space to rendering space.
 double[] fastProjectRelativeDataToRenderSpace(Vector data)
          Project a data vector from data space to rendering space.
 double[] fastProjectRelativeScaledToRender(Vector v)
          Project a vector from scaled space to rendering space.
 double[] fastProjectScaledToRender(Vector v)
          Project a vector from scaled space to rendering space.
 BitSet getVisibleDimensions2D()
          Get a bit set of dimensions that are visible.
 Vector projectRelativeRenderToScaled(Vector v)
          Project a relative vector from rendering space to scaled space.
 Vector projectRelativeScaledToRender(Vector v)
          Project a relative vector from scaled space to rendering space.
 Vector projectRenderToScaled(Vector v)
          Project a vector from rendering space to scaled space.
 Vector projectScaledToRender(Vector v)
          Project a vector from scaled space to rendering space.
 
Methods inherited from class de.lmu.ifi.dbs.elki.visualization.projections.AbstractProjection
getInputDimensionality, getLongName, getScale, getShortName, projectDataToRenderSpace, projectDataToRenderSpace, projectDataToScaledSpace, projectDataToScaledSpace, projectRelativeDataToRenderSpace, projectRelativeDataToRenderSpace, projectRelativeDataToScaledSpace, projectRelativeDataToScaledSpace, projectRelativeRenderToDataSpace, projectRelativeScaledToDataSpace, projectRenderToDataSpace, projectScaledToDataSpace
 
Methods inherited from class de.lmu.ifi.dbs.elki.result.AbstractHierarchicalResult
addChildResult, getHierarchy, setHierarchy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.visualization.projections.Projection
getInputDimensionality, getScale, projectDataToRenderSpace, projectDataToRenderSpace, projectDataToScaledSpace, projectDataToScaledSpace, projectRelativeDataToRenderSpace, projectRelativeDataToRenderSpace, projectRelativeDataToScaledSpace, projectRelativeDataToScaledSpace, projectRelativeRenderToDataSpace, projectRelativeScaledToDataSpace, projectRenderToDataSpace, projectScaledToDataSpace
 
Methods inherited from interface de.lmu.ifi.dbs.elki.result.HierarchicalResult
getHierarchy, setHierarchy
 
Methods inherited from interface de.lmu.ifi.dbs.elki.result.Result
getLongName, getShortName
 

Field Detail

proj

private AffineTransformation proj
Affine transformation used in projection

Constructor Detail

AffineProjection

public AffineProjection(LinearScale[] scales,
                        AffineTransformation proj)
Constructor with a given database and axes.

Parameters:
scales - Scales to use
proj - Projection to use
Method Detail

projectScaledToRender

public Vector projectScaledToRender(Vector v)
Project a vector from scaled space to rendering space.

Specified by:
projectScaledToRender in interface Projection
Parameters:
v - vector in scaled space
Returns:
vector in rendering space

projectRenderToScaled

public Vector projectRenderToScaled(Vector v)
Project a vector from rendering space to scaled space.

Specified by:
projectRenderToScaled in interface Projection
Parameters:
v - vector in rendering space
Returns:
vector in scaled space

projectRelativeScaledToRender

public Vector projectRelativeScaledToRender(Vector v)
Project a relative vector from scaled space to rendering space.

Specified by:
projectRelativeScaledToRender in interface Projection
Parameters:
v - relative vector in scaled space
Returns:
relative vector in rendering space

projectRelativeRenderToScaled

public Vector projectRelativeRenderToScaled(Vector v)
Project a relative vector from rendering space to scaled space.

Specified by:
projectRelativeRenderToScaled in interface Projection
Parameters:
v - relative vector in rendering space
Returns:
relative vector in scaled space

estimateViewport

public Pair<DoubleMinMax,DoubleMinMax> estimateViewport()
Description copied from interface: Projection2D
Estimate the viewport requirements

Specified by:
estimateViewport in interface Projection2D
Returns:
MinMax for x and y obtained from projecting scale endpoints

estimateTransformString

public String estimateTransformString(double margin,
                                      double width,
                                      double height)
Description copied from interface: Projection2D
Get a SVG transformation string to bring the contents into the unit cube.

Specified by:
estimateTransformString in interface Projection2D
Parameters:
margin - extra margin to add.
width - Width
height - Height
Returns:
transformation string.

axisProjection

public static AffineTransformation axisProjection(int dim,
                                                  int ax1,
                                                  int ax2)
Compute an transformation matrix to show only axis ax1 and ax2.

Parameters:
dim - Dimensionality
ax1 - First axis
ax2 - Second axis
Returns:
transformation matrix

fastProjectDataToRenderSpace

public double[] fastProjectDataToRenderSpace(Vector data)
Description copied from interface: Projection2D
Project a data vector from data space to rendering space.

Specified by:
fastProjectDataToRenderSpace in interface Projection2D
Parameters:
data - vector in data space
Returns:
vector in rendering space

fastProjectDataToRenderSpace

public double[] fastProjectDataToRenderSpace(NumberVector<?,?> data)
Description copied from interface: Projection2D
Project a data vector from data space to rendering space.

Specified by:
fastProjectDataToRenderSpace in interface Projection2D
Parameters:
data - vector in data space
Returns:
vector in rendering space

fastProjectScaledToRender

public double[] fastProjectScaledToRender(Vector v)
Description copied from interface: Projection2D
Project a vector from scaled space to rendering space.

Specified by:
fastProjectScaledToRender in interface Projection2D
Parameters:
v - vector in scaled space
Returns:
vector in rendering space

fastProjectRelativeDataToRenderSpace

public double[] fastProjectRelativeDataToRenderSpace(Vector data)
Description copied from interface: Projection2D
Project a data vector from data space to rendering space.

Specified by:
fastProjectRelativeDataToRenderSpace in interface Projection2D
Parameters:
data - vector in data space
Returns:
vector in rendering space

fastProjectRelativeDataToRenderSpace

public double[] fastProjectRelativeDataToRenderSpace(NumberVector<?,?> data)
Description copied from interface: Projection2D
Project a data vector from data space to rendering space.

Specified by:
fastProjectRelativeDataToRenderSpace in interface Projection2D
Parameters:
data - vector in data space
Returns:
vector in rendering space

fastProjectRelativeScaledToRender

public double[] fastProjectRelativeScaledToRender(Vector v)
Description copied from interface: Projection2D
Project a vector from scaled space to rendering space.

Specified by:
fastProjectRelativeScaledToRender in interface Projection2D
Parameters:
v - vector in scaled space
Returns:
vector in rendering space

getVisibleDimensions2D

public BitSet getVisibleDimensions2D()
Description copied from interface: Projection2D
Get a bit set of dimensions that are visible.

Specified by:
getVisibleDimensions2D in interface Projection2D
Returns:
Bit set, first dimension is bit 0.

Release 0.4.0 (2011-09-20_1324)