All files / core/src/types VolumeProps.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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76                                                                                                                                                       
import type { vtkImageData } from '@kitware/vtk.js/Common/DataModel/ImageData';
import type Point3 from './Point3';
import type Metadata from './Metadata';
import type Mat3 from './Mat3';
import type { VoxelManager } from '../utilities';
import type {
  PixelDataTypedArray,
  PixelDataTypedArrayString,
} from './PixelDataTypedArray';
import type RGB from './RGB';
import type { IVoxelManager } from './IVoxelManager';
 
/**
 * Properties required to instantiate a Volume object.
 * This includes all the necessary data and metadata to define
 * a volume in 3D/4D space.
 */
interface VolumeProps {
  /** Unique identifier for the volume */
  volumeId: string;
 
  /** Metadata describing the volume */
  metadata: Metadata;
 
  /** Dimensions of the volume (width, height, depth) */
  dimensions: Point3;
 
  /** Spacing between volume points in 3D world space */
  spacing: Point3;
 
  /** Origin point of the volume in world space */
  origin: Point3;
 
  /** Direction of the volume in world space */
  direction: Mat3;
 
  /** Image data representing the volume */
  imageData?: vtkImageData;
 
  /**
   * The new volume model which solely relies on the separate image data
   * and do not cache the volume data at all
   */
  voxelManager?: IVoxelManager<number> | IVoxelManager<RGB>;
  dataType: PixelDataTypedArrayString;
 
  /**
   * To be deprecated scalarData and sizeInBytes
   * which is the old model of allocating the volume data
   * and caching it in the volume object
   */
  scalarData?: PixelDataTypedArray | PixelDataTypedArray[];
  sizeInBytes?: number;
 
  /** Property to store additional information */
  additionalDetails?: Record<string, unknown>;
 
  /** Scaling parameters if the volume contains scaled data (optional) */
  scaling?: {
    PT?: {
      SUVlbmFactor?: number;
      SUVbsaFactor?: number;
      suvbwToSuvlbm?: number;
      suvbwToSuvbsa?: number;
    };
  };
 
  /** Optional ID of a referenced volume if this volume is derived from another */
  referencedVolumeId?: string;
 
  /** Number of components for scalar data in the volume */
  numberOfComponents?: number;
}
 
export type { VolumeProps };