Image
Image shared on multiple devices
Extends
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
modality | public | DataModality | The image modality |
kind | readonly | DataKind | Return the data kind. Returns 'Volume' or 'Image' |
width | readonly | number | The width of the base interface |
height | readonly | number | The height of the base interface |
slices | readonly | number | The number of slices of the base interface |
channels | readonly | number | The number of channels of the base interface |
dimension | readonly | number | The image dimensions |
extent | readonly | vec3 | The image extent |
matrixToWorld | public | mat4 | The transformation matrix from image space to world space. |
matrixFromWorld | public | mat4 | The transformation matrix from world space to image space. |
Methods
| Method | Description |
|---|---|
| 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
| Method | Description |
|---|---|
| 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()
descriptor(): ImageDescriptor;Returns the ImageDescriptor of the image.
Returns
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:
using descriptor = image.descriptor();descriptorWorld()
descriptorWorld(): ImageDescriptorWorld;Returns the ImageDescriptorWorld of the image.
Returns
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:
using descriptorWorld = image.descriptorWorld();setDirtyMem()
setDirtyMem(): void;Manually label the memory image as dirty (i.e. the other representations must be updated).
Returns
void
setDirtyGl()
setDirtyGl(): boolean;Manually label the OpenGL image as dirty (i.e. the other representations must be updated).
Returns
boolean
size()
size(): number;Returns the number of elements in the image.
Returns
number
data()
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()
spacing(): vec3;Returns the image spacing.
Returns
dimensions()
dimensions(): vec3i;Returns the dimensions of the image.
Returns
setSpacing()
setSpacing(spacing: vec3, metric?: boolean): void;Set the image spacing on all existing image representations. Optionally allows setting whether the spacing is metric.
Parameters
| Parameter | Type | Description |
|---|---|---|
spacing | vec3 | - |
metric? | boolean | If this parameter is missing, only the image spacing will be changed |
Returns
void