dwv. image

Classes

AsynchPixelBufferDecoder
DeleteSegmentCommand
DicomBufferToView
Geometry
Image
ImageFactory
MaskFactory
MaskSegmentHelper
PixelBufferDecoder
PlaneHelper
RescaleLut
RescaleSlopeAndIntercept
Size
Spacing
SynchPixelBufferDecoder
View
ViewFactory
WindowLevel
WindowLut

Namespaces

filter
lut

Members

(static) MinWindowWidth

Minimum window width value.

(static) viewEventNames :Array

List of view event names.

Type:
  • Array

Methods

(static) colourRange(colours, end) → {object}

Get a colour iterator. The input array defines the colours and their start index.

Parameters:
NameTypeDescription
coloursArray

An array of {index, colour} pairs.

endnumber

The end of the range (excluded).

Returns:

An iterator folowing the iterator and iterable protocol.

Type: 
object

(static) generateImageDataMonochrome(array, iterator, alphaFunc, windowLut, colourMap)

Generate image data for 'MONOCHROME*' photometric interpretation.

Parameters:
NameTypeDescription
arrayArray

The array to store the outut data

iteratorobject

Position iterator.

alphaFuncfunction

The alpha function.

windowLutobject

The window/level LUT.

colourMapobject

The colour map.

(static) generateImageDataPaletteColor(array, iterator, alphaFunc, colourMap, is16BitsStored)

Generate image data for 'PALETTE COLOR' photometric interpretation.

Parameters:
NameTypeDescription
arrayArray

The array to store the outut data

iteratorobject

Position iterator.

alphaFuncfunction

The alpha function.

colourMapobject

The colour map.

is16BitsStoredboolean

Flag to know if the data is 16bits.

(static) generateImageDataRgb(array, iterator, alphaFunc)

Generate image data for 'RGB' photometric interpretation.

Parameters:
NameTypeDescription
arrayArray

The array to store the outut data

iteratorobject

Position iterator.

alphaFuncfunction

The alpha function.

(static) generateImageDataYbrFull(array, iterator, alphaFunc)

Generate image data for 'YBR_FULL' photometric interpretation.

Parameters:
NameTypeDescription
arrayArray

The array to store the outut data

iteratorobject

Position iterator.

alphaFuncfunction

The alpha function.

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

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

Parameters:
NameTypeDescription
array3DArray

The 3D array.

orientationdwv.math.Matrix33

The orientation 3D matrix.

Returns:

The values reordered to compensate the orientation.

Type: 
Array

(static) getDefaultImage(width, height, sliceIndex, imageBuffer, numberOfFrames, imageUid) → {object}

Get an image from an input context imageData.

Parameters:
NameTypeDescription
widthnumber

The width of the coresponding image.

heightnumber

The height of the coresponding image.

sliceIndexnumber

The slice index of the imageData.

imageBufferobject

The image buffer.

numberOfFramesnumber

The final number of frames.

imageUidstring

The image UID.

Returns:

The corresponding view.

Type: 
object

(static) getIteratorValues(iterator) → {Array}

Get a list of values for a given iterator.

Parameters:
NameTypeDescription
iteratorobject

The iterator to use to loop through data.

Returns:

The list of values.

Type: 
Array

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

Get the oriented values of an input 3D array.

Parameters:
NameTypeDescription
array3DArray

The 3D array.

orientationdwv.math.Matrix33

The orientation 3D matrix.

Returns:

The values reordered according to the orientation.

Type: 
Array

(static) getRegionSliceIterator(image, position, isRescaled, min, max) → {object}

Get a slice index iterator for a rectangular region.

Parameters:
NameTypeDescription
imagedwv.image.Image

The image to parse.

positiondwv.math.Point

The current position.

isRescaledboolean

Flag for rescaled values (default false).

mindwv.math.Point2D

The minimum position (optional).

maxdwv.math.Point2D

The maximum position (optional).

Returns:

The slice iterator.

Type: 
object

(static) getSliceGeometrySpacing(origins, orientation, withCheck) → {number|undefined}

Get the slice spacing from the difference in the Z directions of input origins.

Parameters:
NameTypeDescription
originsArray

An array of dwv.math.Point3D.

orientationdwv.math.Matrix

The oritentation matrix.

withCheckboolean

Flag to activate spacing variation check, default to true.

Returns:

The spacing.

Type: 
number | undefined

(static) getSliceIndex(volumeGeometry, sliceGeometry) → {dwv.math.Index}

Get the slice index of an input slice into a volume geometry.

Parameters:
NameTypeDescription
volumeGeometrydwv.image.Geometry

The volume geometry.

sliceGeometrydwv.image.Geometry

The slice geometry.

Returns:

The index of the slice in the volume geomtry.

Type: 
dwv.math.Index

(static) getSliceIterator(image, position, isRescaled, viewOrientation) → {object}

Get a slice index iterator.

Parameters:
NameTypeDescription
imagedwv.image.Image

The image to parse.

positiondwv.math.Point

The current position.

isRescaledboolean

Flag for rescaled values (default false).

viewOrientationdwv.math.Matrix33

The view orientation.

Returns:

The slice iterator.

Type: 
object

(static) getVariableRegionSliceIterator(image, position, isRescaled, regions) → {object|undefined}

Get a slice index iterator for a rectangular region.

Parameters:
NameTypeDescription
imagedwv.image.Image

The image to parse.

positiondwv.math.Point

The current position.

isRescaledboolean

Flag for rescaled values (default false).

regionsArray

An array of regions.

Returns:

The slice iterator.

Type: 
object | undefined

(static) getViewFromDOMImage(domImage, origin) → {object}

Get data from an input image using a canvas.

Parameters:
NameTypeDescription
domImageobject

The DOM Image.

originobject

The data origin.

Returns:

A load data event.

Type: 
object

(static) getViewFromDOMVideo(video, onloaditem, onload, onprogress, onloadend, dataIndex, origin)

Get data from an input image using a canvas.

Parameters:
NameTypeDescription
videoobject

The DOM Video.

onloaditemfunction

On load callback.

onloadobject

The function to call once the data is loaded.

onprogressobject

The function to call to report progress.

onloadendobject

The function to call to report load end.

dataIndexnumber

The data index.

originobject

The data origin.

(static) imageDataToBuffer(imageData) → {Array}

Create a simple array buffer from an ImageData buffer.

Parameters:
NameTypeDescription
imageDataobject

The ImageData taken from a context.

Returns:

The image buffer.

Type: 
Array

(static) range(dataAccessor, start, maxIter, increment, blockMaxIter, blockIncrement, reverse1, reverse2) → {object}

Get an iterator for a given range for a one component data.

Using 'maxIter' and not an 'end' index since it fails in some edge cases (for ex coronal2, ie zxy)

Parameters:
NameTypeDescription
dataAccessorfunction

Function to access data.

startnumber

Zero-based index at which to start the iteration.

maxIternumber

The maximum number of iterations.

incrementnumber

Increment between indicies.

blockMaxIternumber

Number of applied increment after which blockIncrement is applied.

blockIncrementnumber

Increment after blockMaxIter is reached, the value is from block start to the next block start.

reverse1boolean

If true, loop from end to start. WARN: don't forget to set the value of start as the last index!

reverse2boolean

If true, loop from block end to block start.

Returns:

An iterator folowing the iterator and iterable protocol.

Type: 
object

(static) range3d(dataAccessor, start, maxIter, increment, blockMaxIter, blockIncrement, reverse1, reverse2, isPlanar) → {object}

Get an iterator for a given range for a 3 components data.

Using 'maxIter' and not an 'end' index since it fails in some edge cases (for ex coronal2, ie zxy)

Parameters:
NameTypeDescription
dataAccessorfunction

Function to access data.

startnumber

Zero-based index at which to start the iteration.

maxIternumber

The maximum number of iterations.

incrementnumber

Increment between indicies.

blockMaxIternumber

Number of applied increment after which blockIncrement is applied.

blockIncrementnumber

Increment after blockMaxIter is reached, the value is from block start to the next block start.

reverse1boolean

If true, loop from end to start. WARN: don't forget to set the value of start as the last index!

reverse2boolean

If true, loop from block end to block start.

isPlanarboolean

A flag to know if the data is planar (RRRR...GGGG...BBBB...) or not (RGBRGBRGBRGB...), defaults to false.

Returns:

An iterator folowing the iterator and iterable protocol.

Type: 
object

(static) rangeRegion(dataAccessor, start, end, increment, regionSize, regionOffset) → {object}

Get an iterator for a given range with bounds (for a one component data).

Parameters:
NameTypeDescription
dataAccessorfunction

Function to access data.

startnumber

The start of the range (included).

endnumber

The end of the range (excluded).

incrementnumber

The increment between indicies.

regionSizenumber

The size of the region to iterate through.

regionOffsetnumber

The offset between regions.

Returns:

An iterator folowing the iterator and iterable protocol.

Type: 
object

(static) rangeRegions(dataAccessor, start, end, increment, regions) → {object}

Get an iterator for a given range with bounds (for a one component data).

Parameters:
NameTypeDescription
dataAccessorfunction

Function to access data.

startnumber

The start of the range (included).

endnumber

The end of the range (excluded).

incrementnumber

The increment between indicies.

regionsArray

An array of regions: [off0, size, off1].

Returns:

An iterator folowing the iterator and iterable protocol.

Type: 
object

(static) simpleRange(dataAccessor, start, end, increment) → {object}

Get an simple iterator for a given range for a one component data.

Parameters:
NameTypeDescription
dataAccessorfunction

Function to access data.

startnumber

The start of the range (included).

endnumber

The end of the range (excluded).

incrementnumber

The increment between indicies (default=1).

Returns:

An iterator folowing the iterator and iterable protocol.

Type: 
object

(static) simpleRange3d(dataAccessor, start, end, increment, isPlanar) → {object}

Get an iterator for a given range for a 3 components data.

Parameters:
NameTypeDescription
dataAccessorfunction

Function to access data.

startnumber

The start of the range (included).

endnumber

The end of the range (excluded). (end - start) needs to be a multiple of 3...

incrementnumber

The increment between indicies (default=1).

isPlanarboolean

A flag to know if the data is planar (RRRR...GGGG...BBBB...) or not (RGBRGBRGBRGB...), defaults to false.

Returns:

A 3 components iterator folowing the iterator and iterable protocol, the value is an array of size 3 with each component.

Type: 
object

(static) validateWindowWidth(value) → {number}

Validate an input window width.

Parameters:
NameTypeDescription
valuenumber

The value to test.

Returns:

A valid window width.

Type: 
number