VolumeData

Source: VolumeData.ts

A scalar grid parsed from a density or potential map. Use GLViewer.addIsosurface
to draw a contour or GLViewer.addVolumetricRender to display a density volume.
Grid positions are mapped into world coordinates by origin/unit or matrix; flat
data indices have z varying fastest. This is distinct from loading atom
coordinates from a cube or VASP file with GLViewer.addModel.


Constructor

new VolumeData( str: string | ArrayBuffer | Uint8Array | Int8Array, format: string, options?: Object, ): VolumeData

Parameters

  • str (string | ArrayBuffer | Uint8Array | Int8Array) — Text or binary volumetric data; CCP4 data may also be supplied as a base64-encoded string.
  • format (string) — Format of supplied data (cube, dx, vasp, or ccp4); append .gz if compressed.
  • options (Object, optional) — normalize (zero mean, unit variance), negate

Instance Fields

getCoordinates

Return world coordinates for a flat grid index, with z varying fastest.

Parameters

  • index (number) — Integer index from zero through size.x * size.y * size.z - 1.

Returns

  • XYZ — Coordinates after the grid matrix or origin/unit transform.