math

dwv. math

Classes

BucketQueue
Circle
Ellipse
Index
Line
Matrix33
Path
Point
Point2D
Point3D
Rectangle
ROI
Scissors
SimpleStats
Vector3D

Methods

(static) computeGradient(greyscale) → {object}

Source:
Parameters:
Name Type Description
greyscale object

The input greyscale-

Returns:

A gradient object

Type
object

(static) computeGreyscale(data, width, height) → {Array}

Source:
Parameters:
Name Type Description
data Array

The input data.

width number

The width of the output.

height number

The height of the output.

Returns:

A greyscale object

Type
Array

(static) computeLaplace(greyscale) → {object}

Source:
Parameters:
Name Type Description
greyscale object

The input greyscale.

Returns:

A laplace object.

Type
object

(static) getAngle(line0, line1) → {number}

Source:

Get the angle between two lines in degree.

Parameters:
Name Type Description
line0 dwv.math.Line

The first line.

line1 dwv.math.Line

The second line.

Returns:

The angle.

Type
number

(static) getCoronalMat33() → {dwv.math.Matrix33}

Source:

Create a 3x3 coronal (xzy) matrix.

Returns:

The coronal matrix.

Type
dwv.math.Matrix33

(static) getDeOrientedArray3D(array3D, orientation) → {Array}

Source:

Get the raw values of an oriented input 3D array.

Parameters:
Name Type Description
array3D Array

The 3D array.

orientation dwv.math.Matrix33

The orientation 3D matrix.

Returns:

The values reordered to compensate the orientation.

Type
Array

(static) getFullStats(array) → {dwv.math.FullStats}

Source:

Get full stats: minimum, maximum, mean, standard deviation, median, 25% and 75% percentile of an array of values.

Parameters:
Name Type Description
array Array

The array of values to extract stats from.

Returns:

A full stats object.

Type
dwv.math.FullStats

(static) getIdentityMat33() → {dwv.math.Matrix33}

Source:

Create a 3x3 identity matrix.

Returns:

The identity matrix.

Type
dwv.math.Matrix33

(static) getIndexFromStringId(inputStr) → {dwv.math.Index}

Source:

Get an index from an id string in the form of: '#0-1_#1-2' (result of index.toStringId).

Parameters:
Name Type Description
inputStr string

The input string.

Returns:

The corresponding index.

Type
dwv.math.Index

(static) getMatrixFromName(name) → {dwv.math.Matrix33}

Source:

Get an orientation matrix from a name.

Parameters:
Name Type Description
name string

The orientation name.

Returns:

The orientation matrix.

Type
dwv.math.Matrix33

(static) getOrientedArray3D(array3D, orientation) → {Array}

Source:

Get the oriented values of an input 3D array.

Parameters:
Name Type Description
array3D Array

The 3D array.

orientation dwv.math.Matrix33

The orientation 3D matrix.

Returns:

The values reordered according to the orientation.

Type
Array

(static) getPercentile(array, ratio) → {number}

Source:

Get an arrays' percentile. Uses linear interpolation for percentiles that lie between data points. see https://en.wikipedia.org/wiki/Percentile (second variant interpolation)

Parameters:
Name Type Description
array Array

The sorted array of values.

ratio number

The percentile ratio [0-1].

Returns:

The percentile,

Type
number

(static) getPerpendicularLine(line, point, length) → {object}

Source:

Get a perpendicular line to an input one.

Parameters:
Name Type Description
line dwv.math.Line

The line to be perpendicular to.

point dwv.math.Point2D

The middle point of the perpendicular line.

length number

The length of the perpendicular line.

Returns:

A perpendicular line.

Type
object

(static) getSagittalMat33() → {dwv.math.Matrix33}

Source:

Create a 3x3 sagittal (yzx) matrix.

Returns:

The sagittal matrix.

Type
dwv.math.Matrix33

(static) getSimpleStats(array) → {dwv.math.SimpleStats}

Source:

Get simple stats: minimum, maximum, mean and standard deviation of an array of values.

Parameters:
Name Type Description
array Array

The array of values to extract stats from.

Returns:

A simple stats object.

Type
dwv.math.SimpleStats

(static) getStats(array, flags) → {dwv.math.Stats}

Source:

Get the minimum, maximum, mean and standard deviation of an array of values. Note: could use https://github.com/tmcw/simple-statistics.

Parameters:
Name Type Description
array Array

The array of values to extract stats from.

flags Array

A list of stat values to calculate.

Returns:

A stats object.

Type
dwv.math.Stats

(static) getZeroIndex(size) → {dwv.math.Index}

Source:

Get an index with values set to 0 and the input size.

Parameters:
Name Type Description
size number

The size of the index.

Returns:

The zero index.

Type
dwv.math.Index

(static) guid() → {string}

Source:
Returns:

A unique ID.

Type
string

(static) includesFullStatsFlags(flags) → {boolean}

Source:

Does the input flag list contain a full stat element?

Parameters:
Name Type Description
flags Array

A list of stat values to calculate.

Returns:

True if one of the flags is a full start flag.

Type
boolean

(static) isIdentityMat33(mat33) → {boolean}

Source:

Check if a matrix is a 3x3 identity matrix.

Parameters:
Name Type Description
mat33 dwv.math.Matrix33

The matrix to test.

Returns:

True if identity.

Type
boolean

(static) isSimilar(a, b, tol) → {boolean}

Source:

Check if two numbers are similar.

Parameters:
Name Type Description
a number

The first number.

b number

The second number.

tol number

The comparison tolerance.

Returns:

True if similar.

Type
boolean

(static) mulABC(a, b, c) → {number}

Source:

Mulitply the three inputs if the last two are not null.

Parameters:
Name Type Description
a number

The first input.

b number

The second input.

c number

The third input.

Returns:

The multiplication of the three inputs or null if one of the last two is null.

Type
number

(static) mulABC(a, b, c) → {number}

Source:

Mulitply the three inputs if the last two are not null.

Parameters:
Name Type Description
a number

The first input.

b number

The second input.

c number

The third input.

Returns:

The multiplication of the three inputs or null if one of the last two is null.

Type
number

(static) mulABC(a, b, c) → {number}

Source:

Mulitply the three inputs if the last two are not null.

Parameters:
Name Type Description
a number

The first input.

b number

The second input.

c number

The third input.

Returns:

The multiplication of the three inputs or null if one of the last two is null.

Type
number