edu.washington.biostr.sig.brainj3d.view3D.combiners
Class AbstractVolumeDataViewCombiner

java.lang.Object
  extended by edu.washington.biostr.sig.brainj3d.view3D.combiners.AbstractVolumeDataViewCombiner
All Implemented Interfaces:
VolumeDataViewCombiner
Direct Known Subclasses:
AveragingColorCombiner, AveragingDataCombiner, AveragingScaledDataCombiner, BinOpCombiner

public abstract class AbstractVolumeDataViewCombiner
extends Object
implements VolumeDataViewCombiner

Base class for implementing VolumeDataViewCombiner.

Author:
Peter

Constructor Summary
AbstractVolumeDataViewCombiner()
           
 
Method Summary
protected static void clearOutColors(float[] outColors)
          Sets all entries in outColors to zero
 float[] computeColors(double[][] valuesArray, ColorLookupTable[] colorTables, float[] baseColor, BlendFunction function, PreprocessingData prepData)
          Computes colors given the specified inputs and returns an array holding the computed colors.
abstract  void computeColors(double[][] valuesArray, ColorLookupTable[] colorTables, float[] baseColor, BlendFunction function, PreprocessingData prepData, float[] outColors)
          Computes colors given the specified inputs and modified outColors to hold the computed colors.
 int computeColorsSize(double[][] valuesArray)
          Computes the size of array required to hold the colors array generated by this combiner.
protected static void insertColorAt(float[] arrayOfColors, int index, float[] color)
          Inserts the specified color at the specifed index into the array of colors.
protected static void intToFloatArray(int byteColor, float[] outColor)
          Converts the ARGB 4-byte word into a float array representing the same color
protected  boolean isValid(double[][] valuesArray)
          Returns true if this values array meets the minimum requirements for processing (does not perform null testing):
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.washington.biostr.sig.brainj3d.view3D.combiners.VolumeDataViewCombiner
computeColorsSize, getName, needsManyColorTables
 

Constructor Detail

AbstractVolumeDataViewCombiner

public AbstractVolumeDataViewCombiner()
Method Detail

computeColorsSize

public int computeColorsSize(double[][] valuesArray)
Description copied from interface: VolumeDataViewCombiner
Computes the size of array required to hold the colors array generated by this combiner.

Specified by:
computeColorsSize in interface VolumeDataViewCombiner
Parameters:
valuesArray - An array of arrays of values for which a colors array would be generated for
Returns:
the size of array required to hold the colors array generated by this combiner.

computeColors

public final float[] computeColors(double[][] valuesArray,
                                   ColorLookupTable[] colorTables,
                                   float[] baseColor,
                                   BlendFunction function,
                                   PreprocessingData prepData)
Description copied from interface: VolumeDataViewCombiner
Computes colors given the specified inputs and returns an array holding the computed colors.

Specified by:
computeColors in interface VolumeDataViewCombiner
Parameters:
valuesArray - should be in the format of [view index][vertex index]
colorTables - an array of ColorLookupTables, should be length one if needsManyColorTables() returns false, or the same length at the number of views in the valuesArray if needsManyColorTables() returns true
baseColor - the base color to be used in the blend function: [r, g, b] or [r, g, b, a] (if this combiner supports alpha)
function - the blend function to use to blend the base color with the mapped color from the ColorLookupTable(s).
prepData - the preprocessing data computed across each of the full sampled data sets
Returns:
an array of computed colors of the form [r0, g0, b0, a0, r1, g1, b1, a1, ...] if this combiner supports alpha values or of the form [r0, g0, b0, r1, g1, b1, ...] if this combiner does not support alpha values; The size of this array is the same as the size returned by computeColorsSize(valuesArray)

computeColors

public abstract void computeColors(double[][] valuesArray,
                                   ColorLookupTable[] colorTables,
                                   float[] baseColor,
                                   BlendFunction function,
                                   PreprocessingData prepData,
                                   float[] outColors)
Computes colors given the specified inputs and modified outColors to hold the computed colors. Subclasses should override this method to implement thier combination schemes.

Specified by:
computeColors in interface VolumeDataViewCombiner
Parameters:
valuesArray - should be in the format of [view index][vertex index]
outColors - destination of computed colors, should be the same length as computeColorsSize(valuesArray)
colorTables - an array of ColorLookupTables, should be length one if needsManyColorTables() returns false, or the same length at the number of views in the valuesArray if needsManyColorTables() returns true
baseColor - the base color to be used in the blend function
function - the blend function to use to blend the base color with the mapped color from the ColorLookupTable(s).
prepData - the preprocessing data computed across each of the full sampled data sets

isValid

protected boolean isValid(double[][] valuesArray)

Returns true if this values array meets the minimum requirements for processing (does not perform null testing):

Parameters:
valuesArray -
Returns:
true if the array meets the specified requirements

insertColorAt

protected static final void insertColorAt(float[] arrayOfColors,
                                          int index,
                                          float[] color)
Inserts the specified color at the specifed index into the array of colors. Each color is assumed to have four entries.

Parameters:
arrayOfColors -
index - color will be inserted as the index-th color
color -

intToFloatArray

protected static final void intToFloatArray(int byteColor,
                                            float[] outColor)
Converts the ARGB 4-byte word into a float array representing the same color

Parameters:
byteColor -
outColor -

clearOutColors

protected static final void clearOutColors(float[] outColors)
Sets all entries in outColors to zero

Parameters:
outColors -


Copyright © 2006 University of Washington. All Rights Reserved.