Class ncsa.horizon.util.ImageDisplayMap
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ncsa.horizon.util.ImageDisplayMap

java.lang.Object
   |
   +----ncsa.horizon.util.ImageDisplayMap

public class ImageDisplayMap
extends Object
implements Cloneable
an object that provides a way to express the convention used for how the display pixels in an image map to corresponding data pixels.

This object can be used by a Viewer to keep track of how data pixels are begin mapped to display pixels. This can be non-trivial when users have requested a subregion of the data to display. Another tricky effect is data order. For instance, computer graphics images (like GIF and JPEG) order the data such that the first pixel should appear in the top left corner; however, some scientific data (such as FITS) orders the data using the mathematical convention where the first pixel should appear in the lower left corner. Both these effects can be kept track of with this object.


Variable Index

 o data
the 2-d portion of data being displayed
 o display
the 2-d region that the data is displayed to
 o xaxisReversed
true if data pixel positions increase to the left and xpos should be taken to be relative to the right side of the display region (i.e.
 o yaxisReversed
true if data pixel positions increase upwards and ypos should be taken to be relative to the right side of the display region (i.e.

Constructor Index

 o ImageDisplayMap()
create an ImageDisplayMap object assuming that a slice made up of the will first data voxel in a volume of data will be displayed in a 1 x 1 pixel region.
 o ImageDisplayMap(Slice)
create an ImageDisplayMap object assuming that the given slice will be displayed in a 1 x 1 pixel region.
 o ImageDisplayMap(Slice, Rectangle)
create an ImageDisplayMap object assuming that the given slice will be displayed in a given Rectangle
 o ImageDisplayMap(Slice, Rectangle, boolean, boolean)
create an ImageDisplayMap object assuming that the given slice will be displayed in a given Rectangle

Method Index

 o clone()
 o getDataSlice(Rectangle)
return the Slice enclosed by a rectanglar region of the display
 o getDataVoxel(Point)
return a data point location associated with a given display pixel given display pixel.
 o getDisplay()
return a copy of the Rectangle being used as the current the display region
 o getDisplayPixel(Voxel)
return a Point that represents the display pixel that coves a given data location.
 o getDisplayRegion(Volume)
return the Rectangle that encloses the intersection of a given slice with the data currently being displayed.
 o getSlice()
return a copy of the Slice being mapped to the display region
 o getXDataPos(Voxel)
return the position of a Voxel along the axis currently being displayed in horizontal direction.
 o getYDataPos(Voxel)
return the position of a Voxel along the axis currently being displayed in vertical direction.
 o setDisplay(Rectangle)
change the Slice being mapped to the current display region
 o setSlice(Slice)
change the Slice being mapped to the current display region

Variables

 o data
  protected Slice data
the 2-d portion of data being displayed
 o display
  protected Rectangle display
the 2-d region that the data is displayed to
 o xaxisReversed
  public boolean xaxisReversed
true if data pixel positions increase to the left and xpos should be taken to be relative to the right side of the display region (i.e. the right side of the right-most display pixel in the xaxis).
 o yaxisReversed
  public boolean yaxisReversed
true if data pixel positions increase upwards and ypos should be taken to be relative to the right side of the display region (i.e. the bottom side of the bottom-most display pixel in the yaxis).

Constructors

 o ImageDisplayMap
  public ImageDisplayMap(Slice dataSlice,
                         Rectangle displayRegion)
create an ImageDisplayMap object assuming that the given slice will be displayed in a given Rectangle
 o ImageDisplayMap
  public ImageDisplayMap(Slice dataSlice,
                         Rectangle displayRegion,
                         boolean xIsReversed,
                         boolean yIsReversed)
create an ImageDisplayMap object assuming that the given slice will be displayed in a given Rectangle
 o ImageDisplayMap
  public ImageDisplayMap(Slice dataSlice)
create an ImageDisplayMap object assuming that the given slice will be displayed in a 1 x 1 pixel region.
 o ImageDisplayMap
  public ImageDisplayMap()
create an ImageDisplayMap object assuming that a slice made up of the will first data voxel in a volume of data will be displayed in a 1 x 1 pixel region.

Methods

 o getDataVoxel
  public synchronized Voxel getDataVoxel(Point displayPixel)
return a data point location associated with a given display pixel given display pixel.
Parameters:
displayPixel - a position in the display region
Returns:
s Voxel the position in the data set corresponding to the input display pixel
 o getXDataPos
  public double getXDataPos(Voxel dataVoxel)
return the position of a Voxel along the axis currently being displayed in horizontal direction.
Throws: ArrayIndexOutOfBoundsException
if current x-axis is beyond the domain of the Voxel
 o getYDataPos
  public double getYDataPos(Voxel dataVoxel)
return the position of a Voxel along the axis currently being displayed in vertical direction.
Throws: ArrayIndexOutOfBoundsException
if current y-axis is beyond the domain of the Voxel
 o getDisplayPixel
  public Point getDisplayPixel(Voxel dataVoxel)
return a Point that represents the display pixel that coves a given data location.
 o getDataSlice
  public synchronized Slice getDataSlice(Rectangle displayRegion)
return the Slice enclosed by a rectanglar region of the display
 o getDisplayRegion
  public Rectangle getDisplayRegion(Volume dataVol)
return the Rectangle that encloses the intersection of a given slice with the data currently being displayed.
 o setSlice
  public synchronized void setSlice(Slice newSlice)
change the Slice being mapped to the current display region
 o getSlice
  public Slice getSlice()
return a copy of the Slice being mapped to the display region
 o setDisplay
  public synchronized void setDisplay(Rectangle newDisplay)
change the Slice being mapped to the current display region
 o getDisplay
  public Rectangle getDisplay()
return a copy of the Rectangle being used as the current the display region
 o clone
  public Object clone()
Overrides:
clone in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index