| Overview | Package | Class | Tree | Deprecated | Index | Help | |||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||
java.lang.Object
|
+--ncsa.horizon.model.Viewable
|
+--ncsa.horizon.model.GenericViewable
This is a simple Viewable implementation that wraps around an existing data array. As a result, applications can use this class most effectively when (1) the array is small enough to fit into memory in its entirety, and (2) when the application knows what type of data is being visualized at compile-time.
At a minimum, you need only provide the array to be visualized, assuming the array contains scalar, numeric data. If you wish to incorporate additional information, such as world coordinate systems, you should also provide metadata as well. The HorizonMetadata class can be used to help load the information into a Metadata container. (See also the CoordMetadata for help setting metadata specifically describing a coordinate system.)
If your array is not numeric, then you also need to provide a TransferFunction object. Such an object is used essentially for converting data values to intensity levels. These levels are then mapped to colors using a ColorModel when an image is to be produced.
| Field Summary | |
| ArrayND | ary
the data being viewed |
| CoordinateSystem | csys
the coordinate system |
| DataND | dnd
the DataND wrapper |
| Metadata | md
the metadata associated with the array data |
| Fields inherited from class ncsa.horizon.model.Viewable | |
| curspecs, defspecs, finalState, listeners, name, source | |
| Constructor Summary | |
| GenericViewable(ArrayND array,
TransferFunction deftrans,
java.awt.image.ColorModel defcmodel,
Metadata mdata,
java.lang.String name)
create the Viewable wrapper for an array |
|
| GenericViewable(java.lang.Object array,
TransferFunction deftrans,
java.awt.image.ColorModel defcmodel,
Metadata mdata,
java.lang.String name)
create the Viewable wrapper for an array. |
|
| GenericViewable(java.lang.Object array,
TransferFunction deftrans,
java.awt.image.ColorModel defcmodel,
java.lang.String name)
create the Viewable wrapper for an array. |
|
| GenericViewable(java.lang.Object array,
Metadata mdata,
java.lang.String name)
create the Viewable wrapper for a numeric array. |
|
| GenericViewable(ArrayND array,
Metadata mdata,
java.lang.String name)
create the Viewable wrapper for a numeric array. |
|
| GenericViewable(java.lang.Object array,
java.lang.String name)
create the Viewable wrapper for a numeric array. |
|
| GenericViewable(ArrayND array,
java.lang.String name)
create the Viewable wrapper for a numeric array. |
|
| Method Summary | |
| void | close()
close this Viewable, releasing resources as necessary. |
| CoordinateSystem | getCoordSys()
return a coordinate system for this data |
| DataND | getData()
return the data associated with this Viewable as a DataND. Since all of the data associated with this Viewable is in memory, this implementation returns an InMemoryDataND object |
| java.lang.Class | getDataType()
return the data type associated with the data in this array. |
| Volume | getDataVolume()
return the object representing the full extend of the dataset being visualized. |
| Metadata | getMetadata()
return the metadata associated with this viewable. |
| short | getReversalHints()
determine the hints for flipping based on the metadata. |
| int[] | getSize()
return the size of the dataset to be visualized |
| static short | getStrategies(Slice sl,
short hints)
Determine the best strategy for creating an Image given the data, requested slice, and hints. |
| java.lang.Object | getUndefinedDataValue()
return the undefined value associated with the image data. |
| View2D | getView(Slice slice,
TransferFunction trans,
java.awt.image.ColorModel cmodel,
java.awt.Dimension size,
short hints,
boolean makeCurrent)
return a visualization of a given slice of the dataset |
| ViewSpecs | prepareSpecs(Slice slice,
TransferFunction trans,
java.awt.image.ColorModel cmodel,
java.awt.Dimension size,
short hints,
boolean makeCurrent)
|
| void | setDefaultTransferFunction(ViewSpecs specs)
|
| Methods inherited from class ncsa.horizon.model.Viewable | |
| addViewableListener, checkTransferFunction, clone, close, dispatch, getArrayName, getCoordSys, getCurrentSpecs, getDataType, getData, getDataVolume, getDefaultSpecs, getMetadata, getSize, getSlice, getSource, getView, getView, getView, prepareSpecs, removeViewableListener, resetSpecs, setColorModel, setCurrentSpecs, setDefaultSpecs, setDefaultTransferFunction, setImageSize, setImageSize, setSlice, setTransferFunction, TransferFunctionUpdate | |
| Methods inherited from class java.lang.Object | |
| clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait | |
| Field Detail |
protected ArrayND ary
protected Metadata md
protected CoordinateSystem csys
protected transient DataND dnd
| Constructor Detail |
public GenericViewable(ArrayND array,
TransferFunction deftrans,
java.awt.image.ColorModel defcmodel,
Metadata mdata,
java.lang.String name)
throws BadTransferFunctionException
array
- the data wrapped as an ArrayND object
deftrans
- the default transfer function to use
defcmodel
- the default color model to use
mdata
- the metadata describing the array data; null
means use generic metadata
name
- a name to give the array. This name may be
internally modified if necessary to make it
unique. If null, the Metadata will be
consulted for a name.
public GenericViewable(java.lang.Object array,
TransferFunction deftrans,
java.awt.image.ColorModel defcmodel,
Metadata mdata,
java.lang.String name)
throws BadTransferFunctionException
array
- a normal Java ND array
deftrans
- the default transfer function to use
defcmodel
- the default color model to use
mdata
- the metadata describing the array data; null
means use generic metadata.
name
- a name to give the array. This name may be
internally modified if necessary to make it
unique. If null, the Metadata will be
consulted for a name.
public GenericViewable(java.lang.Object array,
TransferFunction deftrans,
java.awt.image.ColorModel defcmodel,
java.lang.String name)
throws BadTransferFunctionException
array
- a normal Java ND array
deftrans
- the default transfer function to use
defcmodel
- the default color model to use
name
- a name to give the array. This name may be
internally modified if necessary to make it
unique.
public GenericViewable(java.lang.Object array,
Metadata mdata,
java.lang.String name)
throws BadTransferFunctionException
array
- a normal Java ND array
mdata
- the metadata describing the array data; null
means use generic metadata.
name
- a name to give the array. This name may be
internally modified if necessary to make it
unique. If null, the Metadata will be
consulted for a name.
public GenericViewable(ArrayND array,
Metadata mdata,
java.lang.String name)
throws BadTransferFunctionException
array
- an array wrapped as an ArrayND object
mdata
- the metadata describing the array data; null
means use generic metadata.
name
- a name to give the array. This name may be
internally modified if necessary to make it
unique. If null, the Metadata will be
consulted for a name.
public GenericViewable(java.lang.Object array,
java.lang.String name)
throws BadTransferFunctionException
array
- a normal Java ND array
name
- a name to give the array. This name may be
internally modified if necessary to make it
unique.
public GenericViewable(ArrayND array,
java.lang.String name)
throws BadTransferFunctionException
array
- an array wrapped as an ArrayND object
mdata
- the metadata describing the array data; null
means use generic metadata.
name
- a name to give the array. This name may be
internally modified if necessary to make it
unique.| Method Detail |
public int[] getSize()
public Volume getDataVolume()
public CoordinateSystem getCoordSys()
public Metadata getMetadata()
public DataND getData()
public void close()
public java.lang.Class getDataType()
protected java.lang.Object getUndefinedDataValue()
public View2D getView(Slice slice,
TransferFunction trans,
java.awt.image.ColorModel cmodel,
java.awt.Dimension size,
short hints,
boolean makeCurrent)
throws BadTransferFunctionException
slice
- the requested slice of data. If null, use the
current slice.
trans
- the TransferFunction to use when creating the
visualization. If null, use the current
TransferFunction.
cmodel
- the ColorModel to use when creating the
visualization. If null, use the current
visualization.
size
- the recommended size of the the resulting
output image. If null, use the current
size.
makeCurrent
- if true, set the current specifications to the
values given by these (non-null) arguments.
protected ViewSpecs prepareSpecs(Slice slice,
TransferFunction trans,
java.awt.image.ColorModel cmodel,
java.awt.Dimension size,
short hints,
boolean makeCurrent)
throws BadTransferFunctionException
protected void setDefaultTransferFunction(ViewSpecs specs)
throws BadTransferFunctionException
public static short getStrategies(Slice sl,
short hints)
protected short getReversalHints()
| Overview | Package | Class | Tree | Deprecated | Index | Help | |||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||