Size

dwv.image. Size

new Size(values)

Source:

Immutable Size class. Warning: the input array is NOT cloned, modifying it will modify the index values.

Parameters:
Name Type Description
values Array

The size values.

Methods

canScroll(viewOrientation) → {boolean}

Source:

Check if the associated data is scrollable: either in 3D or in other directions.

Parameters:
Name Type Description
viewOrientation dwv.math.Matrix33

The orientation matrix.

Returns:

True if scrollable.

Type
boolean

canScroll3D(viewOrientation) → {boolean}

Source:

Check if the associated data is scrollable in 3D.

Parameters:
Name Type Description
viewOrientation dwv.math.Matrix33

The orientation matrix.

Returns:

True if scrollable.

Type
boolean

equals(rhs) → {boolean}

Source:

Check for equality.

Parameters:
Name Type Description
rhs dwv.image.Size

The object to compare to.

Returns:

True if both objects are equal.

Type
boolean

get(i) → {number}

Source:

Get the size value at the given array index.

Parameters:
Name Type Description
i number

The index to get.

Returns:

The value.

Type
number

get2D() → {object}

Source:

Get the 2D base of this size.

Returns:

The 2D base [0,1] as {x,y}.

Type
object

getDimSize(dimension, start) → {number}

Source:

Get the size of a given dimension.

Parameters:
Name Type Description
dimension number

The dimension.

start number

Optional start dimension to start counting from.

Returns:

The size.

Type
number

getTotalSize(start) → {number}

Source:

Get the total size.

Parameters:
Name Type Description
start number

Optional start dimension to base the offset on.

Returns:

The total size.

Type
number

getValues() → {Array}

Source:

Get the values of this index.

Returns:

The array of values.

Type
Array

indexToOffset(index, start) → {number}

Source:

Convert an index to an offset in memory.

Parameters:
Name Type Description
index dwv.math.Index

The index to convert.

start number

Optional start dimension to base the offset on.

Returns:

The offset.

Type
number

isInBounds(index) → {boolean}

Source:

Check that an index is within bounds.

Parameters:
Name Type Description
index dwv.math.Index

The index to check.

Returns:

True if the given coordinates are within bounds.

Type
boolean

length() → {number}

Source:

Get the length of the index.

Returns:

The length.

Type
number

moreThanOne(dimension) → {boolean}

Source:

Check if a dimension exists and has more than one element.

Parameters:
Name Type Description
dimension number

The dimension to check.

Returns:

True if the size is more than one.

Type
boolean

offsetToIndex(offset) → {dwv.math.Index}

Source:

Convert an offset in memory to an index.

Parameters:
Name Type Description
offset number

The offset to convert.

Returns:

The index.

Type
dwv.math.Index

toString() → {string}

Source:

Get a string representation of the size.

Returns:

The Size as a string.

Type
string