MaskFactory

Mask Image factory.

Constructor

new MaskFactory()

Methods

checkElements(_dicomElements) → {string|undefined}

Check dicom elements.

Parameters:
NameTypeDescription
_dicomElementsObject.<string, DataElement>

The DICOM tags.

Throws:

Error for missing or wrong data.

Returns:

A possible warning.

Type: 
string | undefined

create(dataElements, pixelBuffer, refImageopt) → {Image}

Get an Image object from the read DICOM file.

Parameters:
NameTypeAttributesDescription
dataElementsObject.<string, DataElement>

The DICOM tags.

pixelBufferUint8Array | Int8Array | Uint16Array | Int16Array | Uint32Array | Int32Array

The pixel buffer.

refImageImage<optional>

Reference image, code will use its origins if present (best) or try to calculate them.

Throws:

Error for missing or wrong data.

Returns:

A new Image.

Type: 
Image

getWarning() → {string|undefined}

Get a warning string if elements are not as expected. Created by checkElements.

Returns:

The warning.

Type: 
string | undefined

toDicom(image, segments, sourceImage, extraTagsopt) → {Object.<string, DataElement>}

Convert a mask image into a DICOM segmentation object.

Parameters:
NameTypeAttributesDescription
imageImage

The mask image.

segmentsArray.<MaskSegment>

The mask segments.

sourceImageImage

The source image.

extraTagsObject.<string, any><optional>

Optional list of extra tags.

Returns:

A list of dicom elements.

Type: 
Object.<string, DataElement>