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,275 +0,0 @@
|
|
|
1
|
-
/** @module loaders/commonLoader
|
|
2
|
-
* @desc This file provides functionalities for
|
|
3
|
-
* custom DICOMImageLoaders
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// external libraries
|
|
7
|
-
import { default as cornerstoneDICOMImageLoader } from "cornerstone-wado-image-loader";
|
|
8
|
-
import { DataSet } from "dicom-parser";
|
|
9
|
-
import { each } from "lodash";
|
|
10
|
-
import { updateLoadedStack } from "../imageLoading";
|
|
11
|
-
import type {
|
|
12
|
-
ImageObject,
|
|
13
|
-
ImageTracker,
|
|
14
|
-
LarvitarManager,
|
|
15
|
-
MetaData,
|
|
16
|
-
Series
|
|
17
|
-
} from "../types";
|
|
18
|
-
|
|
19
|
-
// internal libraries
|
|
20
|
-
import { buildMultiFrameImage, clearMultiFrameCache } from "./multiframeLoader";
|
|
21
|
-
|
|
22
|
-
// global variables
|
|
23
|
-
var larvitarManager: LarvitarManager = null;
|
|
24
|
-
var imageTracker: ImageTracker = null;
|
|
25
|
-
|
|
26
|
-
/*
|
|
27
|
-
* This module provides the following functions to be exported:
|
|
28
|
-
* updateLarvitarManager(imageObject)
|
|
29
|
-
* populateLarvitarManager(seriesId, seriesData)
|
|
30
|
-
* getLarvitarManager()
|
|
31
|
-
* getLarvitarImageTracker()
|
|
32
|
-
* resetLarvitarManager()
|
|
33
|
-
* removeSeriesFromLarvitarManager(seriesId)
|
|
34
|
-
* getSeriesDataFromLarvitarManager(seriesId)
|
|
35
|
-
* getImageFrame(metadata, dataSet)
|
|
36
|
-
* getSopInstanceUIDFromLarvitarManager(larvitarSeriesInstanceUID, imageId)
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Update and initialize larvitar manager in order to parse and load a single dicom object
|
|
41
|
-
* @instance
|
|
42
|
-
* @function updateLarvitarManager
|
|
43
|
-
* @param {Object} imageObject The single dicom object
|
|
44
|
-
* @param {String} customId - Optional custom id to overwrite seriesUID as default one
|
|
45
|
-
* @param {number} sliceIndex - Optional custom index to overwrite slice index as default one
|
|
46
|
-
*/
|
|
47
|
-
export const updateLarvitarManager = function (
|
|
48
|
-
imageObject: ImageObject,
|
|
49
|
-
customId?: string,
|
|
50
|
-
sliceIndex?: number
|
|
51
|
-
) {
|
|
52
|
-
if (larvitarManager === null) {
|
|
53
|
-
larvitarManager = {};
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
let data = { ...imageObject };
|
|
57
|
-
|
|
58
|
-
if (data.metadata?.isMultiframe) {
|
|
59
|
-
let seriesId = customId || imageObject.metadata.seriesUID;
|
|
60
|
-
let loadedStack: ReturnType<typeof getLarvitarManager> = {};
|
|
61
|
-
updateLoadedStack(data, loadedStack, customId, sliceIndex);
|
|
62
|
-
buildMultiFrameImage(
|
|
63
|
-
seriesId as string,
|
|
64
|
-
loadedStack[seriesId as string] as Series
|
|
65
|
-
);
|
|
66
|
-
} else {
|
|
67
|
-
updateLoadedStack(data, larvitarManager, customId, sliceIndex);
|
|
68
|
-
}
|
|
69
|
-
return larvitarManager;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* This function can be called in order to populate the Larvitar manager
|
|
74
|
-
* @instance
|
|
75
|
-
* @function populateLarvitarManager
|
|
76
|
-
* @param {String} seriesId The Id of the series
|
|
77
|
-
* @param {Object} seriesData The series data
|
|
78
|
-
* @returns {manager} the Larvitar manager
|
|
79
|
-
*/
|
|
80
|
-
export const populateLarvitarManager = function (
|
|
81
|
-
seriesId: string,
|
|
82
|
-
seriesData: Series
|
|
83
|
-
) {
|
|
84
|
-
if (larvitarManager === null) {
|
|
85
|
-
larvitarManager = {};
|
|
86
|
-
}
|
|
87
|
-
let data = { ...seriesData };
|
|
88
|
-
if (data.isMultiframe) {
|
|
89
|
-
buildMultiFrameImage(seriesId, data);
|
|
90
|
-
} else {
|
|
91
|
-
larvitarManager[seriesId] = data;
|
|
92
|
-
}
|
|
93
|
-
return larvitarManager;
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Return the common data loader manager
|
|
98
|
-
* @instance
|
|
99
|
-
* @function getLarvitarManager
|
|
100
|
-
* @returns {Object} the loader manager
|
|
101
|
-
*/
|
|
102
|
-
export const getLarvitarManager = function () {
|
|
103
|
-
if (larvitarManager == null) {
|
|
104
|
-
larvitarManager = {};
|
|
105
|
-
}
|
|
106
|
-
return larvitarManager;
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Return the common image tracker
|
|
111
|
-
* @instance
|
|
112
|
-
* @function getLarvitarImageTracker
|
|
113
|
-
* @returns {Object} the image tracker
|
|
114
|
-
*/
|
|
115
|
-
export const getLarvitarImageTracker = function () {
|
|
116
|
-
if (imageTracker == null) {
|
|
117
|
-
imageTracker = {};
|
|
118
|
-
}
|
|
119
|
-
return imageTracker;
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Reset the Larvitar Manager store
|
|
124
|
-
* @instance
|
|
125
|
-
* @function resetLarvitarManager
|
|
126
|
-
*/
|
|
127
|
-
export const resetLarvitarManager = function () {
|
|
128
|
-
each(larvitarManager, function (stack) {
|
|
129
|
-
if ((stack as Series).isMultiframe) {
|
|
130
|
-
if ((stack as Series).dataSet) {
|
|
131
|
-
//@ts-ignore for memory leak
|
|
132
|
-
(stack as Series).dataSet!.byteArray = null;
|
|
133
|
-
}
|
|
134
|
-
(stack as Series).dataSet = null;
|
|
135
|
-
(stack as Series).elements = null;
|
|
136
|
-
clearMultiFrameCache(stack.seriesUID);
|
|
137
|
-
}
|
|
138
|
-
each(stack.instances, function (instance) {
|
|
139
|
-
if (instance.dataSet) {
|
|
140
|
-
//@ts-ignore for memory leak
|
|
141
|
-
instance.dataSet.byteArray = null;
|
|
142
|
-
}
|
|
143
|
-
instance.dataSet = null;
|
|
144
|
-
instance.file = null;
|
|
145
|
-
//@ts-ignore for memory leak
|
|
146
|
-
instance.metadata = null;
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
|
-
larvitarManager = null;
|
|
150
|
-
imageTracker = null;
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Remove a stored seriesId from the larvitar Manager
|
|
155
|
-
* @instance
|
|
156
|
-
* @function removeSeriesFromLarvitarManager
|
|
157
|
-
* @param {String} seriesId The Id of the series
|
|
158
|
-
*/
|
|
159
|
-
export const removeSeriesFromLarvitarManager = function (seriesId: string) {
|
|
160
|
-
if (larvitarManager && larvitarManager[seriesId]) {
|
|
161
|
-
if ((larvitarManager[seriesId] as Series).isMultiframe) {
|
|
162
|
-
//@ts-ignore for memory leak
|
|
163
|
-
(larvitarManager[seriesId] as Series).dataSet.byteArray = null;
|
|
164
|
-
(larvitarManager[seriesId] as Series).dataSet = null;
|
|
165
|
-
(larvitarManager[seriesId] as Series).elements = null;
|
|
166
|
-
clearMultiFrameCache(seriesId);
|
|
167
|
-
}
|
|
168
|
-
each(larvitarManager[seriesId].instances, function (instance) {
|
|
169
|
-
if (instance.dataSet) {
|
|
170
|
-
//@ts-ignore for memory leak
|
|
171
|
-
instance.dataSet.byteArray = null;
|
|
172
|
-
}
|
|
173
|
-
instance.dataSet = null;
|
|
174
|
-
instance.file = null;
|
|
175
|
-
//@ts-ignore for memory leak
|
|
176
|
-
instance.metadata = null;
|
|
177
|
-
});
|
|
178
|
-
//@ts-ignore for memory leak
|
|
179
|
-
larvitarManager[seriesId] = null;
|
|
180
|
-
delete larvitarManager[seriesId];
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Return the data of a specific seriesId stored in the DICOM Manager
|
|
186
|
-
* @instance
|
|
187
|
-
* @function getSeriesDataFromLarvitarManager
|
|
188
|
-
* @param {String} seriesId The Id of the series
|
|
189
|
-
* @return {Object} larvitar manager data
|
|
190
|
-
*/
|
|
191
|
-
export const getSeriesDataFromLarvitarManager = function (seriesId: string) {
|
|
192
|
-
return larvitarManager ? larvitarManager[seriesId] : null;
|
|
193
|
-
};
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Compute and return image frame
|
|
197
|
-
* @instance
|
|
198
|
-
* @function getImageFrame
|
|
199
|
-
* @param {Object} metadata metadata object
|
|
200
|
-
* @param {Object} dataSet dicom dataset
|
|
201
|
-
* @returns {Object} specific image frame
|
|
202
|
-
*/
|
|
203
|
-
export const getImageFrame = function (metadata: MetaData, dataSet: DataSet) {
|
|
204
|
-
let imagePixelModule;
|
|
205
|
-
|
|
206
|
-
if (dataSet) {
|
|
207
|
-
imagePixelModule =
|
|
208
|
-
cornerstoneDICOMImageLoader.wadouri.metaData.getImagePixelModule(dataSet);
|
|
209
|
-
} else {
|
|
210
|
-
imagePixelModule = {
|
|
211
|
-
samplesPerPixel: metadata.x00280002,
|
|
212
|
-
photometricInterpretation: metadata.x00280004,
|
|
213
|
-
planarConfiguration: metadata.x00280006,
|
|
214
|
-
rows: metadata.x00280010,
|
|
215
|
-
columns: metadata.x00280011,
|
|
216
|
-
bitsAllocated: metadata.x00280100,
|
|
217
|
-
pixelRepresentation: metadata.x00280103,
|
|
218
|
-
smallestPixelValue: metadata.x00280106,
|
|
219
|
-
largestPixelValue: metadata.x00280107,
|
|
220
|
-
redPaletteColorLookupTableDescriptor: metadata.x00281101,
|
|
221
|
-
greenPaletteColorLookupTableDescriptor: metadata.x00281102,
|
|
222
|
-
bluePaletteColorLookupTableDescriptor: metadata.x00281103,
|
|
223
|
-
redPaletteColorLookupTableData: metadata.x00281201,
|
|
224
|
-
greenPaletteColorLookupTableData: metadata.x00281202,
|
|
225
|
-
bluePaletteColorLookupTableData: metadata.x00281203
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
return {
|
|
230
|
-
samplesPerPixel: imagePixelModule.samplesPerPixel,
|
|
231
|
-
photometricInterpretation: imagePixelModule.photometricInterpretation,
|
|
232
|
-
planarConfiguration: imagePixelModule.planarConfiguration,
|
|
233
|
-
rows: imagePixelModule.rows,
|
|
234
|
-
columns: imagePixelModule.columns,
|
|
235
|
-
bitsAllocated: imagePixelModule.bitsAllocated,
|
|
236
|
-
pixelRepresentation: imagePixelModule.pixelRepresentation, // 0 = unsigned,
|
|
237
|
-
smallestPixelValue: imagePixelModule.smallestPixelValue,
|
|
238
|
-
largestPixelValue: imagePixelModule.largestPixelValue,
|
|
239
|
-
redPaletteColorLookupTableDescriptor:
|
|
240
|
-
imagePixelModule.redPaletteColorLookupTableDescriptor,
|
|
241
|
-
greenPaletteColorLookupTableDescriptor:
|
|
242
|
-
imagePixelModule.greenPaletteColorLookupTableDescriptor,
|
|
243
|
-
bluePaletteColorLookupTableDescriptor:
|
|
244
|
-
imagePixelModule.bluePaletteColorLookupTableDescriptor,
|
|
245
|
-
redPaletteColorLookupTableData:
|
|
246
|
-
imagePixelModule.redPaletteColorLookupTableData,
|
|
247
|
-
greenPaletteColorLookupTableData:
|
|
248
|
-
imagePixelModule.greenPaletteColorLookupTableData,
|
|
249
|
-
bluePaletteColorLookupTableData:
|
|
250
|
-
imagePixelModule.bluePaletteColorLookupTableData,
|
|
251
|
-
pixelData: undefined, // populated later after decoding,
|
|
252
|
-
ImageData: undefined
|
|
253
|
-
};
|
|
254
|
-
};
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* Return the SOP Instance UID of a specific imageId stored in the Larvitar Manager
|
|
258
|
-
* @instance
|
|
259
|
-
* @function getSopInstanceUIDFromLarvitarManager
|
|
260
|
-
* @param {String} larvitarSeriesInstanceUID The Id of the series
|
|
261
|
-
* @param {String} imageId The Id of the image
|
|
262
|
-
* @returns {String} sopInstanceUID
|
|
263
|
-
*/
|
|
264
|
-
export const getSopInstanceUIDFromLarvitarManager = function (
|
|
265
|
-
larvitarSeriesInstanceUID: string,
|
|
266
|
-
imageId: string
|
|
267
|
-
) {
|
|
268
|
-
if (larvitarManager === null) {
|
|
269
|
-
return null;
|
|
270
|
-
}
|
|
271
|
-
let series = larvitarManager[larvitarSeriesInstanceUID];
|
|
272
|
-
return Object.keys(series.instanceUIDs).find(
|
|
273
|
-
key => series.instanceUIDs[key] === imageId
|
|
274
|
-
);
|
|
275
|
-
};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/** @module loaders/dicomLoader
|
|
2
|
-
* @desc This file provides functionalities for
|
|
3
|
-
* custom DICOM Loader
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// internal libraries
|
|
7
|
-
import { loadAndCacheImage, loadAndCacheImages } from "../imageRendering";
|
|
8
|
-
import type { Series, CachingResponse } from "../types";
|
|
9
|
-
|
|
10
|
-
/*
|
|
11
|
-
* This module provides the following functions to be exported:
|
|
12
|
-
* cacheImage(seriesData, imageIndex)
|
|
13
|
-
* cacheImages(seriesData, callback)
|
|
14
|
-
* getDicomImageId(dicomLoaderName)
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
let imageLoaderCounter = 0;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Load and cache a single image
|
|
21
|
-
* @instance
|
|
22
|
-
* @function cacheImage
|
|
23
|
-
* @param {Object} seriesData The series data
|
|
24
|
-
* @param {number} imageIndex The image index in the imageIds array
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
export const cacheImage = async function (
|
|
28
|
-
seriesData: Series,
|
|
29
|
-
imageIndex: number
|
|
30
|
-
) {
|
|
31
|
-
return loadAndCacheImage(seriesData, imageIndex);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Load and cache images
|
|
36
|
-
* @instance
|
|
37
|
-
* @function cacheImages
|
|
38
|
-
* @param {Object} seriesData The series data
|
|
39
|
-
* @param {Function} callback Optional callback function
|
|
40
|
-
*/
|
|
41
|
-
export const cacheImages = async function (
|
|
42
|
-
seriesData: Series,
|
|
43
|
-
callback?: Function
|
|
44
|
-
) {
|
|
45
|
-
loadAndCacheImages(seriesData, function (resp: CachingResponse) {
|
|
46
|
-
if (resp.loading == 100) {
|
|
47
|
-
imageLoaderCounter += seriesData.imageIds.length;
|
|
48
|
-
}
|
|
49
|
-
if (callback) {
|
|
50
|
-
callback(resp);
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Get the dicom imageId from dicom loader
|
|
57
|
-
* @instance
|
|
58
|
-
* @function getDicomImageId
|
|
59
|
-
* @param {String} dicomLoaderName dicom loader name
|
|
60
|
-
* @return {String} current dicom image id
|
|
61
|
-
*/
|
|
62
|
-
export const getDicomImageId = function (dicomLoaderName: string) {
|
|
63
|
-
let imageId = dicomLoaderName + ":" + imageLoaderCounter;
|
|
64
|
-
imageLoaderCounter++;
|
|
65
|
-
return imageId;
|
|
66
|
-
};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/** @module loaders/fileLoader
|
|
2
|
-
* @desc This file provides functionalities for
|
|
3
|
-
* custom File Loader
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// external libraries
|
|
7
|
-
import cornerstoneFileImageLoader from "cornerstone-file-image-loader";
|
|
8
|
-
import { has } from "lodash";
|
|
9
|
-
|
|
10
|
-
// internal libraries
|
|
11
|
-
import { clearImageCache } from "../imageRendering";
|
|
12
|
-
import { clearCornerstoneElements } from "../imageTools";
|
|
13
|
-
|
|
14
|
-
// global variables
|
|
15
|
-
export var fileManager: {
|
|
16
|
-
[key: string]: string;
|
|
17
|
-
} = {};
|
|
18
|
-
|
|
19
|
-
/*
|
|
20
|
-
* This module provides the following functions to be exported:
|
|
21
|
-
* resetFileLoader()
|
|
22
|
-
* resetFileManager()
|
|
23
|
-
* populateFileManager(file)
|
|
24
|
-
* getFileImageId(file)
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Reset the Custom File Loader
|
|
29
|
-
* @instance
|
|
30
|
-
* @function resetFileLoader
|
|
31
|
-
*/
|
|
32
|
-
export const resetFileLoader = function () {
|
|
33
|
-
clearCornerstoneElements();
|
|
34
|
-
resetFileManager();
|
|
35
|
-
clearImageCache();
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Reset the File Manager store
|
|
40
|
-
* @instance
|
|
41
|
-
* @function resetFileManager
|
|
42
|
-
*/
|
|
43
|
-
export const resetFileManager = function () {
|
|
44
|
-
fileManager = {};
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Populate File Manager
|
|
49
|
-
* @instance
|
|
50
|
-
* @function populateFileManager
|
|
51
|
-
* @return {String} current file image id
|
|
52
|
-
*/
|
|
53
|
-
export const populateFileManager = function (file: File) {
|
|
54
|
-
let uuid = file.webkitRelativePath || file.name;
|
|
55
|
-
if (!has(fileManager, uuid)) {
|
|
56
|
-
const imageId = cornerstoneFileImageLoader.fileManager.add(file);
|
|
57
|
-
fileManager[uuid] = imageId;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Get the file imageId from file loader
|
|
63
|
-
* @instance
|
|
64
|
-
* @function getFileImageId
|
|
65
|
-
* @return {String} current file image id
|
|
66
|
-
*/
|
|
67
|
-
export const getFileImageId = function (file: File) {
|
|
68
|
-
let uuid = file.webkitRelativePath || file.name;
|
|
69
|
-
const imageId = has(fileManager, uuid) ? fileManager[uuid] : null;
|
|
70
|
-
return imageId;
|
|
71
|
-
};
|