The X Toolkit API

X.scalars

/**
* Create a container for a scalar array.
*
* @constructor
* @extends X.base
* @mixin X.loadable
* @mixin X.thresholdable
*/
var s = new X.scalars();
/**
* The array containing the scalars.
*
* @type {?Float32Array}
* @protected
*/
s._array = $_ARRAY;
/**
* The className of this class.
*
* @type {string}
* @protected
*/
s._classname = $_CLASSNAME;
/**
* The 'dirty' flag of this object.
*
* @type {boolean}
* @protected
*/
s._dirty = $_DIRTY;
/**
* The file of this loadable object.
*
* @type {?X.file}
* @protected
*/
s._file = $_FILE;
/**
* The file data.
*
* @type {?ArrayBuffer}
* @protected
*/
s._filedata = $_FILEDATA;
/**
* The WebGL-ready version of the scalars array.
*
* @type {?Float32Array}
* @protected
*/
s._glArray = $_GLARRAY;
/**
* The uniqueId of this instance. Each class instance in XTK has a uniqueId.
*
* @type {number}
* @protected
*/
s._id = $_ID;
/**
* The interpolation scheme for this object.
* 	0 -	linear interpolation across range from minColor to maxColor
* 	1 - FreeSurfer curvature convention: negative values are interpolated
* 	    over minColor range, positive curvatures separately over
* 	    maxColor range.
*
* @type {!number}
* @protected
*/
s._interpolation = $_INTERPOLATION;
/**
* The lower threshold.
*
* @type {number}
* @protected
*/
s._lowerThreshold = $_LOWERTHRESHOLD;
/**
* The upper threshold border.
*
* @type {number}
* @protected
*/
s._max = $_MAX;
/**
* The color to map the max. scalar.
*
* @type {!Array}
* @protected
*/
s._maxColor = $_MAXCOLOR;
/**
* The lower threshold border.
*
* @type {number}
* @protected
*/
s._min = $_MIN;
/**
* The color to map the min. scalar.
*
* @type {!Array}
* @protected
*/
s._minColor = $_MINCOLOR;
/**
* Flag to replace the colors after thresholding. If FALSE, discard the
* vertex.
*
* @type {boolean}
* @protected
*/
s._replaceMode = $_REPLACEMODE;
/**
* The upper threshold.
*
* @type {number}
* @protected
*/
s._upperThreshold = $_UPPERTHRESHOLD;
/**
* Get the array containing the scalars. This array is 'WebGL-ready', meaning
* that all values are represented by 3 elements to match the X,Y,Z coordinates
* of points.
*
* @public
*/
var _array = s.array;
/**
* Set the array containing the scalars. This array has to be WebGL-ready
* meaning that it has to match X.object.points.length, which equals 3 entries
* for each vertex (X,Y,Z coordinates). Calling this method marks this object as
* dirty so the X.renderer can pick it up. This method should be used
* externally.
*
* @param {Array} array The WebGL-ready array matching X.object._points.length
*          in size.
* @public
*/
s.array = $ARRAY;
/**
* Get the className of this object.
*
* @return {string} The className of this object.
* @public
*/
var _classname = s.classname;
/**
* Get the associated X.file for this object.
*
* @return {string} The associated file path or null if no file is associated.
*/
var _file = s.file;
/**
* Load this object from a file path or reset the associated file path.
*
* @param {?string|Array} filepath The file path/URL to load. If null, reset the
*          associated file. If an array is given, load multiple files (this
*          only works for DICOM so far).
*/
s.file = $FILEPATH;
/**
* Get the possibly attached file data for this object.
*
* @return {?string} The associated file data or null if none is attached.
*/
var _filedata = s.filedata;
/**
* Set raw file data for this object. Doing so, skips any additional loading and
* just parses this raw data.
*
* @param {?string|Array} filedata The raw file data to parse.
*/
s.filedata = $FILEDATA;
/**
* Get the id of this instance.
*
* @return {string} The className of this object.
* @public
*/
var _id = s.id;
/**
* The scalar interpolation associated with this object.
* The interpolation scheme for this object.
* 	0 -	linear interpolation across range from minColor to maxColor
* 	1 - FreeSurfer curvature convention: negative values are interpolated
* 	    over minColor range, positive curvatures separately over
* 	    maxColor range.
*
* @return {!number} The scalarInterpolation variable.
*/
var _interpolation = s.interpolation;
/**
* scalarsInterpolation
* The interpolation scheme for this object.
* 	0 -	linear interpolation across range from minColor to maxColor
* 	1 - FreeSurfer curvature convention: negative values are interpolated
* 	    over minColor range, positive curvatures separately over
* 	    maxColor range.
*
* @param {!number} value The interpolation scheme.
*
*/
s.interpolation = $VALUE;
/**
* Get the lower threshold.
*
* @return {number} The lower threshold.
* @public
*/
var _lowerThreshold = s.lowerThreshold;
/**
* Set the lower threshold if it is inside the min-max range.
*
* @param {number} lowerThreshold
* @public
*/
s.lowerThreshold = $LOWERTHRESHOLD;
/**
* Get the max color which is used to map the scalars to colors in a linear
* fashion.
*
* @return {!Array} An array holding the r,g,b components of the color.
* @public
*/
var _maxColor = s.maxColor;
/**
* Set the max color to linear map the scalars to colors.
*
* @param {!Array} maxColor The color corresponding to the min. scalar value.
* @public
*/
s.maxColor = $MAXCOLOR;
/**
* Get the upper threshold border.
*
* @return {number} The upper threshold border.
* @public
*/
var _max = s.max;
/**
* Get the min color which is used to map the scalars to colors in a linear
* fashion.
*
* @return {!Array} An array holding the r,g,b components of the color.
* @public
*/
var _minColor = s.minColor;
/**
* Set the min color to linear map the scalars to colors.
*
* @param {!Array} minColor The color corresponding to the min. scalar value.
* @public
*/
s.minColor = $MINCOLOR;
/**
* Get the lower threshold border.
*
* @return {number} The lower threshold border.
* @public
*/
var _min = s.min;
/**
* Get the upper threshold.
*
* @return {number} The upper threshold.
* @public
*/
var _upperThreshold = s.upperThreshold;
/**
* Set the upper threshold if it is inside the min-max range.
*
* @param {number} upperThreshold
* @public
*/
s.upperThreshold = $UPPERTHRESHOLD;


CONSTRUCTORS
X.scalars

PROPERTIES
_array
_classname
_dirty
_file
_filedata
_glArray
_id
_interpolation
_lowerThreshold
_max
_maxColor
_min
_minColor
_replaceMode
_upperThreshold

GETTERS/SETTERS
array
classname
file
filedata
id
interpolation
lowerThreshold
maxColor
max
minColor
min
upperThreshold

FUNCTIONS

STATIC



SOURCECODE