dwv.tool. Filter

new Filter(app)

Filter tool.

Parameters:
NameTypeDescription
appdwv.App

The associated app.

Members

filterList :object

Filter list

Type:
  • object

selectedFilter :object

Selected filter.

Type:
  • object

Methods

activate(bool)

Activate the tool.

Parameters:
NameTypeDescription
boolboolean

Flag to activate or not.

addEventListener(type, callback)

Add an event listener to this class.

Parameters:
NameTypeDescription
typestring

The event type.

callbackobject

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

getEventNames() → {Array}

Get the list of event names that this tool can fire.

Returns:

The list of event names.

Type: 
Array

getFilterList() → {Array}

Get the list of filters.

Returns:

The list of filter objects.

Type: 
Array

getOptionsType() → {string}

Get the type of tool options: here 'instance' since the filter list contains instances of each possible filter.

Returns:

The type.

Type: 
string

getSelectedFilter() → {object}

Get the selected filter.

Returns:

The selected filter.

Type: 
object

hasFilter(name) → {string}

Check if a filter is in the filter list.

Parameters:
NameTypeDescription
namestring

The name to check.

Returns:

The filter list element for the given name.

Type: 
string

init()

Initialise the filter. Called once the image is loaded.

keydown(event)

Handle keydown event.

Parameters:
NameTypeDescription
eventobject

The keydown event.

removeEventListener(type, callback)

Remove an event listener from this class.

Parameters:
NameTypeDescription
typestring

The event type.

callbackobject

The method associated with the provided event type.

setFeatures(features)

Set the tool live features: filter name.

Parameters:
NameTypeDescription
featuresobject

The list of features.

setOptions(options)

Set the tool options.

Parameters:
NameTypeDescription
optionsobject

The list of filter names amd classes.