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 | import { IGeometry, PublicContourSetData } from '../../../types'; import { GeometryType } from '../../../enums'; import { validateContourSet } from './validateContourSet'; import { ContourSet } from '../../../cache/classes/ContourSet'; export function createContourSet( geometryId: string, contourSetData: PublicContourSetData ) { // validate the data to make sure it is a valid contour set validateContourSet(contourSetData); const contourSet = new ContourSet({ id: contourSetData.id, data: contourSetData.data, color: contourSetData.color, frameOfReferenceUID: contourSetData.frameOfReferenceUID, segmentIndex: contourSetData.segmentIndex ?? 1, }); const geometry: IGeometry = { id: geometryId, type: GeometryType.CONTOUR, data: contourSet, sizeInBytes: contourSet.getSizeInBytes(), }; return geometry; } |