larvitar 1.5.13 → 2.0.0
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/.vscode/settings.json +4 -0
- package/README.md +78 -48
- package/bundler/webpack.common.js +27 -0
- package/bundler/webpack.dev.js +23 -0
- package/bundler/webpack.prod.js +19 -0
- package/decs.d.ts +12 -0
- package/dist/imaging/MetaDataReadable.d.ts +39 -0
- package/dist/imaging/MetaDataTypes.d.ts +3488 -0
- package/dist/imaging/imageAnonymization.d.ts +12 -0
- package/dist/imaging/imageColormaps.d.ts +47 -0
- package/dist/imaging/imageContours.d.ts +18 -0
- package/dist/imaging/imageIo.d.ts +42 -0
- package/dist/imaging/imageLayers.d.ts +56 -0
- package/dist/imaging/imageLoading.d.ts +65 -0
- package/dist/imaging/imageParsing.d.ts +46 -0
- package/dist/imaging/imagePresets.d.ts +43 -0
- package/dist/imaging/imageRendering.d.ts +238 -0
- package/dist/imaging/imageReslice.d.ts +14 -0
- package/dist/imaging/imageStore.d.ts +121 -0
- package/dist/imaging/imageTags.d.ts +22 -0
- package/dist/imaging/imageTools.d.ts +20 -0
- package/dist/imaging/imageUtils.d.ts +165 -0
- package/dist/imaging/loaders/commonLoader.d.ts +103 -0
- package/dist/imaging/loaders/dicomLoader.d.ts +29 -0
- package/dist/imaging/loaders/fileLoader.d.ts +33 -0
- package/dist/imaging/loaders/multiframeLoader.d.ts +37 -0
- package/dist/imaging/loaders/nrrdLoader.d.ts +112 -0
- package/dist/imaging/loaders/resliceLoader.d.ts +15 -0
- package/dist/imaging/monitors/memory.d.ts +41 -0
- package/dist/imaging/monitors/performance.d.ts +23 -0
- package/dist/imaging/parsers/ecg.d.ts +15 -0
- package/dist/imaging/parsers/nrrd.d.ts +3 -0
- package/dist/imaging/tools/custom/4dSliceScrollTool.d.ts +12 -0
- package/dist/imaging/tools/custom/contourTool.d.ts +409 -0
- package/dist/imaging/tools/custom/diameterTool.d.ts +18 -0
- package/dist/imaging/tools/custom/editMaskTool.d.ts +22 -0
- package/dist/imaging/tools/custom/ellipticalRoiOverlayTool.d.ts +45 -0
- package/dist/imaging/tools/custom/polygonSegmentationMixin.d.ts +54 -0
- package/dist/imaging/tools/custom/polylineScissorsTool.d.ts +11 -0
- package/dist/imaging/tools/custom/rectangleRoiOverlayTool.d.ts +45 -0
- package/dist/imaging/tools/custom/seedTool.d.ts +0 -0
- package/dist/imaging/tools/custom/setLabelMap3D.d.ts +39 -0
- package/dist/imaging/tools/custom/thresholdsBrushTool.d.ts +19 -0
- package/dist/imaging/tools/default.d.ts +53 -0
- package/dist/imaging/tools/interaction.d.ts +30 -0
- package/dist/imaging/tools/io.d.ts +38 -0
- package/dist/imaging/tools/main.d.ts +81 -0
- package/dist/imaging/tools/segmentation.d.ts +125 -0
- package/dist/imaging/tools/state.d.ts +17 -0
- package/dist/imaging/tools/strategies/eraseFreehand.d.ts +16 -0
- package/dist/imaging/tools/strategies/fillFreehand.d.ts +16 -0
- package/dist/imaging/tools/strategies/index.d.ts +2 -0
- package/dist/index.d.ts +34 -0
- package/dist/larvitar.js +89801 -0
- package/dist/larvitar.js.map +1 -0
- package/imaging/MetaDataReadable.ts +40 -0
- package/imaging/MetaDataTypes.ts +3490 -0
- package/imaging/dataDictionary.json +5328 -5328
- package/imaging/{imageAnonymization.js → imageAnonymization.ts} +41 -13
- package/imaging/{imageColormaps.js → imageColormaps.ts} +48 -30
- package/imaging/{imageContours.js → imageContours.ts} +24 -22
- package/imaging/{imageIo.js → imageIo.ts} +89 -52
- package/imaging/{imageLayers.js → imageLayers.ts} +31 -14
- package/imaging/{imageLoading.js → imageLoading.ts} +108 -45
- package/imaging/{imageParsing.js → imageParsing.ts} +158 -80
- package/imaging/{imagePresets.js → imagePresets.ts} +44 -11
- package/imaging/imageRendering.ts +1091 -0
- package/imaging/{imageReslice.js → imageReslice.ts} +18 -9
- package/imaging/imageStore.ts +487 -0
- package/imaging/imageTags.ts +609 -0
- package/imaging/imageTools.js +2 -1
- package/imaging/{imageUtils.js → imageUtils.ts} +211 -701
- package/imaging/loaders/{commonLoader.js → commonLoader.ts} +73 -24
- package/imaging/loaders/{dicomLoader.js → dicomLoader.ts} +25 -5
- package/imaging/loaders/{fileLoader.js → fileLoader.ts} +5 -5
- package/imaging/loaders/{multiframeLoader.js → multiframeLoader.ts} +145 -90
- package/imaging/loaders/{nrrdLoader.js → nrrdLoader.ts} +230 -64
- package/imaging/loaders/{resliceLoader.js → resliceLoader.ts} +51 -20
- package/imaging/monitors/{memory.js → memory.ts} +54 -8
- package/imaging/monitors/performance.ts +34 -0
- package/imaging/parsers/ecg.ts +51 -0
- package/imaging/tools/README.md +27 -0
- package/imaging/tools/custom/4dSliceScrollTool.js +47 -46
- package/imaging/tools/custom/ellipticalRoiOverlayTool.js +534 -0
- package/imaging/tools/custom/polylineScissorsTool.js +1 -1
- package/imaging/tools/custom/rectangleRoiOverlayTool.js +564 -0
- package/imaging/tools/{setLabelMap3D.js → custom/setLabelMap3D.ts} +19 -25
- package/imaging/tools/{default.js → default.ts} +114 -30
- package/imaging/tools/{interaction.js → interaction.ts} +42 -23
- package/imaging/tools/{io.js → io.ts} +47 -31
- package/imaging/tools/{main.js → main.ts} +105 -40
- package/imaging/tools/{segmentation.js → segmentation.ts} +95 -68
- package/imaging/tools/{state.js → state.ts} +7 -12
- package/imaging/tools/types.d.ts +243 -0
- package/imaging/types.d.ts +197 -0
- package/{index.js → index.ts} +43 -14
- package/jsdoc.json +1 -1
- package/package.json +32 -14
- package/tsconfig.json +102 -0
- package/imaging/imageRendering.js +0 -860
- package/imaging/imageStore.js +0 -322
- package/modules/vuex/larvitar.js +0 -187
- /package/imaging/tools/{polygonSegmentationMixin.js → custom/polygonSegmentationMixin.js} +0 -0
|
@@ -0,0 +1,197 @@
|
|
|
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
|
+
isPDF: boolean;
|
|
73
|
+
stagedProtocol?: StagedProtocol;
|
|
74
|
+
modality: string;
|
|
75
|
+
numberOfFrames: number;
|
|
76
|
+
numberOfSlices: number;
|
|
77
|
+
numberOfTemporalPositions: number;
|
|
78
|
+
studyUID: string;
|
|
79
|
+
larvitarSeriesInstanceUID: string;
|
|
80
|
+
elements?: { [key: string]: any } | null;
|
|
81
|
+
layer: Layer;
|
|
82
|
+
orientation?: "axial" | "coronal" | "sagittal"; // this is needed for legacy reslice
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export interface Layer extends cornerstone.EnabledElementLayer {
|
|
86
|
+
id: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface Viewport extends cornerstone.Viewport {
|
|
90
|
+
newImageIdIndex: number;
|
|
91
|
+
displayedArea: {
|
|
92
|
+
brhc: {
|
|
93
|
+
x: number;
|
|
94
|
+
y: number;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export type Contours = {
|
|
100
|
+
[key: string]: {
|
|
101
|
+
[key: string]: Array<{
|
|
102
|
+
x?: number;
|
|
103
|
+
y?: number;
|
|
104
|
+
lines: vec2[][];
|
|
105
|
+
}>;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export type Header = {
|
|
110
|
+
volume: Volume;
|
|
111
|
+
[imageId: string]: Instance.metadata;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export type Volume = {
|
|
115
|
+
imageIds: string[];
|
|
116
|
+
seriesId: string;
|
|
117
|
+
rows: number;
|
|
118
|
+
cols: number;
|
|
119
|
+
slope: number;
|
|
120
|
+
repr: string;
|
|
121
|
+
intercept: number;
|
|
122
|
+
imagePosition: [number, number];
|
|
123
|
+
numberOfSlices: number;
|
|
124
|
+
imageOrientation: [number, number, number];
|
|
125
|
+
pixelSpacing: [number, number];
|
|
126
|
+
sliceThickness: number;
|
|
127
|
+
phase?: string;
|
|
128
|
+
study_description?: string;
|
|
129
|
+
series_description?: string;
|
|
130
|
+
acquisition_date?: string;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export type LarvitarManager = {
|
|
134
|
+
[key: string]: NrrdSeries | Series;
|
|
135
|
+
} | null;
|
|
136
|
+
|
|
137
|
+
export type ImageFrame = {
|
|
138
|
+
pixelData?: Uint8ClampedArray | Uint16Array | Int16Array | Uint8Array;
|
|
139
|
+
bitsAllocated: number;
|
|
140
|
+
rows: number;
|
|
141
|
+
columns: number;
|
|
142
|
+
photometricInterpretation: string;
|
|
143
|
+
samplesPerPixel: number;
|
|
144
|
+
smallestPixelValue: number;
|
|
145
|
+
largestPixelValue: number;
|
|
146
|
+
imageData?: ImageData;
|
|
147
|
+
pixelRepresentation: number;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export type ImageTracker = {
|
|
151
|
+
[key: string]: string;
|
|
152
|
+
} | null;
|
|
153
|
+
|
|
154
|
+
// the result of readFile
|
|
155
|
+
export type ImageObject = {
|
|
156
|
+
file: File;
|
|
157
|
+
instanceUID: string;
|
|
158
|
+
metadata: MetaData;
|
|
159
|
+
dataSet: DataSet;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
export type CachingResponse = {
|
|
163
|
+
seriesId: string;
|
|
164
|
+
loading: number;
|
|
165
|
+
series: Partial<Series>;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export interface CustomDataSet extends DataSet {
|
|
169
|
+
repr?: string;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
type Orientation = "axial" | "coronal" | "sagittal";
|
|
173
|
+
|
|
174
|
+
type TypedArray =
|
|
175
|
+
| Float64Array
|
|
176
|
+
| Uint8Array
|
|
177
|
+
| Int8Array
|
|
178
|
+
| Uint16Array
|
|
179
|
+
| Int16Array
|
|
180
|
+
| Int32Array
|
|
181
|
+
| Uint32Array
|
|
182
|
+
| Float32Array;
|
|
183
|
+
|
|
184
|
+
type StoreViewport = typeof DEFAULT_VIEWPORT;
|
|
185
|
+
|
|
186
|
+
type StoreViewportOptions = {
|
|
187
|
+
numberOfSlices?: number;
|
|
188
|
+
sliceNumber?: number;
|
|
189
|
+
wc?: number;
|
|
190
|
+
ww?: number;
|
|
191
|
+
defaultWC?: number;
|
|
192
|
+
defaultWW?: number;
|
|
193
|
+
scale?: number;
|
|
194
|
+
colormap?: string;
|
|
195
|
+
tr_x?: number;
|
|
196
|
+
tr_y?: number;
|
|
197
|
+
};
|
package/{index.js → index.ts}
RENAMED
|
@@ -1,24 +1,39 @@
|
|
|
1
1
|
import pkg from "./package.json";
|
|
2
|
-
const VERSION = pkg.version;
|
|
3
|
-
console.
|
|
2
|
+
const VERSION: string = pkg.version;
|
|
3
|
+
console.groupCollapsed(
|
|
4
|
+
`%cLARVITAR %cv${VERSION}`,
|
|
5
|
+
"color: #404888; background: #209A71; font-weight: 900;",
|
|
6
|
+
"color: #BED730; background: #209A71; font-weight: 900;"
|
|
7
|
+
);
|
|
4
8
|
|
|
5
9
|
import cornerstone from "cornerstone-core";
|
|
6
10
|
import cornerstoneTools from "cornerstone-tools";
|
|
11
|
+
import { parseDicom } from "dicom-parser";
|
|
12
|
+
|
|
7
13
|
import { default as cornerstoneDICOMImageLoader } from "cornerstone-wado-image-loader";
|
|
8
14
|
const segModule = cornerstoneTools.getModule("segmentation");
|
|
9
15
|
|
|
10
|
-
import larvitarModule from "./modules/vuex/larvitar";
|
|
11
|
-
|
|
12
16
|
import {
|
|
17
|
+
checkAndClearMemory,
|
|
13
18
|
checkMemoryAllocation,
|
|
14
19
|
getUsedMemory,
|
|
15
20
|
getAvailableMemory
|
|
16
21
|
} from "./imaging/monitors/memory";
|
|
17
22
|
|
|
18
|
-
import {
|
|
23
|
+
import {
|
|
24
|
+
getPerformanceMonitor,
|
|
25
|
+
activatePerformanceMonitor,
|
|
26
|
+
deactivatePerformanceMonitor
|
|
27
|
+
} from "./imaging/monitors/performance";
|
|
28
|
+
|
|
29
|
+
import store from "./imaging/imageStore";
|
|
30
|
+
console.log(store);
|
|
31
|
+
console.groupEnd();
|
|
19
32
|
|
|
20
33
|
import { parseContours } from "./imaging/imageContours";
|
|
21
34
|
|
|
35
|
+
import { parseECG } from "./imaging/parsers/ecg";
|
|
36
|
+
|
|
22
37
|
import {
|
|
23
38
|
getImagePresets,
|
|
24
39
|
setImagePreset,
|
|
@@ -31,7 +46,6 @@ import {
|
|
|
31
46
|
getMaxPixelValue,
|
|
32
47
|
getPixelRepresentation,
|
|
33
48
|
getTypedArrayFromDataType,
|
|
34
|
-
getPixelTypedArray,
|
|
35
49
|
getSortedStack,
|
|
36
50
|
randomId,
|
|
37
51
|
getMeanValue,
|
|
@@ -133,8 +147,10 @@ import {
|
|
|
133
147
|
|
|
134
148
|
import {
|
|
135
149
|
DEFAULT_TOOLS,
|
|
150
|
+
dvTools,
|
|
136
151
|
getDefaultToolsByType,
|
|
137
|
-
setDefaultToolsProps
|
|
152
|
+
setDefaultToolsProps,
|
|
153
|
+
registerExternalTool
|
|
138
154
|
} from "./imaging/tools/default";
|
|
139
155
|
|
|
140
156
|
import {
|
|
@@ -164,7 +180,8 @@ import {
|
|
|
164
180
|
resetLarvitarManager,
|
|
165
181
|
removeSeriesFromLarvitarManager,
|
|
166
182
|
getSeriesDataFromLarvitarManager,
|
|
167
|
-
getImageFrame
|
|
183
|
+
getImageFrame,
|
|
184
|
+
getSopInstanceUIDFromLarvitarManager
|
|
168
185
|
} from "./imaging/loaders/commonLoader";
|
|
169
186
|
|
|
170
187
|
import {
|
|
@@ -176,7 +193,11 @@ import {
|
|
|
176
193
|
getNrrdSerieDimensions
|
|
177
194
|
} from "./imaging/loaders/nrrdLoader";
|
|
178
195
|
|
|
179
|
-
import {
|
|
196
|
+
import {
|
|
197
|
+
getDicomImageId,
|
|
198
|
+
cacheImage,
|
|
199
|
+
cacheImages
|
|
200
|
+
} from "./imaging/loaders/dicomLoader";
|
|
180
201
|
|
|
181
202
|
import { loadReslicedImage } from "./imaging/loaders/resliceLoader";
|
|
182
203
|
|
|
@@ -216,17 +237,22 @@ export {
|
|
|
216
237
|
// global cornerstone variables
|
|
217
238
|
cornerstone,
|
|
218
239
|
cornerstoneTools,
|
|
240
|
+
parseDicom,
|
|
219
241
|
segModule,
|
|
220
242
|
cornerstoneDICOMImageLoader,
|
|
221
|
-
// vuex module
|
|
222
|
-
larvitarModule,
|
|
223
243
|
// memory module
|
|
244
|
+
checkAndClearMemory,
|
|
224
245
|
checkMemoryAllocation,
|
|
225
246
|
getUsedMemory,
|
|
226
247
|
getAvailableMemory,
|
|
248
|
+
// performance module
|
|
249
|
+
getPerformanceMonitor,
|
|
250
|
+
activatePerformanceMonitor,
|
|
251
|
+
deactivatePerformanceMonitor,
|
|
227
252
|
// larvitarStore
|
|
228
|
-
|
|
229
|
-
|
|
253
|
+
store,
|
|
254
|
+
// parsers
|
|
255
|
+
parseECG,
|
|
230
256
|
// imagePresets
|
|
231
257
|
getImagePresets,
|
|
232
258
|
setImagePreset,
|
|
@@ -237,7 +263,6 @@ export {
|
|
|
237
263
|
getMaxPixelValue,
|
|
238
264
|
getPixelRepresentation,
|
|
239
265
|
getTypedArrayFromDataType,
|
|
240
|
-
getPixelTypedArray,
|
|
241
266
|
getSortedStack,
|
|
242
267
|
randomId,
|
|
243
268
|
getMeanValue,
|
|
@@ -310,6 +335,7 @@ export {
|
|
|
310
335
|
removeSeriesFromLarvitarManager,
|
|
311
336
|
getSeriesDataFromLarvitarManager,
|
|
312
337
|
getImageFrame,
|
|
338
|
+
getSopInstanceUIDFromLarvitarManager,
|
|
313
339
|
// loaders/nrrdLoader
|
|
314
340
|
buildNrrdImage,
|
|
315
341
|
getNrrdImageId,
|
|
@@ -321,6 +347,7 @@ export {
|
|
|
321
347
|
loadReslicedImage,
|
|
322
348
|
// loaders/dicomLoader
|
|
323
349
|
getDicomImageId,
|
|
350
|
+
cacheImage,
|
|
324
351
|
cacheImages,
|
|
325
352
|
// loaders/multiframeLoader
|
|
326
353
|
loadMultiFrameImage,
|
|
@@ -364,8 +391,10 @@ export {
|
|
|
364
391
|
exportAnnotations,
|
|
365
392
|
// tools/default
|
|
366
393
|
DEFAULT_TOOLS,
|
|
394
|
+
dvTools,
|
|
367
395
|
getDefaultToolsByType,
|
|
368
396
|
setDefaultToolsProps,
|
|
397
|
+
registerExternalTool,
|
|
369
398
|
// tools/io
|
|
370
399
|
saveAnnotations,
|
|
371
400
|
loadAnnotations,
|
package/jsdoc.json
CHANGED
package/package.json
CHANGED
|
@@ -6,22 +6,26 @@
|
|
|
6
6
|
"medical",
|
|
7
7
|
"cornerstone"
|
|
8
8
|
],
|
|
9
|
-
"version": "
|
|
10
|
-
"description": "
|
|
9
|
+
"version": "2.0.0",
|
|
10
|
+
"description": "typescript library for parsing, loading, rendering and interacting with DICOM images",
|
|
11
11
|
"repository": {
|
|
12
12
|
"url": "https://github.com/dvisionlab/Larvitar.git",
|
|
13
13
|
"type": "git"
|
|
14
14
|
},
|
|
15
|
+
"main": "index.ts",
|
|
15
16
|
"scripts": {
|
|
17
|
+
"coverage": "typescript-coverage-report",
|
|
16
18
|
"generate-docs": "node_modules/.bin/jsdoc -c jsdoc.json",
|
|
17
|
-
"build
|
|
18
|
-
"dev
|
|
19
|
+
"build": "webpack --config ./bundler/webpack.prod.js && cp ./dist/larvitar.js ./docs/examples/larvitar.js",
|
|
20
|
+
"dev": "webpack --progress --config ./bundler/webpack.dev.js && cp ./dist/larvitar.js ./docs/examples/larvitar.js",
|
|
21
|
+
"dev-wip": "webpack serve --config ./bundler/webpack.dev-wip.js"
|
|
19
22
|
},
|
|
20
23
|
"author": "Simone Manini <simone.manini@dvisionlab.com> (https://www.dvisionlab.com)",
|
|
21
24
|
"contributors": [
|
|
22
25
|
"Mattia Ronzoni <mattia.ronzoni@dvisionlab.com> (https://www.dvisionlab.com)",
|
|
23
26
|
"Sara Zanchi <sara.zanchi@dvisionlab.com> (https://www.dvisionlab.com)",
|
|
24
|
-
"Ale Re <ale.re@dvisionlab.com> (https://www.dvisionlab.com)"
|
|
27
|
+
"Ale Re <ale.re@dvisionlab.com> (https://www.dvisionlab.com)",
|
|
28
|
+
"Laura Borghesi Re <laura.borghesi@dvisionlab.com> (https://www.dvisionlab.com)"
|
|
25
29
|
],
|
|
26
30
|
"license": "MIT",
|
|
27
31
|
"dependencies": {
|
|
@@ -36,6 +40,7 @@
|
|
|
36
40
|
"dicom-parser": "^1.8.13",
|
|
37
41
|
"docdash": "^1.2.0",
|
|
38
42
|
"hammerjs": "^2.0.8",
|
|
43
|
+
"jpeg-lossless-decoder-js": "^2.0.7",
|
|
39
44
|
"keycode-js": "^3.1.0",
|
|
40
45
|
"lodash": "^4.17.15",
|
|
41
46
|
"pako": "^1.0.10",
|
|
@@ -43,15 +48,28 @@
|
|
|
43
48
|
"uuid": "^8.3.2"
|
|
44
49
|
},
|
|
45
50
|
"devDependencies": {
|
|
46
|
-
"@
|
|
47
|
-
"@
|
|
51
|
+
"@babel/core": "^7.21.8",
|
|
52
|
+
"@types/cornerstone-core": "^2.3.0",
|
|
53
|
+
"@types/crypto-js": "^4.1.1",
|
|
54
|
+
"@types/hammerjs": "^2.0.41",
|
|
55
|
+
"@types/lodash": "^4.14.192",
|
|
56
|
+
"@types/papaparse": "^5.3.7",
|
|
57
|
+
"@types/uuid": "^9.0.1",
|
|
58
|
+
"babel-loader": "^9.1.2",
|
|
59
|
+
"clean-webpack-plugin": "^4.0.0",
|
|
60
|
+
"copy-webpack-plugin": "^11.0.0",
|
|
48
61
|
"fs": "^0.0.1-security",
|
|
62
|
+
"html-loader": "^4.2.0",
|
|
63
|
+
"html-webpack-plugin": "^5.5.0",
|
|
64
|
+
"ip": "^1.1.8",
|
|
49
65
|
"jsdoc": "^3.6.4",
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
66
|
+
"portfinder-sync": "^0.0.2",
|
|
67
|
+
"ts-loader": "^9.4.2",
|
|
68
|
+
"typescript": "^5.0.2",
|
|
69
|
+
"typescript-coverage-report": "^0.7.0",
|
|
70
|
+
"webpack": "^5.76.3",
|
|
71
|
+
"webpack-bundle-analyzer": "^4.8.0",
|
|
72
|
+
"webpack-cli": "^5.0.1",
|
|
73
|
+
"webpack-dev-server": "^4.13.1"
|
|
74
|
+
}
|
|
57
75
|
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
|
4
|
+
|
|
5
|
+
/* Projects */
|
|
6
|
+
// "incremental": true, /* Enable incremental compilation */
|
|
7
|
+
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
8
|
+
// "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */
|
|
9
|
+
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */
|
|
10
|
+
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
11
|
+
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
12
|
+
|
|
13
|
+
/* Language and Environment */
|
|
14
|
+
"target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
|
15
|
+
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
16
|
+
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
|
17
|
+
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
|
18
|
+
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
19
|
+
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */
|
|
20
|
+
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
21
|
+
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */
|
|
22
|
+
// "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */
|
|
23
|
+
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
24
|
+
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
25
|
+
|
|
26
|
+
/* Modules */
|
|
27
|
+
"module": "commonjs" /* Specify what module code is generated. */,
|
|
28
|
+
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
29
|
+
// "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
30
|
+
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
31
|
+
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
32
|
+
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
33
|
+
// "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
|
|
34
|
+
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
35
|
+
"allowUmdGlobalAccess": true /* Allow accessing UMD globals from modules. */,
|
|
36
|
+
"resolveJsonModule": true /* Enable importing .json files */,
|
|
37
|
+
// "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
|
|
38
|
+
|
|
39
|
+
/* JavaScript Support */
|
|
40
|
+
"allowJs": true /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */,
|
|
41
|
+
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
42
|
+
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
|
|
43
|
+
|
|
44
|
+
/* Emit */
|
|
45
|
+
"declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
|
|
46
|
+
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
47
|
+
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
48
|
+
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
49
|
+
// "outFile": "larvitar.ts" /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */,
|
|
50
|
+
"outDir": "./dist" /* Specify an output folder for all emitted files. */,
|
|
51
|
+
// "removeComments": true, /* Disable emitting comments. */
|
|
52
|
+
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
53
|
+
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
54
|
+
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
|
|
55
|
+
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
56
|
+
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
57
|
+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
58
|
+
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
59
|
+
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
60
|
+
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
61
|
+
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
|
62
|
+
// "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */
|
|
63
|
+
// "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */
|
|
64
|
+
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
65
|
+
// "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */
|
|
66
|
+
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
67
|
+
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
|
68
|
+
|
|
69
|
+
/* Interop Constraints */
|
|
70
|
+
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
71
|
+
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
72
|
+
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */,
|
|
73
|
+
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
74
|
+
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
|
|
75
|
+
|
|
76
|
+
/* Type Checking */
|
|
77
|
+
"strict": true /* Enable all strict type-checking options. */,
|
|
78
|
+
// "noImplicitAny": false /* Enable error reporting for expressions and declarations with an implied `any` type.. */,
|
|
79
|
+
// "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */
|
|
80
|
+
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
81
|
+
// "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */
|
|
82
|
+
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
83
|
+
// "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */
|
|
84
|
+
// "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */
|
|
85
|
+
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
86
|
+
// "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */
|
|
87
|
+
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
|
|
88
|
+
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
89
|
+
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
90
|
+
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
91
|
+
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
|
|
92
|
+
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
93
|
+
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */
|
|
94
|
+
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
95
|
+
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
96
|
+
|
|
97
|
+
/* Completeness */
|
|
98
|
+
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
99
|
+
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
100
|
+
},
|
|
101
|
+
"include": ["./imaging/", "./decs.d.ts"]
|
|
102
|
+
}
|