ImFusion Web SDK

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

ParameterTypeDescription
sisSharedImageSetThe dataset whose 3D display options to observe

Returns

DisplayOptions3d

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>
  );
}

See

useDisplayOptions2d