useDisplayOptions3d
ts
function useDisplayOptions3d(sis: SharedImageSet): DisplayOptions3d;Returns the reactive 3D display options for a dataset.
Subscribes to DisplayOptions3d.onChanged. The hook triggers a re-render whenever the options change.
Parameters
| Parameter | Type | Description |
|---|---|---|
sis | SharedImageSet | The dataset whose 3D display options to observe |
Returns
The DisplayOptions3d handle
Throws
If called outside of an ImFusionProvider
Throws
If called before the SDK has finished initializing
Example
tsx
function DisplayControls3D({ sis }: { sis: SharedImageSet }) {
const opts = useDisplayOptions3d(sis);
return (
<div>
<p>
Window: {opts.window} / Level: {opts.level}
</p>
<button
onClick={() => {
opts.window = 400;
opts.level = 40;
}}
>
Lung preset
</button>
</div>
);
}