View
A single rendering view (e.g. single anatomical plane) that is hosted inside a Display.
Extends
Extended by
Properties
| Property | Type | Description |
|---|---|---|
borderConfig | ViewBorderConfig | The ViewBorderConfig object defining if and how to render a border frame surrounding the view. Remarks Use setBorderConfig to override partial values. |
Methods
| Method | Description |
|---|---|
| setBorderConfig() | Updates the border config with the specified values. |
| 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. |
setBorderConfig()
ts
Updates the border config with the specified values.
Parameters
| Parameter | Type |
|---|---|
options | Partial<ViewBorderConfig> |
Returns
void
Throws
when non-nullable members of ViewBorderConfig are set to undefined
addObject()
ts
Add a custom GlObject to this view
Parameters
| Parameter | Type |
|---|---|
object | GlObject | null |
Returns
void
removeObject()
ts
Remove a custom GlObject from this view
Parameters
| Parameter | Type |
|---|---|
object | GlObject | null |
Returns
void
onVisibleDataChanged()
ts
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
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
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
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