Class: Niivue

Niivue(optsopt)

Niivue

Constructor

new Niivue(optsopt)

Documentation is a work in progress
Parameters:
Name Type Attributes Description
opts object <optional>
options object to set modifiable properties of the canvas
Source:
Example
// All available properties are listed in the example.
// All properties are optional. If omitted, a default will be used from Niivue.defaults
opts = {
    textHeight: 0.03,             // 0 for no text, fraction of canvas height
    colorbarHeight: 0.05,         // 0 for no colorbars, fraction of Nifti j dimension
    crosshairWidth: 1,            // 0 for no crosshairs
    backColor: [0, 0, 0, 1],      // [R, G, B, A] range 0..1
    crosshairColor: [1, 0, 0 ,1], // [R, G, B, A] range 0..1
    colorBarMargin: 0.05          // x axis margin arount color bar, fraction of canvas width
  }

  let myNiivue = new Niivue(opts)

Members

(static) this.defaults

Properties:
Name Type Description
defaults object the default values for all options a user might supply in an opts object
Source:
Example
// The example shows all available use configurable properties.
this.defaults = {
    textHeight: 0.03,             // 0 for no text, fraction of canvas height
    colorbarHeight: 0.05,         // 0 for no colorbars, fraction of Nifti j dimension
    crosshairWidth: 1,            // 0 for no crosshairs
    backColor: [0, 0, 0, 1],      // [R, G, B, A] range 0..1
    crosshairColor: [1, 0, 0 ,1], // [R, G, B, A] range 0..1
    colorBarMargin: 0.05          // x axis margin arount color bar, fraction of canvas width
  }

Methods

arrayEquals(a, b)

test if two arrays have equal values for each element
Parameters:
Name Type Description
a Array the first array
b Array the second array
Source:
Example
Niivue.arrayEquals(a, b)