larvitar 3.8.9 → 3.8.12
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.
- package/dist/imaging/MetaDataTypes.d.ts +2 -2
- package/dist/imaging/srUtils.d.ts +50 -0
- package/dist/imaging/tools/custom/CobbAngleTool.d.ts +48 -0
- package/dist/imaging/tools/custom/NorbergAngleTool.d.ts +22 -0
- package/dist/imaging/tools/custom/TPAAnnotationTool.d.ts +135 -0
- package/dist/imaging/tools/custom/VHSAnnotationTool.d.ts +31 -0
- package/dist/imaging/tools/custom/gridTool.d.ts +88 -0
- package/dist/imaging/tools/custom/utils/gridToolUtils/gridToolUtils.d.ts +27 -0
- package/dist/imaging/tools/types.d.ts +110 -0
- package/dist/imaging/types.d.ts +160 -0
- package/dist/index.d.ts +2 -1
- package/dist/larvitar.js +1 -1
- package/package.json +1 -1
|
@@ -2324,7 +2324,7 @@ export type MetaDataTypes = {
|
|
|
2324
2324
|
x0040a136?: number;
|
|
2325
2325
|
x0040a138?: number;
|
|
2326
2326
|
x0040a13a?: string;
|
|
2327
|
-
x0040a160?:
|
|
2327
|
+
x0040a160?: string;
|
|
2328
2328
|
x0040a167?: MetaDataTypes[];
|
|
2329
2329
|
x0040a168?: MetaDataTypes[];
|
|
2330
2330
|
x0040a16a?: string;
|
|
@@ -2346,7 +2346,7 @@ export type MetaDataTypes = {
|
|
|
2346
2346
|
x0040a300?: MetaDataTypes[];
|
|
2347
2347
|
x0040a301?: MetaDataTypes[];
|
|
2348
2348
|
x0040a307?: string;
|
|
2349
|
-
x0040a30a?:
|
|
2349
|
+
x0040a30a?: string;
|
|
2350
2350
|
x0040a313?: MetaDataTypes[];
|
|
2351
2351
|
x0040a33a?: string;
|
|
2352
2352
|
x0040a340?: MetaDataTypes[];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { MetaData, RenderOptions, Series, SRNode, SRParseResult, SRStyleConfig, SRViewerData } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Check if a DICOM series is a Structured Report (SR)
|
|
4
|
+
* @param {Series} serie - The DICOM series object
|
|
5
|
+
* @return {boolean} - True if the series is an SR
|
|
6
|
+
*/
|
|
7
|
+
export declare const isSR: (serie: Series) => boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Parse DICOM SR metadata into a structured header and tree representation
|
|
10
|
+
* @param {MetaData} metadata - The DICOM SR metadata object
|
|
11
|
+
* @return {SRParseResult} - Object containing header fields and content tree
|
|
12
|
+
*/
|
|
13
|
+
export declare const parseSR: (metadata: MetaData) => SRParseResult;
|
|
14
|
+
/**
|
|
15
|
+
* This function returns pure data without creating DOM elements
|
|
16
|
+
*
|
|
17
|
+
* @param {MetaData} metadata - The DICOM SR metadata
|
|
18
|
+
* @return {SRViewerData} - Structured data for custom rendering
|
|
19
|
+
*/
|
|
20
|
+
export declare const getSRData: (metadata: MetaData) => SRViewerData;
|
|
21
|
+
/**
|
|
22
|
+
* Render a complete SR tree as an interactive DOM structure
|
|
23
|
+
* @param {SRNode[]} tree - Array of root SR nodes
|
|
24
|
+
* @param {RenderOptions} opts - Rendering options (expandDepth, etc.)
|
|
25
|
+
* @return {HTMLElement} - The rendered tree as a DOM element
|
|
26
|
+
*/
|
|
27
|
+
export declare const renderSRTree: (tree: SRNode[], opts?: RenderOptions) => HTMLElement;
|
|
28
|
+
/**
|
|
29
|
+
* @param {MetaData} metadata - The DICOM SR metadata
|
|
30
|
+
* @param {RenderOptions} opts - Rendering options
|
|
31
|
+
* @return {HTMLElement} - The complete SR viewer DOM element
|
|
32
|
+
*/
|
|
33
|
+
export declare const createSRViewer: (metadata: MetaData, opts?: RenderOptions) => HTMLElement;
|
|
34
|
+
/**
|
|
35
|
+
* Mount a complete SR viewer UI into a container element
|
|
36
|
+
* @param {MetaData} metadata - The DICOM SR metadata
|
|
37
|
+
* @param {string} containerElementId - The DOM element to mount into
|
|
38
|
+
* @param {RenderOptions} opts - Rendering options
|
|
39
|
+
*/
|
|
40
|
+
export declare const mountSRViewer: (metadata: MetaData, containerElementId: string, opts?: RenderOptions) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Inject CSS styles for the SR viewer into the document head
|
|
43
|
+
* @param {SRStyleConfig} styleConfig - Optional style configuration object
|
|
44
|
+
*/
|
|
45
|
+
export declare const injectSRStyles: (styleConfig?: SRStyleConfig) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Update existing SR styles without full re-injection
|
|
48
|
+
* @param {SRStyleConfig} styleConfig - Style configuration to apply
|
|
49
|
+
*/
|
|
50
|
+
export declare const updateSRStyles: (styleConfig: SRStyleConfig) => void;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import cornerstone from "cornerstone-core";
|
|
2
|
+
import { Coords, EventData, HandlePosition, HandleTextBox, MeasurementData } from "../types";
|
|
3
|
+
declare const BaseAnnotationTool: any;
|
|
4
|
+
interface CobbAngleHandles {
|
|
5
|
+
point0: HandlePosition;
|
|
6
|
+
point1: HandlePosition;
|
|
7
|
+
point2?: HandlePosition;
|
|
8
|
+
point3?: HandlePosition;
|
|
9
|
+
textBox: HandleTextBox;
|
|
10
|
+
}
|
|
11
|
+
type CobbAngleMeasurementData = MeasurementData & {
|
|
12
|
+
complete: boolean;
|
|
13
|
+
value?: number;
|
|
14
|
+
handles: CobbAngleHandles;
|
|
15
|
+
};
|
|
16
|
+
type DrawPhase = "idle" | "seg1Move" | "seg2Wait" | "seg2Move";
|
|
17
|
+
export default class CobbAngleTool extends BaseAnnotationTool {
|
|
18
|
+
_phase: DrawPhase;
|
|
19
|
+
constructor(props?: any);
|
|
20
|
+
createNewMeasurement(eventData: EventData): CobbAngleMeasurementData | undefined;
|
|
21
|
+
addNewMeasurement(evt: {
|
|
22
|
+
detail: EventData;
|
|
23
|
+
}, _interactionType?: string): void;
|
|
24
|
+
pointNearTool(element: HTMLElement, data: CobbAngleMeasurementData, coords: Coords, interactionType?: string): boolean;
|
|
25
|
+
distanceFromPoint(element: HTMLElement, data: CobbAngleMeasurementData, coords: Coords): number;
|
|
26
|
+
renderToolData(evt: {
|
|
27
|
+
detail: EventData;
|
|
28
|
+
}): void;
|
|
29
|
+
_activateDraw(element: HTMLElement): void;
|
|
30
|
+
_deactivateDraw(element: HTMLElement): void;
|
|
31
|
+
_onMouseMove: (evt: {
|
|
32
|
+
detail: EventData;
|
|
33
|
+
}) => void;
|
|
34
|
+
_onMouseClick: (evt: {
|
|
35
|
+
detail: EventData;
|
|
36
|
+
}) => void;
|
|
37
|
+
handleSelectedCallback(evt: {
|
|
38
|
+
detail: EventData;
|
|
39
|
+
}, data: CobbAngleMeasurementData, handle: HandlePosition, interactionType?: string): void;
|
|
40
|
+
toolSelectedCallback(evt: {
|
|
41
|
+
detail: EventData;
|
|
42
|
+
}, annotation: CobbAngleMeasurementData, interactionType?: string): void;
|
|
43
|
+
updateCachedStats(image: cornerstone.Image, element: HTMLElement, data: CobbAngleMeasurementData): void;
|
|
44
|
+
_updateStats(_image: cornerstone.Image | undefined, _element: HTMLElement, data: CobbAngleMeasurementData): void;
|
|
45
|
+
_segDistCanvas(element: HTMLElement, p1: Coords, p2: Coords, canvasCoords: Coords): number;
|
|
46
|
+
_segDistPixel(element: HTMLElement, p1: Coords, p2: Coords, pixelCoords: Coords): number;
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare const BaseAnnotationTool: any;
|
|
2
|
+
import { Coords, EventData, Handles, MeasurementData } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
* @class NorbergAngleTool
|
|
6
|
+
* @memberof Tools.Annotation
|
|
7
|
+
* @classdesc Tool for measuring distances with adjustable angle segments at both endpoints.
|
|
8
|
+
* Shows angle arcs and allows 45-degree adjustment segments.
|
|
9
|
+
* @extends Tools.Base.BaseAnnotationTool
|
|
10
|
+
*/
|
|
11
|
+
export default class NorbergAngleTool extends BaseAnnotationTool {
|
|
12
|
+
configuration: any;
|
|
13
|
+
constructor(props?: any);
|
|
14
|
+
createNewMeasurement(eventData: EventData): MeasurementData | undefined;
|
|
15
|
+
pointNearTool(element: HTMLElement, data: MeasurementData, coords: Coords): boolean;
|
|
16
|
+
activateHandleNearCursor(element: HTMLElement, handles: Handles, coords: Coords, distanceThreshold: number): void;
|
|
17
|
+
updateCachedStats(image: any, element: HTMLElement, data: MeasurementData): void;
|
|
18
|
+
drawAngleArc(context: CanvasRenderingContext2D, centerPoint: Coords, startAngleDegrees: number, endAngleDegrees: number, radius: number, color: string, counterClockwise?: boolean): void;
|
|
19
|
+
drawAngleLabel(context: CanvasRenderingContext2D, point: Coords, angle: number, labelAngle: number, distance: number, color: string): void;
|
|
20
|
+
renderToolData(evt: any): void;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { Coords, EventData, HandlePosition, MeasurementMouseEvent, TPAAnnotation, TPAMeasurementState } from "../types";
|
|
2
|
+
declare const BaseAnnotationTool: any;
|
|
3
|
+
export default class TPAAnnotationTool extends BaseAnnotationTool {
|
|
4
|
+
private currentState;
|
|
5
|
+
private currentAnnotation;
|
|
6
|
+
private isDragging;
|
|
7
|
+
constructor(props?: any);
|
|
8
|
+
createNewMeasurement(eventData: EventData): {
|
|
9
|
+
visible: boolean;
|
|
10
|
+
active: boolean;
|
|
11
|
+
color: undefined;
|
|
12
|
+
invalidated: boolean;
|
|
13
|
+
handles: {
|
|
14
|
+
ftaStart: {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
highlight: boolean;
|
|
18
|
+
active: boolean;
|
|
19
|
+
};
|
|
20
|
+
ftaEnd: {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
highlight: boolean;
|
|
24
|
+
active: boolean;
|
|
25
|
+
};
|
|
26
|
+
mtpStart: {
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
highlight: boolean;
|
|
30
|
+
active: boolean;
|
|
31
|
+
};
|
|
32
|
+
mtpEnd: {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
highlight: boolean;
|
|
36
|
+
active: boolean;
|
|
37
|
+
};
|
|
38
|
+
refStart: {
|
|
39
|
+
x: number;
|
|
40
|
+
y: number;
|
|
41
|
+
highlight: boolean;
|
|
42
|
+
active: boolean;
|
|
43
|
+
};
|
|
44
|
+
refEnd: {
|
|
45
|
+
x: number;
|
|
46
|
+
y: number;
|
|
47
|
+
highlight: boolean;
|
|
48
|
+
active: boolean;
|
|
49
|
+
};
|
|
50
|
+
intersectionPoint: {
|
|
51
|
+
x: number;
|
|
52
|
+
y: number;
|
|
53
|
+
};
|
|
54
|
+
ftaTextBox: {
|
|
55
|
+
active: boolean;
|
|
56
|
+
hasMoved: boolean;
|
|
57
|
+
movesIndependently: boolean;
|
|
58
|
+
drawnIndependently: boolean;
|
|
59
|
+
allowedOutsideImage: boolean;
|
|
60
|
+
hasBoundingBox: boolean;
|
|
61
|
+
x: number;
|
|
62
|
+
y: number;
|
|
63
|
+
};
|
|
64
|
+
mtpTextBox: {
|
|
65
|
+
active: boolean;
|
|
66
|
+
hasMoved: boolean;
|
|
67
|
+
movesIndependently: boolean;
|
|
68
|
+
drawnIndependently: boolean;
|
|
69
|
+
allowedOutsideImage: boolean;
|
|
70
|
+
hasBoundingBox: boolean;
|
|
71
|
+
x: number;
|
|
72
|
+
y: number;
|
|
73
|
+
};
|
|
74
|
+
refTextBox: {
|
|
75
|
+
active: boolean;
|
|
76
|
+
hasMoved: boolean;
|
|
77
|
+
movesIndependently: boolean;
|
|
78
|
+
drawnIndependently: boolean;
|
|
79
|
+
allowedOutsideImage: boolean;
|
|
80
|
+
hasBoundingBox: boolean;
|
|
81
|
+
x: number;
|
|
82
|
+
y: number;
|
|
83
|
+
};
|
|
84
|
+
tpaTextBox: {
|
|
85
|
+
active: boolean;
|
|
86
|
+
hasMoved: boolean;
|
|
87
|
+
movesIndependently: boolean;
|
|
88
|
+
drawnIndependently: boolean;
|
|
89
|
+
allowedOutsideImage: boolean;
|
|
90
|
+
hasBoundingBox: boolean;
|
|
91
|
+
x: number;
|
|
92
|
+
y: number;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
cachedStats: {
|
|
96
|
+
tpaAngle: number;
|
|
97
|
+
ftaLength: number;
|
|
98
|
+
mtpLength: number;
|
|
99
|
+
};
|
|
100
|
+
measurementState: TPAMeasurementState;
|
|
101
|
+
} | null;
|
|
102
|
+
addNewMeasurement(evt: MeasurementMouseEvent): TPAAnnotation | null;
|
|
103
|
+
mouseMoveCallback(evt: MeasurementMouseEvent): void;
|
|
104
|
+
mouseDragCallback(evt: MeasurementMouseEvent): void;
|
|
105
|
+
/**
|
|
106
|
+
* Extracted logic to finalize the Functional Tibial Axis (Step 1)
|
|
107
|
+
*/
|
|
108
|
+
private _finishFTA;
|
|
109
|
+
/**
|
|
110
|
+
* Extracted logic to finalize the Medial Tibial Plateau (Step 2)
|
|
111
|
+
*/
|
|
112
|
+
private _finishMTP;
|
|
113
|
+
preMouseDownCallback(evt: MeasurementMouseEvent): void;
|
|
114
|
+
mouseUpCallback(evt: MeasurementMouseEvent): void;
|
|
115
|
+
/**
|
|
116
|
+
* Computes the intersection point of the infinite MTP line with the
|
|
117
|
+
* infinite FTA line using parametric line-line intersection.
|
|
118
|
+
*
|
|
119
|
+
*/
|
|
120
|
+
computeLineLineIntersection(p1: Coords, d1: Coords, // FTA: point + direction
|
|
121
|
+
p2: Coords, d2: Coords): Coords | null;
|
|
122
|
+
computeReferenceLineAndAngle(data: any): void;
|
|
123
|
+
updateCachedStats(image: any, element: HTMLElement, data: any): any;
|
|
124
|
+
renderToolData(evt: MeasurementMouseEvent): void;
|
|
125
|
+
/**
|
|
126
|
+
* The arc sweeps from the Reference Line direction to the MTP direction
|
|
127
|
+
*/
|
|
128
|
+
drawAngleArc(context: CanvasRenderingContext2D, element: HTMLElement, handles: any, cachedStats: any, color: string): void;
|
|
129
|
+
pointNearTool(element: HTMLElement, data: any, coords: Coords, interactionType: string): boolean;
|
|
130
|
+
isPointNearHandle(element: HTMLElement, handle: HandlePosition, coords: Coords, PROXIMITY_DISTANCE: number): boolean;
|
|
131
|
+
isPointNearLine(element: HTMLElement, startHandle: HandlePosition, endHandle: HandlePosition, coords: Coords, PROXIMITY_DISTANCE: number): boolean;
|
|
132
|
+
PROXIMITY_DISTANCEToLineSegment(point: Coords, lineStart: Coords, lineEnd: Coords): number;
|
|
133
|
+
getHandleNearImagePoint(element: HTMLElement, data: any, coords: Coords, interactionType: string): any;
|
|
134
|
+
}
|
|
135
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Coords, EventData, HandlePosition, Handles, MeasurementMouseEvent, VHSAnnotationData, VHSCachedStats } from "../types";
|
|
2
|
+
declare const BaseAnnotationTool: any;
|
|
3
|
+
export default class VHSAnnotationTool extends BaseAnnotationTool {
|
|
4
|
+
private currentState;
|
|
5
|
+
private currentAnnotation;
|
|
6
|
+
private isDragging;
|
|
7
|
+
private _throttledMouseMove;
|
|
8
|
+
private _throttledMouseDrag;
|
|
9
|
+
constructor(props?: Record<string, unknown>);
|
|
10
|
+
createNewMeasurement(eventData: EventData): VHSAnnotationData | null;
|
|
11
|
+
calculateDistance(point1: Coords, point2: Coords): number;
|
|
12
|
+
addNewMeasurement(evt: MeasurementMouseEvent): VHSAnnotationData | null;
|
|
13
|
+
mouseMoveCallback(evt: MeasurementMouseEvent): void;
|
|
14
|
+
private _mouseMoveImpl;
|
|
15
|
+
mouseDragCallback(evt: MeasurementMouseEvent): void;
|
|
16
|
+
private _mouseDragImpl;
|
|
17
|
+
private _completeSegment;
|
|
18
|
+
mouseUpCallback(evt: MeasurementMouseEvent): void;
|
|
19
|
+
preMouseDownCallback(evt: MeasurementMouseEvent): void;
|
|
20
|
+
private _autoPositionTextBox;
|
|
21
|
+
renderToolData(evt: MeasurementMouseEvent): void;
|
|
22
|
+
drawProjectionVisualization(context: CanvasRenderingContext2D, element: HTMLElement, handles: Handles, label: string, color: string, offset: number, cachedStats: VHSCachedStats): void;
|
|
23
|
+
drawTick(context: CanvasRenderingContext2D, element: HTMLElement, point: Coords, angle: number, color: string): void;
|
|
24
|
+
updateCachedStats(image: unknown, element: HTMLElement, data: VHSAnnotationData): VHSCachedStats;
|
|
25
|
+
pointNearTool(element: HTMLElement, data: VHSAnnotationData, coords: Coords, interactionType: string): boolean;
|
|
26
|
+
isPointNearHandle(element: HTMLElement, handle: HandlePosition, coords: Coords, distance: number): boolean;
|
|
27
|
+
isPointNearLine(element: HTMLElement, startHandle: HandlePosition, endHandle: HandlePosition, coords: Coords, distance: number): boolean;
|
|
28
|
+
distanceToLineSegment(point: Coords, lineStart: Coords, lineEnd: Coords): number;
|
|
29
|
+
getHandleNearImagePoint(element: HTMLElement, data: VHSAnnotationData, coords: Coords, interactionType: string): HandlePosition | null;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { EnabledElement, Image } from "cornerstone-core";
|
|
2
|
+
declare const BaseTool: any;
|
|
3
|
+
import { Coords, MeasurementMouseEvent } from "../types";
|
|
4
|
+
/**
|
|
5
|
+
* @public
|
|
6
|
+
* @class GridTool
|
|
7
|
+
* @memberof Tools.Base
|
|
8
|
+
* @classdesc Tool for drawing a grid with customizable parameters on image,
|
|
9
|
+
* such as grid dimension and center position
|
|
10
|
+
* @extends Tools.Base
|
|
11
|
+
*/
|
|
12
|
+
export declare class GridTool extends BaseTool {
|
|
13
|
+
center: Coords | null;
|
|
14
|
+
constructor(props?: {});
|
|
15
|
+
/**
|
|
16
|
+
* function triggered when tool is set to active
|
|
17
|
+
*
|
|
18
|
+
* @private
|
|
19
|
+
* @param {HTMLElement} element - The viewport element to add event listeners to.
|
|
20
|
+
* @modifies {element}
|
|
21
|
+
* @returns {Promise<void>}
|
|
22
|
+
*/
|
|
23
|
+
activeCallback(element: HTMLElement): Promise<void>;
|
|
24
|
+
triggerInputGridDimensionChange(event: any): void;
|
|
25
|
+
/**
|
|
26
|
+
* function triggered when tool is set to disabled
|
|
27
|
+
*
|
|
28
|
+
* @private
|
|
29
|
+
* @param {HTMLElement} element - The viewport element to add remove listeners to.
|
|
30
|
+
* @modifies {element}
|
|
31
|
+
* @returns {void}
|
|
32
|
+
*/
|
|
33
|
+
disabledCallback(element: HTMLElement): void;
|
|
34
|
+
/**
|
|
35
|
+
* function triggered when tool is set to passive
|
|
36
|
+
*
|
|
37
|
+
* @private
|
|
38
|
+
* @param {HTMLElement} element - The viewport element to add remove listeners to.
|
|
39
|
+
* @modifies {element}
|
|
40
|
+
* @returns {void}
|
|
41
|
+
*/
|
|
42
|
+
passiveCallback(element: HTMLElement): void;
|
|
43
|
+
/**
|
|
44
|
+
* function to change center of the grid position on user click
|
|
45
|
+
*
|
|
46
|
+
* @private
|
|
47
|
+
* @param {MeasurementMouseEvent} evt - The click event
|
|
48
|
+
* @returns {void}
|
|
49
|
+
*/
|
|
50
|
+
handleMouseClick(evt: MeasurementMouseEvent): void;
|
|
51
|
+
/**
|
|
52
|
+
* @private
|
|
53
|
+
* @param {MeasurementMouseEvent} evt - The click event
|
|
54
|
+
* @returns {void}
|
|
55
|
+
*/
|
|
56
|
+
renderToolData(evt: MeasurementMouseEvent): void;
|
|
57
|
+
/**
|
|
58
|
+
* function to trigger the draw grid
|
|
59
|
+
* @private
|
|
60
|
+
* @param {EnabledElement} enabledElement
|
|
61
|
+
* @returns {void}
|
|
62
|
+
*/
|
|
63
|
+
triggerDrawGrid(enabledElement: EnabledElement): void;
|
|
64
|
+
/**
|
|
65
|
+
* function to draw the grid
|
|
66
|
+
* @private
|
|
67
|
+
* @param {CanvasRenderingContext2D} context
|
|
68
|
+
* @param {number} xCenter
|
|
69
|
+
* @param {number} yCenter
|
|
70
|
+
* @param {Coords} start
|
|
71
|
+
* @param {Coords} end
|
|
72
|
+
* @param {number} patternWidth
|
|
73
|
+
* @param {number} patternHeight
|
|
74
|
+
* @param {number} dashWidth
|
|
75
|
+
* @param {number} dashHeight
|
|
76
|
+
* @param {string} lightGray
|
|
77
|
+
* @param {string} darkGray
|
|
78
|
+
* @returns {void}
|
|
79
|
+
*/
|
|
80
|
+
drawDashedGrid(context: CanvasRenderingContext2D, xCenter: number, yCenter: number, start: Coords, end: Coords, patternWidth: number, patternHeight: number, dashWidth: number, dashHeight: number, imageDashHeight: number, imageDashWidth: number, lightGray: string, darkGray: string, image: Image, element: HTMLElement): void;
|
|
81
|
+
/**
|
|
82
|
+
* returns grid's pixelArray
|
|
83
|
+
* @private
|
|
84
|
+
* @returns {number[]}
|
|
85
|
+
*/
|
|
86
|
+
getGridPixelArray(): any;
|
|
87
|
+
}
|
|
88
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Image, CanvasCoordinate } from "cornerstone-core";
|
|
2
|
+
import { Coords } from "../../../types";
|
|
3
|
+
export type GridData = {
|
|
4
|
+
from: Coords;
|
|
5
|
+
to: Coords;
|
|
6
|
+
color: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function handleElement(element: HTMLElement): Promise<any>;
|
|
9
|
+
export declare function validatePixelSpacing(spacingX: number, spacingY: number, minPixelSpacing: number): void;
|
|
10
|
+
export declare function mmToPixels(mm: number, pixelSpacing: any): number;
|
|
11
|
+
export declare function findImageCoords(element: HTMLElement, image: Image): {
|
|
12
|
+
start: CanvasCoordinate;
|
|
13
|
+
end: CanvasCoordinate;
|
|
14
|
+
};
|
|
15
|
+
export declare function convertDimensionsToCanvas(element: HTMLElement, width: number, height: number): {
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
};
|
|
19
|
+
export declare function getColors(bitDepth: number, colorFractionLight: number, colorFractionDark: number): {
|
|
20
|
+
lightGray: string;
|
|
21
|
+
darkGray: string;
|
|
22
|
+
lightColorCode: number;
|
|
23
|
+
darkColorCode: number;
|
|
24
|
+
};
|
|
25
|
+
export declare function drawDashedLine(context: CanvasRenderingContext2D, from: Coords, to: Coords, color: string): void;
|
|
26
|
+
export declare function drawVerticalLines(context: CanvasRenderingContext2D, xCenter: number, start: Coords, end: Coords, patternWidth: number, dashWidth: number, dashHeight: number, imageDashHeight: number, imageDashWidth: number, lightGray: string, darkGray: string, gridPixelArray: number[], image: Image, element: HTMLElement): void;
|
|
27
|
+
export declare function drawHorizontalLines(context: CanvasRenderingContext2D, yCenter: number, start: Coords, end: Coords, patternHeight: number, dashWidth: number, dashHeight: number, imageDashHeight: number, imageDashWidth: number, lightGray: string, darkGray: string, gridPixelArray: number[], image: Image, element: HTMLElement): void;
|
|
@@ -385,6 +385,14 @@ export type PixelSpacing = {
|
|
|
385
385
|
colPixelSpacing: number;
|
|
386
386
|
};
|
|
387
387
|
export interface MeasurementData {
|
|
388
|
+
startSegmentAngle?: number;
|
|
389
|
+
startSegmentLength?: number;
|
|
390
|
+
endSegmentAngle?: number;
|
|
391
|
+
endSegmentLength?: number;
|
|
392
|
+
endAngleCustomized?: boolean;
|
|
393
|
+
endSegmentCustomized?: boolean;
|
|
394
|
+
startAngleCustomized?: boolean;
|
|
395
|
+
startSegmentCustomized?: boolean;
|
|
388
396
|
computeMeasurements?: boolean;
|
|
389
397
|
polyBoundingBox?: Rectangle;
|
|
390
398
|
meanStdDev?: {
|
|
@@ -458,6 +466,12 @@ export type Rectangle = {
|
|
|
458
466
|
height: number;
|
|
459
467
|
};
|
|
460
468
|
export interface Handles {
|
|
469
|
+
vertebralStart?: HandlePosition;
|
|
470
|
+
vertebralEnd?: HandlePosition;
|
|
471
|
+
longAxisEnd?: HandlePosition;
|
|
472
|
+
longAxisStart?: HandlePosition;
|
|
473
|
+
shortAxisStart?: HandlePosition;
|
|
474
|
+
shortAxisEnd?: HandlePosition;
|
|
461
475
|
start?: HandlePosition;
|
|
462
476
|
end?: HandlePosition;
|
|
463
477
|
offset?: number;
|
|
@@ -465,6 +479,8 @@ export interface Handles {
|
|
|
465
479
|
initialRotation?: number;
|
|
466
480
|
points?: HandlePosition[];
|
|
467
481
|
invalidHandlePlacement?: boolean;
|
|
482
|
+
endAngleHandle?: HandlePosition;
|
|
483
|
+
startAngleHandle?: HandlePosition;
|
|
468
484
|
}
|
|
469
485
|
export interface MeasurementMouseEvent {
|
|
470
486
|
detail: EventData;
|
|
@@ -543,4 +559,98 @@ export type ThresholdsBrushProp = {
|
|
|
543
559
|
};
|
|
544
560
|
mixins: string[];
|
|
545
561
|
};
|
|
562
|
+
export interface VHSCachedStats {
|
|
563
|
+
vertebralLength: number;
|
|
564
|
+
longAxisLength: number;
|
|
565
|
+
shortAxisLength: number;
|
|
566
|
+
longAxisProjection: number;
|
|
567
|
+
shortAxisProjection: number;
|
|
568
|
+
longAxisAngle: number;
|
|
569
|
+
shortAxisAngle: number;
|
|
570
|
+
longAxisVHS: number;
|
|
571
|
+
shortAxisVHS: number;
|
|
572
|
+
totalVHS: number;
|
|
573
|
+
}
|
|
574
|
+
export interface VHSAnnotationData {
|
|
575
|
+
visible: boolean;
|
|
576
|
+
active: boolean;
|
|
577
|
+
color: string | undefined;
|
|
578
|
+
invalidated: boolean;
|
|
579
|
+
handles: {
|
|
580
|
+
vertebralStart: HandlePosition;
|
|
581
|
+
vertebralEnd: HandlePosition;
|
|
582
|
+
longAxisStart: HandlePosition;
|
|
583
|
+
longAxisEnd: HandlePosition;
|
|
584
|
+
shortAxisStart: HandlePosition;
|
|
585
|
+
shortAxisEnd: HandlePosition;
|
|
586
|
+
vertebralTextBox: HandleTextBox;
|
|
587
|
+
longAxisTextBox: HandleTextBox;
|
|
588
|
+
shortAxisTextBox: HandleTextBox;
|
|
589
|
+
vhsTextBox: HandleTextBox;
|
|
590
|
+
};
|
|
591
|
+
cachedStats: VHSCachedStats;
|
|
592
|
+
measurementState: VHSMeasurementState;
|
|
593
|
+
}
|
|
594
|
+
export declare enum VHSMeasurementState {
|
|
595
|
+
IDLE = 0,
|
|
596
|
+
VERTEBRAL_START = 1,
|
|
597
|
+
VERTEBRAL_END = 2,
|
|
598
|
+
LONG_AXIS_START = 3,
|
|
599
|
+
LONG_AXIS_END = 4,
|
|
600
|
+
SHORT_AXIS_START = 5,
|
|
601
|
+
SHORT_AXIS_END = 6,
|
|
602
|
+
COMPLETE = 7
|
|
603
|
+
}
|
|
604
|
+
export declare enum TPAMeasurementState {
|
|
605
|
+
IDLE = 0,
|
|
606
|
+
FUNCTIONAL_AXIS_START = 1,// Dragging FTA line
|
|
607
|
+
FUNCTIONAL_AXIS_END = 2,// FTA complete, waiting for MTP start click
|
|
608
|
+
MEDIAL_PLATEAU_START = 3,// Dragging MTP line
|
|
609
|
+
MEDIAL_PLATEAU_END = 4,// MTP complete → compute REF + angle
|
|
610
|
+
COMPLETE = 5
|
|
611
|
+
}
|
|
612
|
+
export interface TPACachedStats {
|
|
613
|
+
tpaAngle: number;
|
|
614
|
+
ftaLength: number;
|
|
615
|
+
mtpLength: number;
|
|
616
|
+
mtpNx?: number;
|
|
617
|
+
mtpNy?: number;
|
|
618
|
+
perpNx?: number;
|
|
619
|
+
perpNy?: number;
|
|
620
|
+
}
|
|
621
|
+
export interface TPAAnnotation {
|
|
622
|
+
visible: boolean;
|
|
623
|
+
active: boolean;
|
|
624
|
+
color?: string;
|
|
625
|
+
invalidated: boolean;
|
|
626
|
+
measurementState: TPAMeasurementState;
|
|
627
|
+
handles: {
|
|
628
|
+
ftaStart: HandlePosition;
|
|
629
|
+
ftaEnd: HandlePosition;
|
|
630
|
+
ftaTextBox: HandleTextBox;
|
|
631
|
+
mtpStart: HandlePosition;
|
|
632
|
+
mtpEnd: HandlePosition;
|
|
633
|
+
mtpTextBox: HandleTextBox;
|
|
634
|
+
refStart: HandlePosition;
|
|
635
|
+
refEnd: HandlePosition;
|
|
636
|
+
intersectionPoint: Coords;
|
|
637
|
+
refTextBox: HandleTextBox;
|
|
638
|
+
tpaTextBox: HandleTextBox;
|
|
639
|
+
};
|
|
640
|
+
cachedStats: TPACachedStats;
|
|
641
|
+
}
|
|
642
|
+
export type GridConfig = {
|
|
643
|
+
setup: GridSettings;
|
|
644
|
+
gridPixelArray: number[];
|
|
645
|
+
};
|
|
646
|
+
export type GridSettings = {
|
|
647
|
+
minRows: number;
|
|
648
|
+
minColumns: number;
|
|
649
|
+
dashHeightMM: number;
|
|
650
|
+
dashWidthMM: number;
|
|
651
|
+
colorFractionLight: number;
|
|
652
|
+
colorFractionDark: number;
|
|
653
|
+
minPixelSpacing: number;
|
|
654
|
+
gridDimensionMM: number;
|
|
655
|
+
};
|
|
546
656
|
export {};
|