ImFusion Web SDK

Image

Image shared on multiple devices

Extends

Properties

PropertyModifierTypeDescription
modalitypublicDataModalityThe image modality
kindreadonlyDataKindReturn the data kind. Returns 'Volume' or 'Image'
widthreadonlynumberThe width of the base interface
heightreadonlynumberThe height of the base interface
slicesreadonlynumberThe number of slices of the base interface
channelsreadonlynumberThe number of channels of the base interface
dimensionreadonlynumberThe image dimensions
extentreadonlyvec3The image extent
matrixToWorldpublicmat4The transformation matrix from image space to world space.
matrixFromWorldpublicmat4The transformation matrix from world space to image space.

Methods

MethodDescription
descriptor()Returns the ImageDescriptor of the image.
descriptorWorld()Returns the ImageDescriptorWorld of the image.
setDirtyMem()Manually label the memory image as dirty (i.e. the other representations must be updated).
setDirtyGl()Manually label the OpenGL image as dirty (i.e. the other representations must be updated).
size()Returns the number of elements in the image.
data()Returns a memory view to the underlying pixel buffer of the image on memory.
spacing()Returns the image spacing.
dimensions()Returns the dimensions of the image.
setSpacing()Set the image spacing on all existing image representations.

Inherited from ClassHandle

MethodDescription
isAliasOf()Returns true if this handle and other alias the same underlying C++ object.
delete()Releases this JavaScript handle.
deleteLater()Schedules this handle for deferred deletion and returns this handle.
isDeleted()Returns true if this handle has already been deleted.
[dispose]()Releases this handle when the enclosing scope exits, so a handle can be declared with using instead of calling delete() later manually.
clone()Returns a new JavaScript handle aliasing the same underlying C++ object.

descriptor()

ts
descriptor(): ImageDescriptor;

Returns the ImageDescriptor of the image.

Returns

ImageDescriptor

Once the handle to the returned object is no longer needed on the JS side, it must be released by calling delete(). Prefer declaring the variable with using so this happens automatically:

ts
using descriptor = image.descriptor();

descriptorWorld()

ts
descriptorWorld(): ImageDescriptorWorld;

Returns the ImageDescriptorWorld of the image.

Returns

ImageDescriptorWorld

Once the handle to the returned object is no longer needed on the JS side, it must be released by calling delete(). Prefer declaring the variable with using so this happens automatically:

ts
using descriptorWorld = image.descriptorWorld();

setDirtyMem()

ts
setDirtyMem(): void;

Manually label the memory image as dirty (i.e. the other representations must be updated).

Returns

void


setDirtyGl()

ts
setDirtyGl(): boolean;

Manually label the OpenGL image as dirty (i.e. the other representations must be updated).

Returns

boolean


size()

ts
size(): number;

Returns the number of elements in the image.

Returns

number


data()

ts
data():
  | Int8Array<ArrayBufferLike>
  | Uint8Array<ArrayBufferLike>
  | Int16Array<ArrayBufferLike>
  | Uint16Array<ArrayBufferLike>
  | Int32Array<ArrayBufferLike>
  | Uint32Array<ArrayBufferLike>
  | Float32Array<ArrayBufferLike>
| Float64Array<ArrayBufferLike>;

Returns a memory view to the underlying pixel buffer of the image on memory. This buffer can be modified in-place, in which case you can mark the other representation (the GL representation for instance) as outdated using setDirtyMem().

Returns

| Int8Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike> | Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>


spacing()

ts
spacing(): vec3;

Returns the image spacing.

Returns

vec3


dimensions()

ts
dimensions(): vec3i;

Returns the dimensions of the image.

Returns

vec3i


setSpacing()

ts
setSpacing(spacing: vec3, metric?: boolean): void;

Set the image spacing on all existing image representations. Optionally allows setting whether the spacing is metric.

Parameters

ParameterTypeDescription
spacingvec3-
metric?booleanIf this parameter is missing, only the image spacing will be changed

Returns

void

On this page