View
A single rendering view (e.g. single anatomical plane) that is hosted inside a Display.
Extends
Extended by
Methods
| Method | Description |
|---|---|
| addObject() | Add a custom GlObject to this view |
| removeObject() | Remove a custom GlObject from this view |
| onVisibleDataChanged() | Fires when the visible data in the view changes. |
| setBorderColor() | Set the border color for this view. |
| screenshot() | Creates a screenshot of the this view. |
| setBackgroundColor() | Set the optional background color used to clear the viewport before rendering anything. |
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. |
addObject()
ts
addObject(object: GlObject | null): void;Add a custom GlObject to this view
Parameters
| Parameter | Type |
|---|---|
object | GlObject | null |
Returns
void
removeObject()
ts
removeObject(object: GlObject | null): void;Remove a custom GlObject from this view
Parameters
| Parameter | Type |
|---|---|
object | GlObject | null |
Returns
void
onVisibleDataChanged()
ts
onVisibleDataChanged(callback: (before: HandleArray<Data>, after: HandleArray<Data>) => void): () => void;Fires when the visible data in the view changes.
Parameters
| Parameter | Type | Description |
|---|---|---|
callback | (before: HandleArray<Data>, after: HandleArray<Data>) => void | Called with the data arrays before and after the change. |
Returns
Unsubscribe function.
() => void
setBorderColor()
ts
setBorderColor(color: vec3): void;Set the border color for this view. This color will also be reflected in the slice indicators in other views.
Parameters
| Parameter | Type |
|---|---|
color | vec3 |
Returns
void
screenshot()
ts
screenshot(withAlpha: boolean, backgroundColor: vec4):
| Uint8Array<ArrayBufferLike>
| undefined;Creates a screenshot of the this view.
Parameters
| Parameter | Type | Description |
|---|---|---|
withAlpha | boolean | If true, the screenshot will include an alpha channel. |
backgroundColor | vec4 | The background color to use for the screenshot. |
Returns
| Uint8Array<ArrayBufferLike>
| undefined
The screenshot as PNG encoded data.
setBackgroundColor()
ts
setBackgroundColor(color?: vec3): void;Set the optional background color used to clear the viewport before rendering anything.
Parameters
| Parameter | Type | Description |
|---|---|---|
color? | vec3 | The new background color. Omitting the parameter causes the view to not clear its viewport before rendering. |
Returns
void