larvitar 2.0.12 → 2.0.14
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/imaging/imageUtils.d.ts +2 -1
- package/dist/imaging/loaders/commonLoader.d.ts +2 -2
- package/dist/imaging/loaders/multiframeLoader.d.ts +1 -1
- package/dist/larvitar.js +19 -16
- package/dist/larvitar.js.map +1 -1
- package/imaging/types.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
## Dicom Image Toolkit for CornerstoneJS
|
|
10
10
|
|
|
11
|
-
### Current version: 2.0.
|
|
12
|
-
### Latest Published Release: 2.0.
|
|
11
|
+
### Current version: 2.0.14
|
|
12
|
+
### Latest Published Release: 2.0.14
|
|
13
13
|
|
|
14
14
|
This library provides common DICOM functionalities to be used in web-applications: it's wrapper that simplifies the use of cornerstone-js environment.
|
|
15
15
|
|
|
@@ -148,9 +148,10 @@ export declare const getDistanceBetweenSlices: (seriesData: Series, sliceIndex1:
|
|
|
148
148
|
* @function getImageMetadata
|
|
149
149
|
* @param {String} seriesId - The seriesUID
|
|
150
150
|
* @param {String} instanceUID - The SOPInstanceUID
|
|
151
|
+
* @param {number} frameId - Optional FrameId
|
|
151
152
|
* @return {Array} - List of metadata objects: tag, name and value
|
|
152
153
|
*/
|
|
153
|
-
export declare const getImageMetadata: (seriesId: string, instanceUID: string) => ({
|
|
154
|
+
export declare const getImageMetadata: (seriesId: string, instanceUID: string, frameId?: number) => ({
|
|
154
155
|
tag: string;
|
|
155
156
|
name: string;
|
|
156
157
|
value: string | number | number[] | MetaDataTypes[] | null | undefined;
|
|
@@ -19,11 +19,11 @@ export declare const updateLarvitarManager: (imageObject: ImageObject, customId?
|
|
|
19
19
|
* This function can be called in order to populate the Larvitar manager
|
|
20
20
|
* @instance
|
|
21
21
|
* @function populateLarvitarManager
|
|
22
|
-
* @param {String}
|
|
22
|
+
* @param {String} larvitarSeriesInstanceUID The Id of the manager stack
|
|
23
23
|
* @param {Object} seriesData The series data
|
|
24
24
|
* @returns {manager} the Larvitar manager
|
|
25
25
|
*/
|
|
26
|
-
export declare const populateLarvitarManager: (
|
|
26
|
+
export declare const populateLarvitarManager: (larvitarSeriesInstanceUID: string, seriesData: Series) => {
|
|
27
27
|
[key: string]: Series | import("../types").NrrdSeries;
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
@@ -19,7 +19,7 @@ export declare const loadMultiFrameImage: (imageId: string) => {
|
|
|
19
19
|
* @param {String} seriesId - SeriesId tag
|
|
20
20
|
* @param {Object} serie - parsed serie object
|
|
21
21
|
*/
|
|
22
|
-
export declare const buildMultiFrameImage: (
|
|
22
|
+
export declare const buildMultiFrameImage: (larvitarSeriesInstanceUID: string, serie: Series) => void;
|
|
23
23
|
/**
|
|
24
24
|
* Get the custom imageId from custom loader
|
|
25
25
|
* @instance
|
package/dist/larvitar.js
CHANGED
|
@@ -83803,15 +83803,19 @@ exports.getDistanceBetweenSlices = getDistanceBetweenSlices;
|
|
|
83803
83803
|
* @function getImageMetadata
|
|
83804
83804
|
* @param {String} seriesId - The seriesUID
|
|
83805
83805
|
* @param {String} instanceUID - The SOPInstanceUID
|
|
83806
|
+
* @param {number} frameId - Optional FrameId
|
|
83806
83807
|
* @return {Array} - List of metadata objects: tag, name and value
|
|
83807
83808
|
*/
|
|
83808
|
-
const getImageMetadata = function (seriesId, instanceUID) {
|
|
83809
|
+
const getImageMetadata = function (seriesId, instanceUID, frameId) {
|
|
83809
83810
|
const seriesData = (0, commonLoader_1.getSeriesDataFromLarvitarManager)(seriesId);
|
|
83810
83811
|
if (seriesData === undefined || seriesData === null) {
|
|
83811
83812
|
console.log(`Invalid Series ID: ${seriesId}`);
|
|
83812
83813
|
return [];
|
|
83813
83814
|
}
|
|
83814
|
-
|
|
83815
|
+
// manage imageID if the image is a multiframe stack
|
|
83816
|
+
const imageId = seriesData.isMultiframe
|
|
83817
|
+
? seriesData.instanceUIDs[instanceUID] + "?frame=" + frameId
|
|
83818
|
+
: seriesData.instanceUIDs[instanceUID];
|
|
83815
83819
|
if (imageId === undefined) {
|
|
83816
83820
|
console.log(`Invalid InstanceUID ID: ${instanceUID}`);
|
|
83817
83821
|
return [];
|
|
@@ -84227,20 +84231,20 @@ exports.updateLarvitarManager = updateLarvitarManager;
|
|
|
84227
84231
|
* This function can be called in order to populate the Larvitar manager
|
|
84228
84232
|
* @instance
|
|
84229
84233
|
* @function populateLarvitarManager
|
|
84230
|
-
* @param {String}
|
|
84234
|
+
* @param {String} larvitarSeriesInstanceUID The Id of the manager stack
|
|
84231
84235
|
* @param {Object} seriesData The series data
|
|
84232
84236
|
* @returns {manager} the Larvitar manager
|
|
84233
84237
|
*/
|
|
84234
|
-
const populateLarvitarManager = function (
|
|
84238
|
+
const populateLarvitarManager = function (larvitarSeriesInstanceUID, seriesData) {
|
|
84235
84239
|
if (larvitarManager === null) {
|
|
84236
84240
|
larvitarManager = {};
|
|
84237
84241
|
}
|
|
84238
84242
|
let data = Object.assign({}, seriesData);
|
|
84239
84243
|
if (data.isMultiframe) {
|
|
84240
|
-
(0, multiframeLoader_1.buildMultiFrameImage)(
|
|
84244
|
+
(0, multiframeLoader_1.buildMultiFrameImage)(larvitarSeriesInstanceUID, data);
|
|
84241
84245
|
}
|
|
84242
84246
|
else {
|
|
84243
|
-
larvitarManager[
|
|
84247
|
+
larvitarManager[larvitarSeriesInstanceUID] = data;
|
|
84244
84248
|
}
|
|
84245
84249
|
return larvitarManager;
|
|
84246
84250
|
};
|
|
@@ -84644,7 +84648,7 @@ exports.loadMultiFrameImage = loadMultiFrameImage;
|
|
|
84644
84648
|
* @param {String} seriesId - SeriesId tag
|
|
84645
84649
|
* @param {Object} serie - parsed serie object
|
|
84646
84650
|
*/
|
|
84647
|
-
const buildMultiFrameImage = function (
|
|
84651
|
+
const buildMultiFrameImage = function (larvitarSeriesInstanceUID, serie) {
|
|
84648
84652
|
let t0 = performance.now();
|
|
84649
84653
|
let manager = (0, commonLoader_1.getLarvitarManager)();
|
|
84650
84654
|
let imageTracker = (0, commonLoader_1.getLarvitarImageTracker)();
|
|
@@ -84655,12 +84659,12 @@ const buildMultiFrameImage = function (seriesId, serie) {
|
|
|
84655
84659
|
let sopInstanceUID = serie.metadata["x00080018"];
|
|
84656
84660
|
let dataSet = serie.dataSet;
|
|
84657
84661
|
let imageId = (0, exports.getMultiFrameImageId)("multiFrameLoader");
|
|
84658
|
-
imageTracker[imageId] =
|
|
84662
|
+
imageTracker[imageId] = larvitarSeriesInstanceUID;
|
|
84659
84663
|
// check if manager exists for this seriesId
|
|
84660
|
-
if (!manager[
|
|
84661
|
-
manager[
|
|
84662
|
-
manager[
|
|
84663
|
-
manager[
|
|
84664
|
+
if (!manager[larvitarSeriesInstanceUID]) {
|
|
84665
|
+
manager[larvitarSeriesInstanceUID] = serie;
|
|
84666
|
+
manager[larvitarSeriesInstanceUID].imageIds = [];
|
|
84667
|
+
manager[larvitarSeriesInstanceUID].instances = {};
|
|
84664
84668
|
}
|
|
84665
84669
|
(0, lodash_1.each)((0, lodash_1.range)(numberOfFrames), function (frameNumber) {
|
|
84666
84670
|
let frameImageId = imageId + "?frame=" + frameNumber;
|
|
@@ -84670,10 +84674,9 @@ const buildMultiFrameImage = function (seriesId, serie) {
|
|
|
84670
84674
|
tags: ["x52009230"],
|
|
84671
84675
|
frameId: frameNumber
|
|
84672
84676
|
});
|
|
84673
|
-
// TODO-ts REMOVE "AS" WHEN METADATA VALUES ARE TYPED
|
|
84674
84677
|
// store file references
|
|
84675
|
-
const managerSeriesId = manager[
|
|
84676
|
-
managerSeriesId.seriesUID =
|
|
84678
|
+
const managerSeriesId = manager[larvitarSeriesInstanceUID];
|
|
84679
|
+
managerSeriesId.seriesUID = serie.metadata["x0020000e"];
|
|
84677
84680
|
managerSeriesId.studyUID = serie.metadata["x0020000d"];
|
|
84678
84681
|
managerSeriesId.modality = serie.metadata["x00080060"];
|
|
84679
84682
|
managerSeriesId.color = cornerstone_wado_image_loader_1.default.isColorImage(serie.metadata["x00280004"]);
|
|
@@ -88978,7 +88981,7 @@ module.exports = JSON.parse('{"x00000000":{"tag":"x00000000","vr":"UL","vm":"1",
|
|
|
88978
88981
|
/***/ ((module) => {
|
|
88979
88982
|
|
|
88980
88983
|
"use strict";
|
|
88981
|
-
module.exports = JSON.parse('{"name":"larvitar","keywords":["DICOM","imaging","medical","cornerstone"],"version":"2.0.
|
|
88984
|
+
module.exports = JSON.parse('{"name":"larvitar","keywords":["DICOM","imaging","medical","cornerstone"],"version":"2.0.14","description":"typescript library for parsing, loading, rendering and interacting with DICOM images","repository":{"url":"https://github.com/dvisionlab/Larvitar.git","type":"git"},"main":"dist/larvitar.js","types":"dist/index.d.ts","files":["dist","imaging/**/*.d.ts"],"scripts":{"coverage":"typescript-coverage-report","generate-docs":"node_modules/.bin/jsdoc -c jsdoc.json","build":"webpack --config ./bundler/webpack.prod.js && cp ./dist/larvitar.js ./docs/examples/larvitar.js","dev":"webpack --progress --config ./bundler/webpack.dev.js && cp ./dist/larvitar.js ./docs/examples/larvitar.js","dev-wip":"webpack serve --config ./bundler/webpack.dev-wip.js"},"author":"Simone Manini <simone.manini@dvisionlab.com> (https://www.dvisionlab.com)","contributors":["Mattia Ronzoni <mattia.ronzoni@dvisionlab.com> (https://www.dvisionlab.com)","Sara Zanchi <sara.zanchi@dvisionlab.com> (https://www.dvisionlab.com)","Ale Re <ale.re@dvisionlab.com> (https://www.dvisionlab.com)","Laura Borghesi Re <laura.borghesi@dvisionlab.com> (https://www.dvisionlab.com)"],"license":"MIT","dependencies":{"@rollup/plugin-commonjs":"^17.1.0","cornerstone-core":"^2.6.1","cornerstone-file-image-loader":"^0.3.0","cornerstone-tools":"^6.0.7","cornerstone-wado-image-loader":"^4.13.2","cornerstone-web-image-loader":"^2.1.1","crypto-js":"^4.1.1","dicom-character-set":"^1.0.3","dicom-parser":"^1.8.13","docdash":"^1.2.0","hammerjs":"^2.0.8","jpeg-lossless-decoder-js":"^2.0.7","keycode-js":"^3.1.0","lodash":"^4.17.15","pako":"^1.0.10","papaparse":"^5.3.0","plotly.js-dist-min":"^2.27.1","uuid":"^8.3.2"},"devDependencies":{"@babel/core":"^7.21.8","@types/cornerstone-core":"^2.3.0","@types/crypto-js":"^4.1.1","@types/hammerjs":"^2.0.41","@types/lodash":"^4.14.192","@types/papaparse":"^5.3.7","@types/plotly.js":"^2.12.30","@types/plotly.js-dist-min":"^2.3.4","@types/uuid":"^9.0.1","babel-loader":"^9.1.2","clean-webpack-plugin":"^4.0.0","copy-webpack-plugin":"^11.0.0","fs":"^0.0.1-security","html-loader":"^4.2.0","html-webpack-plugin":"^5.5.0","ip":"^1.1.8","jsdoc":"^3.6.4","portfinder-sync":"^0.0.2","ts-loader":"^9.4.2","typescript":"^5.0.2","typescript-coverage-report":"^0.7.0","webpack":"^5.76.3","webpack-bundle-analyzer":"^4.8.0","webpack-cli":"^5.0.1","webpack-dev-server":"^4.13.1"}}');
|
|
88982
88985
|
|
|
88983
88986
|
/***/ })
|
|
88984
88987
|
|