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.
-
data
- the 2-d portion of data being displayed
-
display
- the 2-d region that the data is displayed to
-
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.
-
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.
-
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.
-
ImageDisplayMap(Slice)
- create an ImageDisplayMap object assuming that the given slice will
be displayed in a 1 x 1 pixel region.
-
ImageDisplayMap(Slice, Rectangle)
- create an ImageDisplayMap object assuming that the given slice will
be displayed in a given Rectangle
-
ImageDisplayMap(Slice, Rectangle, boolean, boolean)
- create an ImageDisplayMap object assuming that the given slice will
be displayed in a given Rectangle
-
clone()
-
-
getDataSlice(Rectangle)
- return the Slice enclosed by a rectanglar region of the display
-
getDataVoxel(Point)
- return a data point location associated with a given display pixel
given display pixel.
-
getDisplay()
- return a copy of the Rectangle being used as the current the
display region
-
getDisplayPixel(Voxel)
- return a Point that represents the display pixel that coves a
given data location.
-
getDisplayRegion(Volume)
- return the Rectangle that encloses the intersection of a given
slice with the data currently being displayed.
-
getSlice()
- return a copy of the Slice being mapped to the display region
-
getXDataPos(Voxel)
- return the position of a Voxel along the axis currently being
displayed in horizontal direction.
-
getYDataPos(Voxel)
- return the position of a Voxel along the axis currently being
displayed in vertical direction.
-
setDisplay(Rectangle)
- change the Slice being mapped to the current display region
-
setSlice(Slice)
- change the Slice being mapped to the current display region
data
protected Slice data
- the 2-d portion of data being displayed
display
protected Rectangle display
- the 2-d region that the data is displayed to
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).
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).
ImageDisplayMap
public ImageDisplayMap(Slice dataSlice,
Rectangle displayRegion)
- create an ImageDisplayMap object assuming that the given slice will
be displayed in a given Rectangle
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
ImageDisplayMap
public ImageDisplayMap(Slice dataSlice)
- create an ImageDisplayMap object assuming that the given slice will
be displayed in a 1 x 1 pixel region.
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.
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
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
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
getDisplayPixel
public Point getDisplayPixel(Voxel dataVoxel)
- return a Point that represents the display pixel that coves a
given data location.
getDataSlice
public synchronized Slice getDataSlice(Rectangle displayRegion)
- return the Slice enclosed by a rectanglar region of the display
getDisplayRegion
public Rectangle getDisplayRegion(Volume dataVol)
- return the Rectangle that encloses the intersection of a given
slice with the data currently being displayed.
setSlice
public synchronized void setSlice(Slice newSlice)
- change the Slice being mapped to the current display region
getSlice
public Slice getSlice()
- return a copy of the Slice being mapped to the display region
setDisplay
public synchronized void setDisplay(Rectangle newDisplay)
- change the Slice being mapped to the current display region
getDisplay
public Rectangle getDisplay()
- return a copy of the Rectangle being used as the current the
display region
clone
public Object clone()
- Overrides:
- clone in class Object
All Packages Class Hierarchy This Package Previous Next Index