DataController

DicomData controller.

Constructor

new DataController()

Methods

add(dataId, data) → {boolean}

Add a new data.

Parameters:
NameTypeDescription
dataIdstring

The data id.

dataDicomData

The data.

Returns:

False if the data cannot be added.

Type: 
boolean

addEventListener(type, callback)

Add an event listener to this class.

Parameters:
NameTypeDescription
typestring

The event type.

callbackfunction

The function associated with the provided event type, will be called with the fired event.

get(dataId) → {DicomData|undefined}

Get a data at a given index.

Parameters:
NameTypeDescription
dataIdstring

The data id.

Returns:

The DICOM data.

Type: 
DicomData | undefined

getDataIdFromSeriesUid(uid) → {string}

Get the first data id with the given SeriesInstanceUID.

Parameters:
NameTypeDescription
uidstring

The SeriesInstanceUID.

Returns:

The data id.

Type: 
string

getDataIds() → {Array.<string>}

Get the list of ids in the data storage.

Returns:

The list of data ids.

Type: 
Array.<string>

getDataIdsFromSopUids(uids) → {Array.<string>}

Get the list of dataIds that contain the input UIDs.

Parameters:
NameTypeDescription
uidsArray.<string>

A list of UIDs.

Returns:

The list of dataIds that contain the UIDs.

Type: 
Array.<string>

getNextDataId() → {string}

Get the next data id.

Returns:

The data id.

Type: 
string

getStashed(dataId) → {DicomData|undefined}

Get a stashed data at a given index.

Parameters:
NameTypeDescription
dataIdstring

The data id.

Returns:

The DICOM data.

Type: 
DicomData | undefined

getStashedDataIds() → {Array.<string>}

Get the list of ids in the stashed data storage.

Returns:

The list of data ids.

Type: 
Array.<string>

markDataAsComplete(dataId) → {Object}

Mark a data a complete (fully loaded).

Parameters:
NameTypeDescription
dataIdstring

The data id.

Returns:

An object with an imageHasChanged property.

Type: 
Object

remove(dataId)

Remove a data from the list.

Parameters:
NameTypeDescription
dataIdstring

The data id.

removeEventListener(type, callback)

Remove an event listener from this class.

Parameters:
NameTypeDescription
typestring

The event type.

callbackfunction

The function associated with the provided event type.

reset()

Reset the class: empty the data storage.

setImage(dataId, image)

Set the image at a given index.

Parameters:
NameTypeDescription
dataIdstring

The data id.

imageImage

The image to set.

stash(dataId)

Stash a data from the list.

Parameters:
NameTypeDescription
dataIdstring

The data id.

unstash(dataId)

Unstash a data from the list.

Parameters:
NameTypeDescription
dataIdstring

The data id.

update(dataId, data)

Update the current data.

Parameters:
NameTypeDescription
dataIdstring

The data id.

dataDicomData

The data.

Events

dataadd

Data add event.

Type:
  • object
Properties
NameTypeDescription
typestring

The event type.

dataidstring

The data id.

dataimageset

Data image set event.

Type:
  • object
Properties
NameTypeDescription
typestring

The event type.

valueArray

The event value, first element is the image.

dataidstring

The data id.

dataremove

Data remove event.

Type:
  • object
Properties
NameTypeDescription
typestring

The event type.

dataidstring

The data id.

dataupdate

Data udpate event.

Type:
  • object
Properties
NameTypeDescription
typestring

The event type.

dataidstring

The data id.