larvitar 4.0.0-alpha.3 → 4.0.0-alpha.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/imaging/MetaDataReadable.d.ts +2 -0
  2. package/dist/imaging/MetaDataTypes.d.ts +5 -3
  3. package/dist/imaging/imageContours.d.ts +1 -1
  4. package/dist/imaging/imageIo.d.ts +7 -0
  5. package/dist/imaging/imageManagers.d.ts +1 -1
  6. package/dist/imaging/imageParsing.d.ts +1 -1
  7. package/dist/imaging/imageRendering.d.ts +19 -1
  8. package/dist/imaging/imageStore.d.ts +5 -3
  9. package/dist/imaging/imageTools.d.ts +145 -20
  10. package/dist/imaging/imageUtils.d.ts +25 -4
  11. package/dist/imaging/loaders/commonLoader.d.ts +4 -22
  12. package/dist/imaging/loaders/singleFrameLoader.d.ts +13 -3
  13. package/dist/imaging/parsers/ecg.d.ts +4 -5
  14. package/dist/imaging/postProcessing/applyKernel.d.ts +52 -0
  15. package/dist/imaging/tools/custom/BorderMagnifyTool.d.ts +15 -8
  16. package/dist/imaging/tools/custom/WwwcRemoveRegionTool.d.ts +17 -21
  17. package/dist/imaging/tools/custom/contourTool.d.ts +148 -147
  18. package/dist/imaging/tools/custom/diameterTool.d.ts +76 -8
  19. package/dist/imaging/tools/custom/editMaskTool.d.ts +18 -6
  20. package/dist/imaging/tools/custom/polygonSegmentationMixin.d.ts +40 -36
  21. package/dist/imaging/tools/custom/polylineScissorsTool.d.ts +8 -1
  22. package/dist/imaging/tools/custom/rectangleRoiOverlayTool.d.ts +14 -11
  23. package/dist/imaging/tools/custom/thresholdsBrushTool.d.ts +18 -13
  24. package/dist/imaging/tools/custom/utils/customMouseWheelScrollToolUtils/loadHandlerManager.d.ts +17 -16
  25. package/dist/imaging/tools/default.d.ts +45 -3
  26. package/dist/imaging/tools/types.d.ts +140 -21
  27. package/dist/imaging/types.d.ts +59 -22
  28. package/dist/imaging3d/imageLoading.d.ts +24 -2
  29. package/dist/imaging3d/imageParsing.d.ts +7 -0
  30. package/dist/imaging3d/imageRendering.d.ts +153 -4
  31. package/dist/imaging3d/metadataProviders/cineMetadataProvider.d.ts +19 -0
  32. package/dist/imaging3d/metadataProviders/generalSeriesProvider.d.ts +19 -0
  33. package/dist/imaging3d/metadataProviders/imageMetadataProvider.d.ts +4 -0
  34. package/dist/imaging3d/metadataProviders/imagePlaneMetadataProvider.d.ts +19 -0
  35. package/dist/imaging3d/metadataProviders/imageUrlMetadataProvider.d.ts +19 -0
  36. package/dist/imaging3d/metadataProviders/metadataProviders.d.ts +14 -0
  37. package/dist/imaging3d/tools/custom/exampleCustomTool.d.ts +44 -0
  38. package/dist/imaging3d/tools/main.d.ts +98 -9
  39. package/dist/imaging3d/types.d.ts +76 -0
  40. package/dist/imaging3d/video/videoInteractions.d.ts +104 -0
  41. package/dist/index.d.ts +30 -8
  42. package/dist/larvitar.js +168863 -166053
  43. package/imaging/tools/types.d.ts +472 -0
  44. package/package.json +5 -4
  45. package/dist/imaging/tools/custom/4dSliceScrollTool.d.ts +0 -12
  46. package/dist/imaging3d/imageMetadataProvider.d.ts +0 -7
@@ -27,6 +27,8 @@ export type MetaDataReadable = {
27
27
  frameDelay?: number;
28
28
  rWaveTimeVector?: number[];
29
29
  isMultiframe?: boolean;
30
+ isVideo?: boolean;
31
+ isVideoSupported?: boolean;
30
32
  waveform?: boolean;
31
33
  temporalPositionIdentifier?: number;
32
34
  numberOfTemporalPositions?: number;
@@ -1,6 +1,7 @@
1
1
  export type ExtendedMetaDataTypes = MetaDataTypes & {
2
2
  [key: string]: unknown;
3
3
  };
4
+ export declare const arrayTags: string[];
4
5
  export type MetaDataTypes = {
5
6
  x20000010?: number;
6
7
  x2000001e?: MetaDataTypes[];
@@ -1834,9 +1835,9 @@ export type MetaDataTypes = {
1834
1835
  x00281080?: string;
1835
1836
  x00281090?: string;
1836
1837
  x00281100?: number;
1837
- x00281101?: number;
1838
- x00281102?: number;
1839
- x00281103?: number;
1838
+ x00281101?: number[];
1839
+ x00281102?: number[];
1840
+ x00281103?: number[];
1840
1841
  x00281104?: number;
1841
1842
  x00281111?: number;
1842
1843
  x00281112?: number;
@@ -3491,4 +3492,5 @@ export type MetaDataTypes = {
3491
3492
  x300e0005?: string;
3492
3493
  x300e0008?: string;
3493
3494
  x50003000?: MetaDataTypes[];
3495
+ x7fe00010?: number;
3494
3496
  };
@@ -15,4 +15,4 @@ import { Contours } from "./types";
15
15
  */
16
16
  export declare const parseContours: (contoursData: {
17
17
  [key: string]: Uint8Array;
18
- }, pointBatchSize: number, segmentationName: string, viewports: Array<string>) => Contours;
18
+ }, pointBatchSize: number, segmentationName: string, viewports?: Array<string>) => Contours;
@@ -47,6 +47,13 @@ export declare const importNRRDImage: (bufferArray: ArrayBuffer) => Object;
47
47
  * @returns {String | null} base64 image (png full quality) or null if canvas does not exist
48
48
  */
49
49
  export declare const exportImageToBase64: (elementId: string, imageType: string) => string | null;
50
+ /**
51
+ * Export 3D image rendered in a canvas to base64
52
+ * @function exportImageToBase64
53
+ * @param elementId - Id of the div element containing the canvas
54
+ * @returns {String | null} base64 image (png full quality) or null if canvas does not exist
55
+ */
56
+ export declare const export3DImageToBase64: (elementId: string, imageType: "png" | "jpeg") => Promise<string | null>;
50
57
  /**
51
58
  * Export image rendered in a canvas to base64
52
59
  * @function exportImageToBase64OriginalSizes
@@ -42,7 +42,7 @@ export declare const resetImageManager: () => void;
42
42
  * Remove a stored seriesId from the image manager
43
43
  * @instance
44
44
  * @function removeDataFromImageManager
45
- * @param {String} seriesId The Id of the series
45
+ * @param {String} uniqueUID The Id of the series
46
46
  */
47
47
  export declare const removeDataFromImageManager: (uniqueUID: string) => void;
48
48
  /**
@@ -4,7 +4,7 @@
4
4
  import { DataSet } from "dicom-parser";
5
5
  import { ImageObject, MetaData } from "./types";
6
6
  import { getImageManager } from "./imageManagers";
7
- import type { ExtendedMetaDataTypes } from "./MetaDataTypes";
7
+ import { type ExtendedMetaDataTypes } from "./MetaDataTypes";
8
8
  /**
9
9
  * Reset series stack object and its internal data
10
10
  * @instance
@@ -3,7 +3,8 @@
3
3
  * rendering images in html canvas using cornerstone
4
4
  */
5
5
  import cornerstone from "cornerstone-core";
6
- import { RenderProps, Series, StoreViewport, Viewport } from "./types";
6
+ import { DisplayedArea, RenderProps, Series, StoreViewport, Viewport } from "./types";
7
+ import { ViewportComplete } from "./tools/types";
7
8
  /**
8
9
  * Purge the cornestone internal cache
9
10
  * If seriesId is passed as argument only imageIds of the series are purged from internal cache
@@ -106,6 +107,23 @@ export declare const unloadViewport: (elementId: string) => void;
106
107
  * @param {String} elementId - The html div id used for rendering or its DOM HTMLElement
107
108
  */
108
109
  export declare const resizeViewport: (elementId: string | HTMLElement) => void;
110
+ /**
111
+ * Check if the displayed image is anisotropic (row pixel spacing !== col pixel spacing)
112
+ * @instance
113
+ * @function isAnisotropic
114
+ * @param {String} elementId - The html div id used for rendering or its DOM HTMLElement
115
+ * @returns {Boolean}
116
+ */
117
+ export declare const isAnisotropic: (elementId: string) => boolean;
118
+ /**
119
+ * Retrieves Anisotropic Viewport displayedArea properties
120
+ * @instance
121
+ * @function getAnisotropicDisplayedArea
122
+ * @param {String} elementId - The html div id used for rendering or its DOM HTMLElement
123
+ * @param {ViewportComplete} viewport - The viewport
124
+ * @returns {DisplayedArea}
125
+ */
126
+ export declare const getAnisotropicDisplayedArea: (id: string, viewport: ViewportComplete) => DisplayedArea | undefined;
109
127
  /**
110
128
  * Cache image and render it in a html div using cornerstone
111
129
  * @instance
@@ -3,6 +3,7 @@
3
3
  * for data config store.
4
4
  */
5
5
  import type { StoreViewport } from "./types";
6
+ import { ICamera, VolumeViewport } from "../imaging3d/types";
6
7
  type StoreSeries = {
7
8
  imageIds: string[];
8
9
  progress: number;
@@ -25,14 +26,14 @@ type Store = {
25
26
  [key: string]: any;
26
27
  };
27
28
  type SetPayload = ["errorLog" | "leftActiveTool" | "rightActiveTool", string] | [
28
- ("isColor" | "isMultiframe" | "isPDF" | "waveform" | "dsa" | "isTimeserie" | "isDSAEnabled" | "ready"),
29
+ ("isColor" | "isMultiframe" | "isVideo" | "isVideoSupported" | "isPDF" | "waveform" | "dsa" | "isTimeserie" | "isDSAEnabled" | "ready"),
29
30
  string,
30
31
  boolean
31
32
  ] | [
32
33
  ("progress" | "loading" | "minPixelValue" | "maxPixelValue" | "minSliceId" | "maxSliceId" | "minTimeId" | "maxTimeId" | "rotation" | "scale" | "sliceId" | "timeId" | "thickness" | "numberOfFrames" | "numberOfTemporalPositions"),
33
34
  string,
34
35
  number
35
- ] | ["cached", string, string, boolean] | ["timestamp", string, number | undefined] | ["uniqueUID" | "modality", string, string | undefined] | ["pendingSliceId", string, number | undefined] | ["timestamps" | "timeIds", string, number[]] | ["pixelShift", string, number[] | undefined] | [
36
+ ] | ["cached", string, string, boolean] | ["timestamp", string, number | undefined] | ["uniqueUID" | "modality" | "filterName", string, string | undefined] | ["pendingSliceId", string, number | undefined] | ["timestamps" | "timeIds", string, number[]] | ["pixelShift", string, number[] | undefined] | [
36
37
  "contrast" | "dimensions" | "spacing" | "translation",
37
38
  string,
38
39
  number,
@@ -47,7 +48,7 @@ type SetPayload = ["errorLog" | "leftActiveTool" | "rightActiveTool", string] |
47
48
  number,
48
49
  number,
49
50
  boolean
50
- ];
51
+ ] | ["camera", string, ICamera] | ["mpr", string, VolumeViewport];
51
52
  export declare const set: (payload: SetPayload) => void;
52
53
  declare const _default: {
53
54
  initialize: () => void;
@@ -62,6 +63,7 @@ declare const _default: {
62
63
  setTimeId: (elementId: string, timeIndex: number) => void;
63
64
  setDSAEnabled: (elementId: string, enabled: boolean) => void;
64
65
  setDSAPixelShift: (elementId: string, pixelShift?: number[]) => void;
66
+ setImageFilter: (elementId: string, filterName: string) => void;
65
67
  resetActiveTools(): void;
66
68
  get: (props: string | string[] | undefined) => any;
67
69
  addStoreListener: (listener: (data: Store) => {}) => (data: Store) => {};
@@ -1,20 +1,145 @@
1
- export function addDefaultTools(toolToActivate: any): void;
2
- export function addDiameterTool(elementId: string, diameters: any[], seriesId: string): void;
3
- export function addContoursTool(rawContours: Object, maskName: string): void;
4
- export function addMaskEditingTool(mask: any[], callback: Function, targetViewport: string): void;
5
- export function setSegmentationConfig(config: Object): void;
6
- export function getCurrentMaskData(viewportId: string): any[];
7
- export function addStackStateToElement(seriesId: string, element: HTMLElement): void;
8
- export function addSeedsTool(preLoadSeeds: any[], initViewport: string): void;
9
- export function clearMeasurements(): void;
10
- export function setToolActive(toolName: string, options: Object, activeViewport: string, viewports: any[]): void;
11
- export function setToolDisabled(toolName: string, activeViewport: string, viewports: any[]): void;
12
- export function setToolEnabled(toolName: string, activeViewport: string, viewports: any[]): void;
13
- export function setToolPassive(toolName: string, activeViewport: string, viewports: any[]): void;
14
- export function getToolState(toolName: string): Object;
15
- export function clearToolStateByName(toolName: string, options: Object): void;
16
- export function updateDiameterTool(diameterId: string | number, value: Object, seriesId: string, viewportId: string): void;
17
- export function addToolStateSingleSlice(element: HTMLElement, toolName: string, data: Object | any[], slice: number, seriesId: string): void;
18
- export function clearCornerstoneElements(): void;
19
- export function syncToolStack(srcSliceNumber: number, toolName: string, viewport: string, seriesId: string): void;
20
- export function updateStackToolState(elementId: string, imageIndex: number): void;
1
+ /** @module imaging/imageTools
2
+ * @desc This file provides functionalities for
3
+ * interacting with cornerstone tools
4
+ * DEPRECATION WARNING: these are legacy functions
5
+ * that will be removed soon. Use the corresponding
6
+ * functions in /tools/main.js instead.
7
+ * For this reason, this file will not be translated to TypeScript.
8
+ */
9
+ import { DiameterStateData, SegmentationConfig } from "./tools/types";
10
+ /**
11
+ * Add Diameter tool
12
+ * @function addDiameterTool
13
+ * @param {String} elementId - The target hmtl element id or its DOM HTMLElement
14
+ * @param {Array} diameters - The array of diameter objects.
15
+ * @param {String} seriesId - The id of the target serie.
16
+ */
17
+ export declare const addDiameterTool: (elementId: string, diameters: number[], seriesId: string) => void;
18
+ /**
19
+ * Add Contour tool
20
+ * @function addContoursTool
21
+ * @param {Object} rawContours - The contours object (generated from a segmentation mask).
22
+ * @param {String} maskName - The name tag that identify the mask
23
+ */
24
+ /**
25
+ * Add Contour tool
26
+ * @function addContoursTool
27
+ * @param {Object} rawContours - The contours object (generated from a segmentation mask).
28
+ * @param {String} maskName - The name tag that identify the mask
29
+ */
30
+ export declare const addContoursTool: (rawContours: {
31
+ [key: string]: Uint8Array;
32
+ }, maskName: string) => void;
33
+ /**
34
+ * Add mask editing tool
35
+ * @function addMaskEditingTool
36
+ * @param {Array} mask - The mask data.
37
+ * @param {Function} callback - The tool initialization callback
38
+ * @param {String} targetViewport - The target hmtl element id.
39
+ */
40
+ export declare const addMaskEditingTool: (mask: string[], callback: () => void, targetViewport: string) => void;
41
+ /**
42
+ * Modify configuration for cornerstone tools segmentation module
43
+ * @function setSegmentationConfig
44
+ * @param {Object} config - The custom configuration.
45
+ * @example
46
+ * Example of custom configuration
47
+ * config = {
48
+ renderOutline: true,
49
+ renderFill: true,
50
+ shouldRenderInactiveLabelmaps: true,
51
+ radius: 10,
52
+ minRadius: 1,
53
+ maxRadius: 50,
54
+ segmentsPerLabelmap: 65535,
55
+ fillAlpha: 0.7,
56
+ fillAlphaInactive: 0.1,
57
+ outlineAlpha: 0.7,
58
+ outlineAlphaInactive: 0.35,
59
+ outlineWidth: 3,
60
+ storeHistory: true
61
+ };
62
+ */
63
+ export declare const setSegmentationConfig: (config: Partial<SegmentationConfig>) => void;
64
+ /**
65
+ * Get mask editing tool current data from state
66
+ * @function getCurrentMaskData
67
+ * @param {String} viewportId - The target hmtl element id.
68
+ * @return {Array} labelmap3D - The mask array
69
+ */
70
+ export declare const getCurrentMaskData: (viewportId: string) => unknown[];
71
+ /**
72
+ * Add Stack State to a single hmtl element
73
+ * @function addStackStateToElement
74
+ * @param {String} seriesId - The id of the target serie.
75
+ * @param {HTMLElement} element - The target hmtl element.
76
+ */
77
+ export declare const addStackStateToElement: (seriesId: string, element: HTMLElement) => void;
78
+ /**
79
+ * Add seeds tool
80
+ * @function addSeedsTool
81
+ * @param {Array} preLoadSeeds - The array of seeds to load as initialization.
82
+ * @param {String} initViewport - The hmtl element id to be used for tool initialization.
83
+ */
84
+ export declare const addSeedsTool: (preLoadSeeds: string[], initViewport: string) => void;
85
+ /**
86
+ * Delete all measurements from tools state, for tools that have the "cleaneable" prop set to true in tools/default.js
87
+ * @function clearMeasurements
88
+ */
89
+ export declare const clearMeasurements: () => void;
90
+ /**
91
+ * Get tool data for all enabled elements
92
+ * @function getToolState
93
+ * @param {String} toolName - The tool name.
94
+ * @return {Object} - Tool data grouped by element id
95
+ */
96
+ export declare const getToolState: (toolName: string) => any;
97
+ /**
98
+ * Clear tool data for a subset of seeds
99
+ * @function clearToolStateByName
100
+ * @param {String} toolName - The tool name.
101
+ * @param {Object} options - Props used to select the data to delete (at the moment only {name : "targetName"} is implemented)
102
+ */
103
+ export declare const clearToolStateByName: (toolName: string, options: any) => void;
104
+ /**
105
+ * Update diameter tool with new value (removing old one)
106
+ * @function updateDiameterTool
107
+ * @param {String | Number} diameterId - The id that identify the diameter data.
108
+ * @param {Object} value - The object representing the new diameter data.
109
+ * @param {String} seriesId - The target serie id.
110
+ * @param {String} viewportId - The viewport id.
111
+ */
112
+ export declare const updateDiameterTool: (diameterId: string, value: {
113
+ tool: DiameterStateData;
114
+ }, seriesId: string, viewportId: string) => void;
115
+ /**
116
+ * Add tool data for a single target slice
117
+ * @function addToolStateSingleSlice
118
+ * @param {HTMLElement} element - The target hmtl element.
119
+ * @param {String} toolName - The tool name.
120
+ * @param {Object | Array} data - The tool data to add (tool-specific)
121
+ * @param {Number} slice - The target slice to put the data in.
122
+ * @param {String} seriesId - The target serie id.
123
+ */
124
+ export declare const addToolStateSingleSlice: (element: HTMLElement, toolName: string, data: Partial<DiameterStateData>, slice: number, seriesId?: string) => void;
125
+ /**
126
+ * Clear tool state and disable all cornerstone elements
127
+ * @function clearCornerstoneElements
128
+ */
129
+ export declare const clearCornerstoneElements: () => void;
130
+ /**
131
+ * Sync the cornerstone tools stack given a slice as data source
132
+ * @function syncToolStack
133
+ * @param {Number} srcSliceNumber - The slice to be used as data source.
134
+ * @param {String} toolName - The name of the tool to sync.
135
+ * @param {String} viewport - The target viewport id.
136
+ * @param {String} seriesId - The target serie id.
137
+ */
138
+ export declare const syncToolStack: (srcSliceNumber: number, toolName: string, viewport: string, seriesId: string) => void;
139
+ /**
140
+ * Update slice index in cornerstone tools stack state
141
+ * @function updateStackToolState
142
+ * @param {String} elementId - The html div id used for rendering or its DOM HTMLElement
143
+ * @param {Number} imageIndex - The new imageIndex value.
144
+ */
145
+ export declare const updateStackToolState: (elementId: string | HTMLElement, imageIndex: number) => void;
@@ -2,7 +2,7 @@
2
2
  * @desc This file provides utility functions for
3
3
  * manipulating image pixels and image metadata
4
4
  */
5
- import type { CustomDataSet, MetaData, ReslicedInstance, Series } from "./types";
5
+ import type { CustomDataSet, MetaData, ReslicedInstance, Series, TypedArray } from "./types";
6
6
  /**
7
7
  * @typedef {Object} CornerstoneSeries
8
8
  * @property {Array} imageIds Array of the instances imageIds
@@ -16,20 +16,30 @@ import type { CustomDataSet, MetaData, ReslicedInstance, Series } from "./types"
16
16
  * @param {Array} el - The image_orientation dicom tag
17
17
  */
18
18
  export declare const getNormalOrientation: (el: [number, number, number, number, number, number]) => number[];
19
+ /**
20
+ * Get the min and max pixel value from pixelData
21
+ * @instance
22
+ * @function getMinPixelValue
23
+ * @param {Array} pixelData - Pixel data array
24
+ */
25
+ export declare const getMinMaxPixelValue: (pixelData: number[] | TypedArray) => {
26
+ minPixelValue: number;
27
+ maxPixelValue: number;
28
+ };
19
29
  /**
20
30
  * Get the min pixel value from pixelData
21
31
  * @instance
22
32
  * @function getMinPixelValue
23
33
  * @param {Array} pixelData - Pixel data array
24
34
  */
25
- export declare const getMinPixelValue: (pixelData: number[]) => number;
35
+ export declare const getMinPixelValue: (pixelData: number[] | TypedArray) => number;
26
36
  /**
27
37
  * Get the max pixel value from pixelData
28
38
  * @instance
29
39
  * @function getMaxPixelValue
30
40
  * @param {Array} pixelData - Pixel data array
31
41
  */
32
- export declare const getMaxPixelValue: (pixelData: number[]) => number;
42
+ export declare const getMaxPixelValue: (pixelData: number[] | TypedArray) => number;
33
43
  /**
34
44
  * Create the pixel representation string (type and length) from dicom tags
35
45
  * @instance
@@ -56,10 +66,11 @@ export declare const getTypedArrayFromDataType: (dataType: string) => Uint8Array
56
66
  * @function getSortedStack
57
67
  * @param {Object} seriesData - The dataset
58
68
  * @param {Array} sortPriorities - An array which represents the priority tasks
69
+ * @param {Bool} is3D - Boolean for 3D series
59
70
  * @param {Bool} returnSuccessMethod - Boolean for returning the success method
60
71
  * @return {Object} The sorted stack
61
72
  */
62
- export declare const getSortedStack: (seriesData: Series, sortPriorities: Array<"imagePosition" | "contentTime" | "instanceNumber">, returnSuccessMethod: boolean) => string[];
73
+ export declare const getSortedStack: (seriesData: Series, sortPriorities: Array<"imagePosition" | "contentTime" | "instanceNumber">, returnSuccessMethod: boolean, is3D?: boolean) => string[];
63
74
  /**
64
75
  * Sort the array of instanceUIDs according to imageIds sorted using sortSeriesStack
65
76
  * @instance
@@ -70,6 +81,16 @@ export declare const getSortedStack: (seriesData: Series, sortPriorities: Array<
70
81
  export declare const getSortedUIDs: (seriesData: Series) => {
71
82
  [key: string]: string;
72
83
  };
84
+ /**
85
+ * Sort the array of instanceUIDs3D according to imageIds3D sorted using sortSeriesStack
86
+ * @instance
87
+ * @function getSortedUIDs3D
88
+ * @param {Object} seriesData - The dataset
89
+ * @return {Object} The sorted instanceUIDs
90
+ */
91
+ export declare const getSortedUIDs3D: (seriesData: Series) => {
92
+ [key: string]: string;
93
+ };
73
94
  /**
74
95
  * Generate a randomUUID in the form 'uy0x2qz9jk9co642cjfus'
75
96
  * @instance
@@ -3,31 +3,13 @@
3
3
  * custom DICOMImageLoaders
4
4
  */
5
5
  import { DataSet } from "dicom-parser";
6
- import type { MetaData } from "../types";
6
+ import type { ImageFrame, MetaData } from "../types";
7
7
  /**
8
8
  * Compute and return image frame
9
9
  * @instance
10
10
  * @function getImageFrame
11
- * @param {Object} metadata metadata object
12
- * @param {Object} dataSet dicom dataset
11
+ * @param {MetaData} metadata metadata object
12
+ * @param {DataSet} dataSet dicom dataset
13
13
  * @returns {Object} specific image frame
14
14
  */
15
- export declare const getImageFrame: (metadata: MetaData, dataSet: DataSet) => {
16
- samplesPerPixel: any;
17
- photometricInterpretation: any;
18
- planarConfiguration: any;
19
- rows: any;
20
- columns: any;
21
- bitsAllocated: any;
22
- pixelRepresentation: any;
23
- smallestPixelValue: any;
24
- largestPixelValue: any;
25
- redPaletteColorLookupTableDescriptor: any;
26
- greenPaletteColorLookupTableDescriptor: any;
27
- bluePaletteColorLookupTableDescriptor: any;
28
- redPaletteColorLookupTableData: any;
29
- greenPaletteColorLookupTableData: any;
30
- bluePaletteColorLookupTableData: any;
31
- pixelData: undefined;
32
- ImageData: undefined;
33
- };
15
+ export declare const getImageFrame: (metadata: MetaData, dataSet?: DataSet) => ImageFrame;
@@ -2,16 +2,26 @@
2
2
  * @desc This file is a custom DICOM loader for single frame of multiframe images
3
3
  */
4
4
  import { ImageLoader } from "cornerstone-core";
5
- import type { ImageObject, MetaData } from "../types";
5
+ import type { ImageObject, MetaData, SingleFrameCache } from "../types";
6
+ /**
7
+ * Get the single frame cache
8
+ * @export
9
+ * @function getSingleFrameCache
10
+ * @param {String} imageId - Optional Image tag
11
+ * @returns {Object} - Single frame cache object
12
+ */
13
+ export declare const getSingleFrameCache: (imageId?: string) => {
14
+ [key: string]: SingleFrameCache;
15
+ };
6
16
  /**
7
17
  * Set the single frame cache
8
18
  * @export
9
19
  * @function setSingleFrameCache
10
- * @param {Array} data - Pixel data array
20
+ * @param {Array} pixelData - Pixel data array
11
21
  * @param {MetaData} metadata - Metadata object
12
22
  * @returns {ImageObject} - Image object
13
23
  */
14
- export declare const setSingleFrameCache: (data: Uint8ClampedArray, metadata: MetaData) => Promise<ImageObject>;
24
+ export declare const setSingleFrameCache: (pixelData: Uint8ClampedArray, metadata: MetaData) => Promise<ImageObject>;
15
25
  /**
16
26
  * Clear single frame cache
17
27
  * @export
@@ -2,14 +2,13 @@
2
2
  * @desc This file provides functionalities for
3
3
  * handling ECG signales in DICOM files
4
4
  */
5
- import { DataSet } from "dicom-parser";
5
+ import { MetaData } from "../types";
6
6
  /**
7
7
  * Generate an array of points representing the ECG signal
8
- * @instance
9
8
  * @function parseECG
10
- * @param {DataSet} dataSet - the DICOM dataset
11
- * @param {String} tag - the tag of the ECG signal
9
+ * @param {DataSet} seriesId - the series ID to which the ECG data belongs
10
+ * @param {MetaData} metadata - the metadata object containing the ECG signal data
12
11
  * @param {Number} nSampling - the sampling rate
13
12
  * @returns {void}
14
13
  */
15
- export declare function parseECG(seriesId: string, dataSet: DataSet, tag: string, nSampling?: number): void;
14
+ export declare const parseECG: (seriesId: string, metadata: MetaData, nSampling?: number) => void;
@@ -0,0 +1,52 @@
1
+ import { Image, TypedArray, KernelConfig } from "../types";
2
+ /**
3
+ * Add custom kernel to the global object
4
+ * @function addCustomKernel
5
+ * @param {string} name - Name for the new kernel
6
+ * @param {KernelConfig} config - Kernel configuration (modality, label, size, kernel)
7
+ * @returns {void}
8
+ */
9
+ export declare const addCustomKernel: (name: string, config: KernelConfig) => void;
10
+ /**
11
+ * Get kernels
12
+ * @function getKernels
13
+ * @returns {ConvolutionKernels} - CONVOLUTION_KERNELS object
14
+ */
15
+ export declare const getKernels: () => {
16
+ [x: string]: KernelConfig;
17
+ };
18
+ /**
19
+ * Apply convolution filter to DICOM image
20
+ * @function applyConvolutionFilter
21
+ * @param {Image} loadedImage - The DICOM image object
22
+ * @param {string} filterName - Name of the filter to apply
23
+ * @param {number} multiplier - Optional multiplier for kernel values (default: 1)
24
+ * @returns {TypedArray} - Convolved pixel data
25
+ */
26
+ export declare const applyConvolutionFilter: (loadedImage: Image, filterName: string, generateImage?: boolean) => Partial<Image> | TypedArray;
27
+ /**
28
+ * Create the filtered image
29
+ * @function createFilteredImage
30
+ * @param {Image} loadedImage - the source image
31
+ * @param {number[]} filteredPixelArray - filtered pixel data
32
+ * @returns {Partial<Image>} - Convolved pixel data
33
+ */
34
+ export declare const createFilteredImage: (loadedImage: Image, filteredPixelArray: number[]) => Partial<Image>;
35
+ /**
36
+ * Applies a Gaussian blur filter to a cornerstone image.
37
+ * @function applyGaussianBlur
38
+ * @param {Image} loadedImage - The cornerstone image object.
39
+ * @param {number} kernelSize - The size of the kernel.
40
+ * @param {number} strength - The sigma value for the Gaussian function.
41
+ * @returns {Partial<Image>} - The new, blurred cornerstone image object.
42
+ */
43
+ export declare const applyGaussianBlur: (loadedImage: Image, kernelSize: number, strength: number) => Partial<Image>;
44
+ /**
45
+ * Applies a sharpening filter to a cornerstone image.
46
+ * @function applySharpening
47
+ * @param {Image} loadedImage - The cornerstone image object.
48
+ * @param {number} kernelSize - The size of the kernel.
49
+ * @param {number} strength - The strength of the sharpening effect.
50
+ * @returns {Partial<Image>} - The new, sharpened cornerstone image object.
51
+ */
52
+ export declare const applySharpening: (loadedImage: Image, kernelSize: number, strength: number) => Partial<Image>;
@@ -1,21 +1,28 @@
1
- declare const BorderMagnifyTool_base: any;
2
- export default class BorderMagnifyTool extends BorderMagnifyTool_base {
3
- [x: string]: any;
4
- constructor(props?: {});
1
+ import { EventData } from "../types";
2
+ declare const MagnifyTool: any;
3
+ export default class BorderMagnifyTool extends MagnifyTool {
4
+ static [x: string]: any;
5
+ constructor(props?: {
6
+ showBorders?: boolean;
7
+ showInfo?: boolean;
8
+ borderColor?: string;
9
+ });
10
+ activeCallback(element: HTMLElement): void;
11
+ disabledCallback(element: HTMLElement): void;
12
+ passiveCallback(element: HTMLElement): void;
5
13
  /**
6
14
  * Event handler for the "keydown" event to toggle the visibility of borders and info on "B" key press.
7
15
  * @param {KeyboardEvent} event
8
16
  * @returns {void}
9
17
  */
10
18
  handleKeyDown(event: KeyboardEvent): void;
11
- activeCallback(element: any): void;
12
- disabledCallback(element: any): void;
13
- passiveCallback(element: any): void;
14
19
  /**
15
20
  * Overrides the _drawMagnificationTool method to add configurable borders and display zoom/ROI dimensions.
16
21
  * @param {*} evt
17
22
  * @returns {void}
18
23
  */
19
- _drawMagnificationTool(evt: any): void;
24
+ _drawMagnificationTool(evt?: {
25
+ detail: EventData;
26
+ }): void;
20
27
  }
21
28
  export {};
@@ -1,3 +1,5 @@
1
+ import { Coords, EventData, MeasurementData, MeasurementMouseEvent } from "../types";
2
+ declare const BaseAnnotationTool: any;
1
3
  /**
2
4
  * @public
3
5
  * @class WwwcRemoveRegionTool
@@ -6,14 +8,10 @@
6
8
  * @classdesc Tool for setting wwwc based on a rectangular region.
7
9
  * @extends Tools.Base.BaseTool
8
10
  */
9
- export default class WwwcRemoveRegionTool {
11
+ export default class WwwcRemoveRegionTool extends BaseAnnotationTool {
12
+ static [x: string]: any;
10
13
  constructor(props?: {});
11
- dataHandles: any[];
12
- element: any;
13
- _drawingMouseUpCallback: (evt: any) => void;
14
- _editMouseUpCallback: (evt: any) => void;
15
- throttledUpdateCachedStats: any;
16
- createNewMeasurement(eventData: any): {
14
+ createNewMeasurement(eventData: EventData): {
17
15
  computeMeasurements: any;
18
16
  visible: boolean;
19
17
  active: boolean;
@@ -21,18 +19,18 @@ export default class WwwcRemoveRegionTool {
21
19
  invalidated: boolean;
22
20
  handles: {
23
21
  start: {
24
- x: any;
25
- y: any;
22
+ x: number;
23
+ y: number;
26
24
  highlight: boolean;
27
25
  active: boolean;
28
26
  };
29
27
  end: {
30
- x: any;
31
- y: any;
28
+ x: number;
29
+ y: number;
32
30
  highlight: boolean;
33
31
  active: boolean;
34
32
  };
35
- initialRotation: any;
33
+ initialRotation: number;
36
34
  textBox: {
37
35
  active: boolean;
38
36
  hasMoved: boolean;
@@ -43,20 +41,18 @@ export default class WwwcRemoveRegionTool {
43
41
  };
44
42
  };
45
43
  } | undefined;
46
- originalWW: any;
47
- originalWC: any;
48
- pointNearTool(element: any, data: any, coords: any, interactionType: any): boolean;
49
- updateCachedStats(image: any, element: any, data: any): void;
50
- renderToolData(evt: any): void;
51
- mode: any;
52
- _withinHandleBoxes(startCanvas: any, endCanvas: any): boolean;
44
+ pointNearTool(element: Element, data: MeasurementData, coords: Coords, interactionType: string): boolean;
45
+ updateCachedStats(image: cornerstone.Image, element: Element, data: MeasurementData): void;
46
+ renderToolData(evt: MeasurementMouseEvent): void;
47
+ _withinHandleBoxes(startCanvas: Coords, endCanvas: Coords): boolean;
53
48
  /**
54
49
  * Event handler for MOUSE_UP/TOUCH_END during handle drag event loop.
55
50
  *
56
51
  * @private
57
52
  * @method _applyStrategy
58
- * @param {(CornerstoneTools.event#MOUSE_UP|CornerstoneTools.event#TOUCH_END)} evt Interaction event emitted by an enabledElement
53
+ * @param {MeasurementMouseEvent} evt Interaction event emitted by an enabledElement
59
54
  * @returns {void}
60
55
  */
61
- private _applyStrategy;
56
+ _applyStrategy(evt: MeasurementMouseEvent): void;
62
57
  }
58
+ export {};