All files / core/src/types IVolumeInput.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39                                                                             
import type { VolumeActor } from './IActor';
import type BlendModes from '../enums/BlendModes';
 
/**
 * Volume input callback type, used to perform operations on the volume data
 * after it has been loaded.
 */
type VolumeInputCallback = (params: {
  /** vtk volume actor */
  volumeActor: VolumeActor;
  /** unique volume Id in the cache */
  volumeId: string;
}) => unknown;
 
/**
 * VolumeInput that can be used to add a volume to a viewport. It includes
 * mandatory `volumeId` but other options such as `visibility`, `blendMode`,
 * `slabThickness` and `callback` can also be provided
 */
type IVolumeInput = {
  /** Volume ID of the volume in the cache */
  volumeId: string;
  // actorUID for segmentations, since two segmentations with the same volumeId
  // can have different representations
  actorUID?: string;
  /** Visibility of the volume - by default it is true */
  visibility?: boolean;
  /** Callback to be called when the volume is added to the viewport */
  callback?: VolumeInputCallback;
  /** Blend mode of the volume - by default it is `additive` */
  blendMode?: BlendModes;
  /** Slab thickness of the volume - by default it is 0.05*/
  slabThickness?: number;
  /** other metadata that is needed for the volume */
  [key: string]: unknown;
};
 
export type { IVolumeInput, VolumeInputCallback };