diff --git a/common/reviews/api/tools.api.md b/common/reviews/api/tools.api.md index 9cdda89a26..9b3d67d33f 100644 --- a/common/reviews/api/tools.api.md +++ b/common/reviews/api/tools.api.md @@ -9,7 +9,6 @@ import { Corners } from '@kitware/vtk.js/Interaction/Widgets/OrientationMarkerWi import type { IColorMapPreset } from '@kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps'; import type { mat3 } from 'gl-matrix'; import { mat4 } from 'gl-matrix'; -import { PixelDataTypedArray as PixelDataTypedArray_2 } from 'packages/core/dist/esm/types'; import type { Range as Range_2 } from '@kitware/vtk.js/types'; import { vec3 } from 'gl-matrix'; import type vtkActor from '@kitware/vtk.js/Rendering/Core/Actor'; @@ -2464,23 +2463,14 @@ declare namespace EventTypes_2 { function extend2DBoundingBoxInViewAxis(boundsIJK: [Types_2.Point2, Types_2.Point2, Types_2.Point2], numSlicesToProject: number): [Types_2.Point2, Types_2.Point2, Types_2.Point2]; // @public (undocumented) -function extractWindowLevelRegionToolData(viewport: any): { - scalarData: PixelDataTypedArray_2; +function extractWindowLevelRegionToolData(viewport: Types_2.IVolumeViewport | Types_2.IStackViewport): { + scalarData: Types_2.PixelDataTypedArray; minPixelValue: number; maxPixelValue: number; width: number; height: number; rows: number; columns: number; -} | { - scalarData: any; - width: any; - height: any; - minPixelValue: number; - maxPixelValue: number; - rows: any; - columns: any; - color: any; }; // @public (undocumented) diff --git a/packages/tools/src/stateManagement/segmentation/helpers/getSegmentationActor.ts b/packages/tools/src/stateManagement/segmentation/helpers/getSegmentationActor.ts index 58e463c037..0c088d69fe 100644 --- a/packages/tools/src/stateManagement/segmentation/helpers/getSegmentationActor.ts +++ b/packages/tools/src/stateManagement/segmentation/helpers/getSegmentationActor.ts @@ -1,3 +1,4 @@ +import type { Types } from '@cornerstonejs/core'; import { getEnabledElementByViewportId } from '@cornerstonejs/core'; import { SegmentationRepresentations } from '../../../enums'; @@ -11,8 +12,8 @@ import { SegmentationRepresentations } from '../../../enums'; function getActorEntry( viewportId: string, segmentationId: string, - filterFn: (actor: unknown) => boolean -) { + filterFn: (actor: Types.ActorEntry) => boolean +): Types.ActorEntry | undefined { const enabledElement = getEnabledElementByViewportId(viewportId); if (!enabledElement) { diff --git a/packages/tools/src/utilities/voi/windowlevel/extractWindowLevelRegionToolData.ts b/packages/tools/src/utilities/voi/windowlevel/extractWindowLevelRegionToolData.ts index 663ca7fe6d..9c1ce723b8 100644 --- a/packages/tools/src/utilities/voi/windowlevel/extractWindowLevelRegionToolData.ts +++ b/packages/tools/src/utilities/voi/windowlevel/extractWindowLevelRegionToolData.ts @@ -1,11 +1,13 @@ +import type { Types } from '@cornerstonejs/core'; import { - VolumeViewport, utilities as csUtils, - cache, StackViewport, + VolumeViewport, } from '@cornerstonejs/core'; -function extractWindowLevelRegionToolData(viewport) { +function extractWindowLevelRegionToolData( + viewport: Types.IVolumeViewport | Types.IStackViewport +) { if (viewport instanceof VolumeViewport) { return extractImageDataVolume(viewport); } @@ -16,7 +18,7 @@ function extractWindowLevelRegionToolData(viewport) { throw new Error('Viewport not supported'); } -function extractImageDataVolume(viewport) { +function extractImageDataVolume(viewport: Types.IVolumeViewport) { const { scalarData, width, height } = csUtils.getCurrentVolumeViewportSlice(viewport); const { min: minPixelValue, max: maxPixelValue } = @@ -33,7 +35,7 @@ function extractImageDataVolume(viewport) { }; } -function extractImageDataStack(viewport) { +function extractImageDataStack(viewport: Types.IStackViewport) { const imageData = viewport.getImageData(); const { scalarData } = imageData; const { min: minPixelValue, max: maxPixelValue } =