larvitar 2.0.4 → 2.0.6
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/README.md +2 -2
- package/dist/larvitar.js +5 -3
- package/dist/larvitar.js.map +1 -1
- package/package.json +6 -2
- package/.github/workflows/build-docs.yml +0 -59
- package/.github/workflows/codeql-analysis.yml +0 -71
- package/.github/workflows/deploy.yml +0 -37
- package/.vscode/settings.json +0 -4
- package/CODE_OF_CONDUCT.md +0 -76
- package/MIGRATION.md +0 -25
- package/bundler/webpack.common.js +0 -27
- package/bundler/webpack.dev.js +0 -23
- package/bundler/webpack.prod.js +0 -19
- package/decs.d.ts +0 -12
- package/imaging/MetaDataReadable.ts +0 -42
- package/imaging/MetaDataTypes.ts +0 -3491
- package/imaging/dataDictionary.json +0 -21866
- package/imaging/imageAnonymization.ts +0 -135
- package/imaging/imageColormaps.ts +0 -217
- package/imaging/imageContours.ts +0 -196
- package/imaging/imageIo.ts +0 -251
- package/imaging/imageLayers.ts +0 -121
- package/imaging/imageLoading.ts +0 -299
- package/imaging/imageParsing.ts +0 -444
- package/imaging/imagePresets.ts +0 -156
- package/imaging/imageRendering.ts +0 -1091
- package/imaging/imageReslice.ts +0 -87
- package/imaging/imageStore.ts +0 -487
- package/imaging/imageTags.ts +0 -609
- package/imaging/imageTools.js +0 -708
- package/imaging/imageUtils.ts +0 -1079
- package/imaging/loaders/commonLoader.ts +0 -275
- package/imaging/loaders/dicomLoader.ts +0 -66
- package/imaging/loaders/fileLoader.ts +0 -71
- package/imaging/loaders/multiframeLoader.ts +0 -435
- package/imaging/loaders/nrrdLoader.ts +0 -630
- package/imaging/loaders/resliceLoader.ts +0 -205
- package/imaging/monitors/memory.ts +0 -151
- package/imaging/monitors/performance.ts +0 -34
- package/imaging/parsers/ecg.ts +0 -54
- package/imaging/parsers/nrrd.js +0 -485
- package/imaging/tools/README.md +0 -27
- package/imaging/tools/custom/4dSliceScrollTool.js +0 -146
- package/imaging/tools/custom/BorderMagnifyTool.js +0 -99
- package/imaging/tools/custom/contourTool.js +0 -1884
- package/imaging/tools/custom/diameterTool.js +0 -141
- package/imaging/tools/custom/editMaskTool.js +0 -141
- package/imaging/tools/custom/ellipticalRoiOverlayTool.js +0 -534
- package/imaging/tools/custom/polygonSegmentationMixin.js +0 -245
- package/imaging/tools/custom/polylineScissorsTool.js +0 -59
- package/imaging/tools/custom/rectangleRoiOverlayTool.js +0 -564
- package/imaging/tools/custom/seedTool.js +0 -342
- package/imaging/tools/custom/setLabelMap3D.ts +0 -242
- package/imaging/tools/custom/thresholdsBrushTool.js +0 -161
- package/imaging/tools/default.ts +0 -594
- package/imaging/tools/interaction.ts +0 -266
- package/imaging/tools/io.ts +0 -229
- package/imaging/tools/main.ts +0 -424
- package/imaging/tools/segmentation.ts +0 -532
- package/imaging/tools/segmentations.md +0 -38
- package/imaging/tools/state.ts +0 -74
- package/imaging/tools/strategies/eraseFreehand.js +0 -76
- package/imaging/tools/strategies/fillFreehand.js +0 -79
- package/imaging/tools/strategies/index.js +0 -2
- package/imaging/tools/types.d.ts +0 -243
- package/imaging/types.d.ts +0 -200
- package/imaging/waveforms/ecg.ts +0 -191
- package/index.ts +0 -431
- package/jsdoc.json +0 -52
- package/rollup.config.js +0 -51
- package/template/.gitkeep +0 -0
- package/tsconfig.json +0 -102
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/** @module imaging/strategies/eraseFreehand
|
|
2
|
-
* @desc This file provides functionalities for
|
|
3
|
-
* erasing pixels
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// external libraries
|
|
7
|
-
import cornerstoneTools from "cornerstone-tools";
|
|
8
|
-
const { getBoundingBoxAroundPolygon, eraseInsideShape, eraseOutsideShape } =
|
|
9
|
-
cornerstoneTools.importInternal("util/segmentationUtils");
|
|
10
|
-
const isPointInPolygon = cornerstoneTools.importInternal(
|
|
11
|
-
"util/isPointInPolygon"
|
|
12
|
-
);
|
|
13
|
-
const getLogger = cornerstoneTools.importInternal("util/getLogger");
|
|
14
|
-
const logger = getLogger("util:segmentation:operations:eraseInsideFreehand");
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Erase all pixels labeled with the activeSegmentIndex,
|
|
18
|
-
* in the region defined by evt.operationData.points.
|
|
19
|
-
* @param {} evt The Cornerstone event.
|
|
20
|
-
* @param {} operationData An object containing the `pixelData` to
|
|
21
|
-
* modify, the `segmentIndex` and the `points` array.
|
|
22
|
-
* @returns {null}
|
|
23
|
-
*/
|
|
24
|
-
function eraseFreehand(evt, operationData, inside = true) {
|
|
25
|
-
const { points, segmentationMixinType } = operationData;
|
|
26
|
-
|
|
27
|
-
if (segmentationMixinType !== `freehandSegmentationMixin`) {
|
|
28
|
-
logger.error(
|
|
29
|
-
`eraseInsideFreehand operation requires freehandSegmentationMixin operationData, recieved ${segmentationMixinType}`
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const { image } = evt.detail;
|
|
36
|
-
const vertices = points.map(a => [a.x, a.y]);
|
|
37
|
-
const [topLeft, bottomRight] = getBoundingBoxAroundPolygon(vertices, image);
|
|
38
|
-
|
|
39
|
-
inside
|
|
40
|
-
? eraseInsideShape(
|
|
41
|
-
evt,
|
|
42
|
-
operationData,
|
|
43
|
-
point => isPointInPolygon([point.x, point.y], vertices),
|
|
44
|
-
topLeft,
|
|
45
|
-
bottomRight
|
|
46
|
-
)
|
|
47
|
-
: eraseOutsideShape(
|
|
48
|
-
evt,
|
|
49
|
-
operationData,
|
|
50
|
-
point => isPointInPolygon([point.x, point.y], vertices),
|
|
51
|
-
topLeft,
|
|
52
|
-
bottomRight
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Erase all pixels inside/outside the region defined by `operationData.points`.
|
|
58
|
-
* @param {} evt The Cornerstone event.
|
|
59
|
-
* @param {} operationData An object containing the `pixelData` to
|
|
60
|
-
* modify, the `segmentIndex` and the `points` array.
|
|
61
|
-
* @returns {null}
|
|
62
|
-
*/
|
|
63
|
-
export function eraseInsideFreehand(evt, operationData) {
|
|
64
|
-
eraseFreehand(evt, operationData, true);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Erase all pixels outside the region defined by `operationData.points`.
|
|
69
|
-
* @param {} evt The Cornerstone event.
|
|
70
|
-
* @param {} operationData An object containing the `pixelData` to
|
|
71
|
-
* modify, the `segmentIndex` and the `points` array.
|
|
72
|
-
* @returns {null}
|
|
73
|
-
*/
|
|
74
|
-
export function eraseOutsideFreehand(evt, operationData) {
|
|
75
|
-
eraseFreehand(evt, operationData, false);
|
|
76
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/** @module imaging/strategies/fillFreehand
|
|
2
|
-
* @desc This file provides functionalities for
|
|
3
|
-
* filling pixels
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// external libraries
|
|
7
|
-
import cornerstoneTools from "cornerstone-tools";
|
|
8
|
-
const { getBoundingBoxAroundPolygon, fillInsideShape, fillOutsideShape } =
|
|
9
|
-
cornerstoneTools.importInternal("util/segmentationUtils");
|
|
10
|
-
const isPointInPolygon = cornerstoneTools.importInternal(
|
|
11
|
-
"util/isPointInPolygon"
|
|
12
|
-
);
|
|
13
|
-
const getLogger = cornerstoneTools.importInternal("util/getLogger");
|
|
14
|
-
const logger = getLogger("util:segmentation:operations:fillInsideFreehand");
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Fill all pixels inside/outside the region defined by
|
|
18
|
-
* `operationData.points` with the `activeSegmentIndex` value.
|
|
19
|
-
* @param {} evt The Cornerstone event.
|
|
20
|
-
* @param {} operationData An object containing the `pixelData` to
|
|
21
|
-
* modify, the `segmentIndex` and the `points` array.
|
|
22
|
-
* @returns {null}
|
|
23
|
-
*/
|
|
24
|
-
function fillFreehand(evt, operationData, inside = true) {
|
|
25
|
-
const { points, segmentationMixinType } = operationData;
|
|
26
|
-
|
|
27
|
-
if (segmentationMixinType !== `freehandSegmentationMixin`) {
|
|
28
|
-
logger.error(
|
|
29
|
-
`eraseInsideFreehand operation requires freehandSegmentationMixin operationData, recieved ${segmentationMixinType}`
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Obtain the bounding box of the entire drawing so that
|
|
36
|
-
// we can subset our search. Outside of the bounding box,
|
|
37
|
-
// everything is outside of the polygon.
|
|
38
|
-
const { image } = evt.detail;
|
|
39
|
-
const vertices = points.map(a => [a.x, a.y]);
|
|
40
|
-
const [topLeft, bottomRight] = getBoundingBoxAroundPolygon(vertices, image);
|
|
41
|
-
|
|
42
|
-
inside
|
|
43
|
-
? fillInsideShape(
|
|
44
|
-
evt,
|
|
45
|
-
operationData,
|
|
46
|
-
point => isPointInPolygon([point.x, point.y], vertices),
|
|
47
|
-
topLeft,
|
|
48
|
-
bottomRight
|
|
49
|
-
)
|
|
50
|
-
: fillOutsideShape(
|
|
51
|
-
evt,
|
|
52
|
-
operationData,
|
|
53
|
-
point => isPointInPolygon([point.x, point.y], vertices),
|
|
54
|
-
topLeft,
|
|
55
|
-
bottomRight
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Fill all pixels inside/outside the region defined by `operationData.points`.
|
|
61
|
-
* @param {} evt The Cornerstone event.
|
|
62
|
-
* @param {} operationData An object containing the `pixelData` to
|
|
63
|
-
* modify, the `segmentIndex` and the `points` array.
|
|
64
|
-
* @returns {null}
|
|
65
|
-
*/
|
|
66
|
-
export function fillInsideFreehand(evt, operationData) {
|
|
67
|
-
fillFreehand(evt, operationData, true);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Fill all pixels outside the region defined by `operationData.points`.
|
|
72
|
-
* @param {} evt The Cornerstone event.
|
|
73
|
-
* @param {} operationData An object containing the `pixelData` to
|
|
74
|
-
* modify, the `segmentIndex` and the `points` array.
|
|
75
|
-
* @returns {null}
|
|
76
|
-
*/
|
|
77
|
-
export function fillOutsideFreehand(evt, operationData) {
|
|
78
|
-
fillFreehand(evt, operationData, false);
|
|
79
|
-
}
|
package/imaging/tools/types.d.ts
DELETED
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
type ToolOptions = {
|
|
2
|
-
mouseButtonMask?: number | number[];
|
|
3
|
-
supportedInteractionTypes?: string[];
|
|
4
|
-
loop?: boolean;
|
|
5
|
-
allowSkipping?: boolean;
|
|
6
|
-
invert?: boolean;
|
|
7
|
-
} & { [key: string]: unknown };
|
|
8
|
-
|
|
9
|
-
export type ToolConfig = {
|
|
10
|
-
name: string;
|
|
11
|
-
viewports: string | string[];
|
|
12
|
-
configuration: Object;
|
|
13
|
-
options: ToolOptions;
|
|
14
|
-
class: string;
|
|
15
|
-
sync?: string;
|
|
16
|
-
cleanable?: boolean;
|
|
17
|
-
defaultActive?: boolean;
|
|
18
|
-
shortcut?: string;
|
|
19
|
-
type?: "utils" | "annotation" | "segmentation" | "overlay";
|
|
20
|
-
description?: string;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export type ToolStyle = {
|
|
24
|
-
width: number;
|
|
25
|
-
color: string; // "#00FF00"
|
|
26
|
-
activeColor: string; // "#00FF00"
|
|
27
|
-
fillColor: string; // "#00FF00"
|
|
28
|
-
fontFamily: string; // "Arial"
|
|
29
|
-
fontSize: number;
|
|
30
|
-
backgroundColor: string; // "rgba(1,1,1,0.7)"
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export type ToolSettings = {
|
|
34
|
-
mouseEnabled: boolean;
|
|
35
|
-
touchEnabled: boolean;
|
|
36
|
-
showSVGCursors: boolean;
|
|
37
|
-
globalToolSyncEnabled: boolean;
|
|
38
|
-
autoResizeViewports: boolean;
|
|
39
|
-
lineDash: [number, number];
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export type ToolMouseKeys = {
|
|
43
|
-
debug: boolean;
|
|
44
|
-
mouse_button_left: {
|
|
45
|
-
shift: string;
|
|
46
|
-
ctrl: string;
|
|
47
|
-
default: string;
|
|
48
|
-
};
|
|
49
|
-
mouse_button_right: {
|
|
50
|
-
shift: string;
|
|
51
|
-
ctrl: string;
|
|
52
|
-
default: string;
|
|
53
|
-
};
|
|
54
|
-
keyboard_shortcuts: {
|
|
55
|
-
// alt key + letter
|
|
56
|
-
// key in the form "KEY_A"
|
|
57
|
-
[key: string]: string;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
type HanldePosition = {
|
|
62
|
-
active: boolean;
|
|
63
|
-
allowedOutsideImage?: boolean;
|
|
64
|
-
drawnIndependently?: boolean;
|
|
65
|
-
highlight: boolean;
|
|
66
|
-
index?: number;
|
|
67
|
-
locked?: boolean;
|
|
68
|
-
moving?: boolean;
|
|
69
|
-
x: number;
|
|
70
|
-
y: number;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
type HandleTextBox = {
|
|
74
|
-
active: boolean;
|
|
75
|
-
allowedOutsideImage: boolean;
|
|
76
|
-
boundingBox: { height: number; left: number; top: number; width: number };
|
|
77
|
-
drawnIndependently: boolean;
|
|
78
|
-
hasBoundingBox: boolean;
|
|
79
|
-
hasMoved: boolean;
|
|
80
|
-
highlight?: boolean;
|
|
81
|
-
index?: number;
|
|
82
|
-
movesIndependently: boolean;
|
|
83
|
-
x: number;
|
|
84
|
-
y: number;
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
type BaseToolStateData = {
|
|
88
|
-
active: boolean;
|
|
89
|
-
color: string;
|
|
90
|
-
invalidated: boolean;
|
|
91
|
-
uuid: string;
|
|
92
|
-
visible: boolean;
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
type AngleStateData = BaseToolStateData & {
|
|
96
|
-
handles: {
|
|
97
|
-
end: HanldePosition;
|
|
98
|
-
middle: HanldePosition;
|
|
99
|
-
start: HanldePosition;
|
|
100
|
-
textBox: HandleTextBox;
|
|
101
|
-
};
|
|
102
|
-
rAngle: number;
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
type ArrowAnnotateStateData = BaseToolStateData & {
|
|
106
|
-
handles: {
|
|
107
|
-
end: HanldePosition;
|
|
108
|
-
start: HanldePosition;
|
|
109
|
-
textBox: HandleTextBox;
|
|
110
|
-
};
|
|
111
|
-
text: string;
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
type BidirectionalStateData = BaseToolStateData & {
|
|
115
|
-
handles: {
|
|
116
|
-
end: HanldePosition;
|
|
117
|
-
perpendicularEnd: HanldePosition;
|
|
118
|
-
perpendicularStart: HanldePosition;
|
|
119
|
-
start: HanldePosition;
|
|
120
|
-
textBox: HandleTextBox;
|
|
121
|
-
};
|
|
122
|
-
isCreating: boolean;
|
|
123
|
-
longestDiameter: number;
|
|
124
|
-
shortestDiameter: number;
|
|
125
|
-
toolName: "Bidirectional";
|
|
126
|
-
toolType: "Bidirectional";
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
type EllipticalRoiStateData = BaseToolStateData & {
|
|
130
|
-
cachedStats: {
|
|
131
|
-
area: number;
|
|
132
|
-
count: number;
|
|
133
|
-
max: number;
|
|
134
|
-
mean: number;
|
|
135
|
-
meanStdDevSUV?: number;
|
|
136
|
-
min: number;
|
|
137
|
-
stdDev: number;
|
|
138
|
-
variance: number;
|
|
139
|
-
};
|
|
140
|
-
handles: {
|
|
141
|
-
end: HanldePosition;
|
|
142
|
-
initialRotation: number;
|
|
143
|
-
start: HanldePosition;
|
|
144
|
-
textBox: HandleTextBox;
|
|
145
|
-
};
|
|
146
|
-
unit: string;
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
type FreehandRoiStateData = ToolStateData & {
|
|
150
|
-
area: number;
|
|
151
|
-
canComplete: boolean;
|
|
152
|
-
handles: {
|
|
153
|
-
points: FreehandHandleData[];
|
|
154
|
-
textBox: any;
|
|
155
|
-
invalidHandlePlacement: boolean;
|
|
156
|
-
};
|
|
157
|
-
highlight: boolean;
|
|
158
|
-
meanStdDev: { count: number; mean: number; variance: number; stdDev: number };
|
|
159
|
-
meanStdDevSUV: undefined;
|
|
160
|
-
polyBoundingBox: { left: number; top: number; width: number; height: number };
|
|
161
|
-
unit: string;
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
type LengthStateData = BaseToolStateData & {
|
|
165
|
-
handles: {
|
|
166
|
-
end: HanldePosition;
|
|
167
|
-
start: HanldePosition;
|
|
168
|
-
textBox: HandleTextBox;
|
|
169
|
-
};
|
|
170
|
-
length: number;
|
|
171
|
-
unit: string;
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
type ProbeStateData = BaseToolStateData;
|
|
175
|
-
|
|
176
|
-
type RectangleRoiStateData = BaseToolStateData & {
|
|
177
|
-
cachedStats: {
|
|
178
|
-
area: number;
|
|
179
|
-
count: number;
|
|
180
|
-
max: number;
|
|
181
|
-
mean: number;
|
|
182
|
-
meanStdDevSUV?: number;
|
|
183
|
-
min: number;
|
|
184
|
-
perimeter: number;
|
|
185
|
-
stdDev: number;
|
|
186
|
-
variance: number;
|
|
187
|
-
};
|
|
188
|
-
handles: {
|
|
189
|
-
end: HanldePosition;
|
|
190
|
-
initialRotation: number;
|
|
191
|
-
start: HanldePosition;
|
|
192
|
-
textBox: HandleTextBox;
|
|
193
|
-
};
|
|
194
|
-
unit: string;
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
export type ToolState = {
|
|
198
|
-
[imageId: string]: {
|
|
199
|
-
Angle: AngleStateData;
|
|
200
|
-
ArrowAnnotate: ArrowAnnotateStateData;
|
|
201
|
-
Bidirectional: BidirectionalStateData;
|
|
202
|
-
EllipticalRoi: EllipticalRoiStateData;
|
|
203
|
-
FreehandRoi: FreehandRoiStateData;
|
|
204
|
-
Length: LengthStateData;
|
|
205
|
-
Probe: ProbeStateData;
|
|
206
|
-
RectangleRoi: RectangleRoiStateData;
|
|
207
|
-
};
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
export type SegmentationConfig = {
|
|
211
|
-
arrayType: number;
|
|
212
|
-
renderOutline: boolean;
|
|
213
|
-
renderFill: boolean;
|
|
214
|
-
shouldRenderInactiveLabelmaps: boolean;
|
|
215
|
-
radius: number;
|
|
216
|
-
minRadius: number;
|
|
217
|
-
maxRadius: number;
|
|
218
|
-
segmentsPerLabelmap: number;
|
|
219
|
-
fillAlpha: number;
|
|
220
|
-
fillAlphaInactive: number;
|
|
221
|
-
outlineAlpha: number;
|
|
222
|
-
outlineAlphaInactive: number;
|
|
223
|
-
outlineWidth: number;
|
|
224
|
-
storeHistory: boolean;
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
export const enum MaskVisualizations {
|
|
228
|
-
FILL,
|
|
229
|
-
CONTOUR,
|
|
230
|
-
HIDDEN
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
export type MaskProperties = {
|
|
234
|
-
color: string;
|
|
235
|
-
labelId: number;
|
|
236
|
-
opacity: number;
|
|
237
|
-
visualization: MaskVisualizations;
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
export type BrushProperties = {
|
|
241
|
-
radius: number; // px
|
|
242
|
-
thresholds: [number, number]; // [min, max] in px
|
|
243
|
-
};
|
package/imaging/types.d.ts
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import { vec2 } from "cornerstone-core";
|
|
2
|
-
import { DataSet } from "dicom-parser";
|
|
3
|
-
import { DEFAULT_VIEWPORT } from "./imageStore";
|
|
4
|
-
import { NrrdSeries } from "./loaders/nrrdLoader";
|
|
5
|
-
import { MetaDataTypes } from "./MetaDataTypes";
|
|
6
|
-
import { MetaDataReadable } from "./MetaDataReadable";
|
|
7
|
-
|
|
8
|
-
// TODO-ts: differentiate each single metadata @szanchi
|
|
9
|
-
/*export type MetadataValue =
|
|
10
|
-
| string
|
|
11
|
-
| number
|
|
12
|
-
| string[]
|
|
13
|
-
| number[]
|
|
14
|
-
| boolean
|
|
15
|
-
| null
|
|
16
|
-
| Array
|
|
17
|
-
| undefined; // null or undefined is only for nrrd*/
|
|
18
|
-
|
|
19
|
-
export type MetaData = MetaDataTypes & MetaDataReadable;
|
|
20
|
-
export interface Image extends cornerstone.Image {
|
|
21
|
-
render?: Function;
|
|
22
|
-
decodeTimeInMS?: number;
|
|
23
|
-
loadTimeInMS?: number;
|
|
24
|
-
webWorkerTimeInMS?: number;
|
|
25
|
-
metadata: MetaData;
|
|
26
|
-
data?: DataSet;
|
|
27
|
-
floatPixelData?: Float32Array;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export type Instance = {
|
|
31
|
-
metadata: MetaData;
|
|
32
|
-
pixelData?: TypedArray | null;
|
|
33
|
-
dataSet?: DataSet | null;
|
|
34
|
-
file?: File | null;
|
|
35
|
-
instanceId?: string;
|
|
36
|
-
frame?: number;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export type ReslicedInstance = {
|
|
40
|
-
metadata: MetaData;
|
|
41
|
-
instanceId?: string;
|
|
42
|
-
permuteTable?: [number, number, number];
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export type StagedProtocol = {
|
|
46
|
-
numberOfStages: number; // Number of stages
|
|
47
|
-
numberOfViews: number; // Number of views in stage
|
|
48
|
-
stageName?: string; // Name of the stage
|
|
49
|
-
stageNumber?: number; // Number of the stage
|
|
50
|
-
viewName?: string; // Name of the view
|
|
51
|
-
viewNumber?: number; // Number of the view
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export type Series = {
|
|
55
|
-
imageIds: string[];
|
|
56
|
-
instances: { [key: string]: Instance };
|
|
57
|
-
seriesDescription?: string;
|
|
58
|
-
anonymized?: boolean;
|
|
59
|
-
bytes: number;
|
|
60
|
-
seriesUID: string;
|
|
61
|
-
currentImageIdIndex: number;
|
|
62
|
-
numberOfImages?: number;
|
|
63
|
-
isMultiframe: boolean;
|
|
64
|
-
color?: boolean;
|
|
65
|
-
dataSet: DataSet | null;
|
|
66
|
-
metadata?: MetaData;
|
|
67
|
-
frameDelay?: number;
|
|
68
|
-
frameTime?: number;
|
|
69
|
-
rWaveTimeVector?: number[];
|
|
70
|
-
instanceUIDs: { [key: string]: string };
|
|
71
|
-
is4D: boolean;
|
|
72
|
-
waveform: boolean;
|
|
73
|
-
ecgData?: number[];
|
|
74
|
-
traceData?: Partial<Plotly.PlotData>[];
|
|
75
|
-
isPDF: boolean;
|
|
76
|
-
stagedProtocol?: StagedProtocol;
|
|
77
|
-
modality: string;
|
|
78
|
-
numberOfFrames: number;
|
|
79
|
-
numberOfSlices: number;
|
|
80
|
-
numberOfTemporalPositions: number;
|
|
81
|
-
studyUID: string;
|
|
82
|
-
larvitarSeriesInstanceUID: string;
|
|
83
|
-
elements?: { [key: string]: any } | null;
|
|
84
|
-
layer: Layer;
|
|
85
|
-
orientation?: "axial" | "coronal" | "sagittal"; // this is needed for legacy reslice
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export interface Layer extends cornerstone.EnabledElementLayer {
|
|
89
|
-
id: string;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export interface Viewport extends cornerstone.Viewport {
|
|
93
|
-
newImageIdIndex: number;
|
|
94
|
-
displayedArea: {
|
|
95
|
-
brhc: {
|
|
96
|
-
x: number;
|
|
97
|
-
y: number;
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export type Contours = {
|
|
103
|
-
[key: string]: {
|
|
104
|
-
[key: string]: Array<{
|
|
105
|
-
x?: number;
|
|
106
|
-
y?: number;
|
|
107
|
-
lines: vec2[][];
|
|
108
|
-
}>;
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
export type Header = {
|
|
113
|
-
volume: Volume;
|
|
114
|
-
[imageId: string]: Instance.metadata;
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
export type Volume = {
|
|
118
|
-
imageIds: string[];
|
|
119
|
-
seriesId: string;
|
|
120
|
-
rows: number;
|
|
121
|
-
cols: number;
|
|
122
|
-
slope: number;
|
|
123
|
-
repr: string;
|
|
124
|
-
intercept: number;
|
|
125
|
-
imagePosition: [number, number];
|
|
126
|
-
numberOfSlices: number;
|
|
127
|
-
imageOrientation: [number, number, number];
|
|
128
|
-
pixelSpacing: [number, number];
|
|
129
|
-
sliceThickness: number;
|
|
130
|
-
phase?: string;
|
|
131
|
-
study_description?: string;
|
|
132
|
-
series_description?: string;
|
|
133
|
-
acquisition_date?: string;
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
export type LarvitarManager = {
|
|
137
|
-
[key: string]: NrrdSeries | Series;
|
|
138
|
-
} | null;
|
|
139
|
-
|
|
140
|
-
export type ImageFrame = {
|
|
141
|
-
pixelData?: Uint8ClampedArray | Uint16Array | Int16Array | Uint8Array;
|
|
142
|
-
bitsAllocated: number;
|
|
143
|
-
rows: number;
|
|
144
|
-
columns: number;
|
|
145
|
-
photometricInterpretation: string;
|
|
146
|
-
samplesPerPixel: number;
|
|
147
|
-
smallestPixelValue: number;
|
|
148
|
-
largestPixelValue: number;
|
|
149
|
-
imageData?: ImageData;
|
|
150
|
-
pixelRepresentation: number;
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
export type ImageTracker = {
|
|
154
|
-
[key: string]: string;
|
|
155
|
-
} | null;
|
|
156
|
-
|
|
157
|
-
// the result of readFile
|
|
158
|
-
export type ImageObject = {
|
|
159
|
-
file: File;
|
|
160
|
-
instanceUID: string;
|
|
161
|
-
metadata: MetaData;
|
|
162
|
-
dataSet: DataSet;
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
export type CachingResponse = {
|
|
166
|
-
seriesId: string;
|
|
167
|
-
loading: number;
|
|
168
|
-
series: Partial<Series>;
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
export interface CustomDataSet extends DataSet {
|
|
172
|
-
repr?: string;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
type Orientation = "axial" | "coronal" | "sagittal";
|
|
176
|
-
|
|
177
|
-
type TypedArray =
|
|
178
|
-
| Float64Array
|
|
179
|
-
| Uint8Array
|
|
180
|
-
| Int8Array
|
|
181
|
-
| Uint16Array
|
|
182
|
-
| Int16Array
|
|
183
|
-
| Int32Array
|
|
184
|
-
| Uint32Array
|
|
185
|
-
| Float32Array;
|
|
186
|
-
|
|
187
|
-
type StoreViewport = typeof DEFAULT_VIEWPORT;
|
|
188
|
-
|
|
189
|
-
type StoreViewportOptions = {
|
|
190
|
-
numberOfSlices?: number;
|
|
191
|
-
sliceNumber?: number;
|
|
192
|
-
wc?: number;
|
|
193
|
-
ww?: number;
|
|
194
|
-
defaultWC?: number;
|
|
195
|
-
defaultWW?: number;
|
|
196
|
-
scale?: number;
|
|
197
|
-
colormap?: string;
|
|
198
|
-
tr_x?: number;
|
|
199
|
-
tr_y?: number;
|
|
200
|
-
};
|