larvitar 2.0.13 → 2.0.15
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 +3 -2
- package/dist/imaging/imageUtils.d.ts +2 -1
- package/dist/imaging/tools/custom/contourTool.d.ts +5 -5
- package/dist/index.d.ts +1 -0
- package/dist/larvitar.js +36 -32
- package/dist/larvitar.js.map +1 -1
- package/imaging/types.d.ts +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -8,8 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
## Dicom Image Toolkit for CornerstoneJS
|
|
10
10
|
|
|
11
|
-
### Current version: 2.0.
|
|
12
|
-
|
|
11
|
+
### Current version: 2.0.15
|
|
12
|
+
|
|
13
|
+
### Latest Published Release: 2.0.15
|
|
13
14
|
|
|
14
15
|
This library provides common DICOM functionalities to be used in web-applications: it's wrapper that simplifies the use of cornerstone-js environment.
|
|
15
16
|
|
|
@@ -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;
|
|
@@ -380,15 +380,15 @@ export class ContoursTool {
|
|
|
380
380
|
*/
|
|
381
381
|
fireModifiedEvent(element: any, measurementData: any): void;
|
|
382
382
|
fireCompletedEvent(element: any, measurementData: any): void;
|
|
383
|
-
set spacing(
|
|
383
|
+
set spacing(value: any);
|
|
384
384
|
get spacing(): any;
|
|
385
|
-
set activeHandleRadius(
|
|
385
|
+
set activeHandleRadius(value: any);
|
|
386
386
|
get activeHandleRadius(): any;
|
|
387
|
-
set completeHandleRadius(
|
|
387
|
+
set completeHandleRadius(value: any);
|
|
388
388
|
get completeHandleRadius(): any;
|
|
389
|
-
set alwaysShowHandles(
|
|
389
|
+
set alwaysShowHandles(value: any);
|
|
390
390
|
get alwaysShowHandles(): any;
|
|
391
|
-
set invalidColor(
|
|
391
|
+
set invalidColor(value: any);
|
|
392
392
|
get invalidColor(): any;
|
|
393
393
|
/**
|
|
394
394
|
* Ends the active drawing loop and removes the polygon.
|
package/dist/index.d.ts
CHANGED
package/dist/larvitar.js
CHANGED
|
@@ -1690,7 +1690,6 @@ class EditMaskTool extends BaseBrushTool {
|
|
|
1690
1690
|
// });
|
|
1691
1691
|
// }
|
|
1692
1692
|
}
|
|
1693
|
-
|
|
1694
1693
|
activeCallback(element, options) {
|
|
1695
1694
|
switch (options.force) {
|
|
1696
1695
|
case "delete":
|
|
@@ -3940,7 +3939,6 @@ class RectangleRoiOverlayTool extends BaseAnnotationTool {
|
|
|
3940
3939
|
// showMinMax: false,
|
|
3941
3940
|
// showHounsfieldUnits: true,
|
|
3942
3941
|
},
|
|
3943
|
-
|
|
3944
3942
|
svgCursor: rectangleRoiCursor
|
|
3945
3943
|
};
|
|
3946
3944
|
super(props, defaultProps);
|
|
@@ -80593,8 +80591,8 @@ const updateLoadedStack = function (seriesData, allSeriesStack, customId, sliceI
|
|
|
80593
80591
|
if (!allSeriesStack[id]) {
|
|
80594
80592
|
let series = {
|
|
80595
80593
|
currentImageIdIndex: 0,
|
|
80596
|
-
imageIds: [],
|
|
80597
|
-
instanceUIDs: {},
|
|
80594
|
+
imageIds: [], // (ordered)
|
|
80595
|
+
instanceUIDs: {}, // instanceUID: imageId (ordered)
|
|
80598
80596
|
instances: {},
|
|
80599
80597
|
seriesDescription: seriesDescription,
|
|
80600
80598
|
larvitarSeriesInstanceUID: lid,
|
|
@@ -81894,6 +81892,7 @@ const updateViewportData = function (elementId, viewportData, activeTool) {
|
|
|
81894
81892
|
// TODO: understand how to handle synchronized tools
|
|
81895
81893
|
switch (activeTool) {
|
|
81896
81894
|
case "Wwwc":
|
|
81895
|
+
case "Wwwl":
|
|
81897
81896
|
case "WwwcRegion":
|
|
81898
81897
|
if (viewportData.voi) {
|
|
81899
81898
|
(0, imageStore_1.set)([
|
|
@@ -81937,6 +81936,7 @@ const updateViewportData = function (elementId, viewportData, activeTool) {
|
|
|
81937
81936
|
}
|
|
81938
81937
|
break;
|
|
81939
81938
|
default:
|
|
81939
|
+
console.warn("unknown tool: " + activeTool);
|
|
81940
81940
|
break;
|
|
81941
81941
|
}
|
|
81942
81942
|
};
|
|
@@ -82333,8 +82333,8 @@ const INITIAL_STORE_DATA = {
|
|
|
82333
82333
|
};
|
|
82334
82334
|
// default viewport object
|
|
82335
82335
|
const DEFAULT_VIEWPORT = {
|
|
82336
|
-
loading: 0,
|
|
82337
|
-
ready: false,
|
|
82336
|
+
loading: 0, // from 0 to 100 (%)
|
|
82337
|
+
ready: false, // true when currentImageId is rendered
|
|
82338
82338
|
minSliceId: 0,
|
|
82339
82339
|
maxSliceId: 0,
|
|
82340
82340
|
sliceId: 0,
|
|
@@ -83563,8 +83563,8 @@ const getReslicedMetadata = function (reslicedSeriesId, fromOrientation, toOrien
|
|
|
83563
83563
|
x00280100: sampleMetadata.x00280100,
|
|
83564
83564
|
x00280103: sampleMetadata.x00280103,
|
|
83565
83565
|
// resliced series sizes
|
|
83566
|
-
x00280010: toSize[1],
|
|
83567
|
-
x00280011: toSize[0],
|
|
83566
|
+
x00280010: toSize[1], // rows
|
|
83567
|
+
x00280011: toSize[0], // cols
|
|
83568
83568
|
// resliced series spacing
|
|
83569
83569
|
x00280030: [toSpacing[1], toSpacing[0]],
|
|
83570
83570
|
x00180050: [toSpacing[2]],
|
|
@@ -83650,8 +83650,8 @@ const getCmprMetadata = function (reslicedSeriesId, imageLoaderName, header // T
|
|
|
83650
83650
|
// Bits Allocated
|
|
83651
83651
|
x00280103: header.repr,
|
|
83652
83652
|
// resliced series sizes
|
|
83653
|
-
x00280010: header.rows,
|
|
83654
|
-
x00280011: header.cols,
|
|
83653
|
+
x00280010: header.rows, // rows
|
|
83654
|
+
x00280011: header.cols, // cols
|
|
83655
83655
|
// resliced series spacing
|
|
83656
83656
|
x00280030: [header.spacing[1], header.spacing[0]],
|
|
83657
83657
|
x00180050: [header.distance_btw_slices],
|
|
@@ -83681,8 +83681,8 @@ const getCmprMetadata = function (reslicedSeriesId, imageLoaderName, header // T
|
|
|
83681
83681
|
// x00020010: sampleMetadata.x00020010,
|
|
83682
83682
|
// x00200052: sampleMetadata.x00200052,
|
|
83683
83683
|
// data needed to obtain a good rendering
|
|
83684
|
-
x00281050: [header.wwwl[1] / 2],
|
|
83685
|
-
x00281051: [header.wwwl[0]],
|
|
83684
|
+
x00281050: [header.wwwl[1] / 2], // [wl]
|
|
83685
|
+
x00281051: [header.wwwl[0]], // [ww]
|
|
83686
83686
|
x00281052: header.intercept,
|
|
83687
83687
|
x00281053: header.slope,
|
|
83688
83688
|
// new image orientation (IOP)
|
|
@@ -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 [];
|
|
@@ -84384,7 +84388,7 @@ const getImageFrame = function (metadata, dataSet) {
|
|
|
84384
84388
|
rows: imagePixelModule.rows,
|
|
84385
84389
|
columns: imagePixelModule.columns,
|
|
84386
84390
|
bitsAllocated: imagePixelModule.bitsAllocated,
|
|
84387
|
-
pixelRepresentation: imagePixelModule.pixelRepresentation,
|
|
84391
|
+
pixelRepresentation: imagePixelModule.pixelRepresentation, // 0 = unsigned,
|
|
84388
84392
|
smallestPixelValue: imagePixelModule.smallestPixelValue,
|
|
84389
84393
|
largestPixelValue: imagePixelModule.largestPixelValue,
|
|
84390
84394
|
redPaletteColorLookupTableDescriptor: imagePixelModule.redPaletteColorLookupTableDescriptor,
|
|
@@ -84393,7 +84397,7 @@ const getImageFrame = function (metadata, dataSet) {
|
|
|
84393
84397
|
redPaletteColorLookupTableData: imagePixelModule.redPaletteColorLookupTableData,
|
|
84394
84398
|
greenPaletteColorLookupTableData: imagePixelModule.greenPaletteColorLookupTableData,
|
|
84395
84399
|
bluePaletteColorLookupTableData: imagePixelModule.bluePaletteColorLookupTableData,
|
|
84396
|
-
pixelData: undefined,
|
|
84400
|
+
pixelData: undefined, // populated later after decoding,
|
|
84397
84401
|
ImageData: undefined
|
|
84398
84402
|
};
|
|
84399
84403
|
};
|
|
@@ -84823,7 +84827,7 @@ let createCustomImage = function (id, imageId, frameIndex, metadata) {
|
|
|
84823
84827
|
color: cornerstone_wado_image_loader_1.default.isColorImage(imageFrame.photometricInterpretation),
|
|
84824
84828
|
columnPixelSpacing: pixelSpacing[1]
|
|
84825
84829
|
? pixelSpacing[1]
|
|
84826
|
-
: pixelSpacing,
|
|
84830
|
+
: pixelSpacing, // check for specific spacing value
|
|
84827
84831
|
columns: imageFrame.columns,
|
|
84828
84832
|
data: dataSet ? dataSet : undefined,
|
|
84829
84833
|
height: imageFrame.rows,
|
|
@@ -84834,17 +84838,17 @@ let createCustomImage = function (id, imageId, frameIndex, metadata) {
|
|
|
84834
84838
|
invert: imageFrame.photometricInterpretation === "MONOCHROME1",
|
|
84835
84839
|
minPixelValue: imageFrame.smallestPixelValue,
|
|
84836
84840
|
maxPixelValue: imageFrame.largestPixelValue,
|
|
84837
|
-
render: undefined,
|
|
84841
|
+
render: undefined, // set below
|
|
84838
84842
|
rowPixelSpacing: pixelSpacing[0]
|
|
84839
84843
|
? pixelSpacing[0]
|
|
84840
|
-
: pixelSpacing,
|
|
84844
|
+
: pixelSpacing, // check for specific spacing value
|
|
84841
84845
|
rows: imageFrame.rows,
|
|
84842
84846
|
sizeInBytes: getSizeInBytes(),
|
|
84843
84847
|
slope: rescaleSlope ? rescaleSlope : 1,
|
|
84844
84848
|
width: imageFrame.columns,
|
|
84845
84849
|
windowCenter: windowCenter,
|
|
84846
84850
|
windowWidth: windowWidth,
|
|
84847
|
-
decodeTimeInMS: undefined,
|
|
84851
|
+
decodeTimeInMS: undefined, // TODO
|
|
84848
84852
|
loadTimeInMS: undefined // TODO
|
|
84849
84853
|
};
|
|
84850
84854
|
// add function to return pixel data
|
|
@@ -85050,11 +85054,11 @@ const buildNrrdImage = function (volume, seriesId, custom_header) {
|
|
|
85050
85054
|
let intercept = header.volume.intercept;
|
|
85051
85055
|
let slope = header.volume.slope;
|
|
85052
85056
|
let metadata = {
|
|
85053
|
-
x00280010: rows,
|
|
85054
|
-
x00280011: cols,
|
|
85055
|
-
x00200037: iop,
|
|
85056
|
-
x00280030: ps,
|
|
85057
|
-
x00180050: [thickness][0],
|
|
85057
|
+
x00280010: rows, // Rows
|
|
85058
|
+
x00280011: cols, // Columns
|
|
85059
|
+
x00200037: iop, // ImageOrientationPatient
|
|
85060
|
+
x00280030: ps, // PixelSpacing
|
|
85061
|
+
x00180050: [thickness][0], // SliceThickness
|
|
85058
85062
|
x00281052: intercept ? [intercept] : [0],
|
|
85059
85063
|
x00281053: slope ? [slope] : [1],
|
|
85060
85064
|
x00200052: header.volume.imageIds
|
|
@@ -85299,7 +85303,7 @@ let createCustomImage = function (imageId, metadata, pixelData, dataSet) {
|
|
|
85299
85303
|
invert: imageFrame.photometricInterpretation === "MONOCHROME1",
|
|
85300
85304
|
minPixelValue: imageFrame.smallestPixelValue,
|
|
85301
85305
|
maxPixelValue: imageFrame.largestPixelValue,
|
|
85302
|
-
render: undefined,
|
|
85306
|
+
render: undefined, // set below
|
|
85303
85307
|
rowPixelSpacing: pixelSpacing ? pixelSpacing[0] : undefined,
|
|
85304
85308
|
rows: imageFrame.rows,
|
|
85305
85309
|
sizeInBytes: getSizeInBytes(),
|
|
@@ -85480,7 +85484,7 @@ let createCustomImage = function (imageId, metadata, pixelData, dataSet // depre
|
|
|
85480
85484
|
invert: imageFrame.photometricInterpretation === "MONOCHROME1",
|
|
85481
85485
|
minPixelValue: imageFrame.smallestPixelValue,
|
|
85482
85486
|
maxPixelValue: imageFrame.largestPixelValue,
|
|
85483
|
-
render: undefined,
|
|
85487
|
+
render: undefined, // set below
|
|
85484
85488
|
rowPixelSpacing: pixelSpacing ? pixelSpacing[0] : undefined,
|
|
85485
85489
|
rows: imageFrame.rows,
|
|
85486
85490
|
sizeInBytes: getSizeInBytes(),
|
|
@@ -86127,7 +86131,7 @@ const DEFAULT_TOOLS = {
|
|
|
86127
86131
|
name: "StackScroll",
|
|
86128
86132
|
viewports: "all",
|
|
86129
86133
|
configuration: {
|
|
86130
|
-
loop: false,
|
|
86134
|
+
loop: false, // default false
|
|
86131
86135
|
allowSkipping: true // default true
|
|
86132
86136
|
},
|
|
86133
86137
|
options: {
|
|
@@ -86142,8 +86146,8 @@ const DEFAULT_TOOLS = {
|
|
|
86142
86146
|
name: "StackScrollMouseWheel",
|
|
86143
86147
|
viewports: "all",
|
|
86144
86148
|
configuration: {
|
|
86145
|
-
loop: false,
|
|
86146
|
-
allowSkipping: true,
|
|
86149
|
+
loop: false, // default false
|
|
86150
|
+
allowSkipping: true, // default true
|
|
86147
86151
|
invert: false
|
|
86148
86152
|
},
|
|
86149
86153
|
options: {},
|
|
@@ -86517,7 +86521,7 @@ exports.DEFAULT_SETTINGS = DEFAULT_SETTINGS;
|
|
|
86517
86521
|
* Shortcut and mouse bindings defaults
|
|
86518
86522
|
*/
|
|
86519
86523
|
const DEFAULT_MOUSE_KEYS = {
|
|
86520
|
-
debug: true,
|
|
86524
|
+
debug: true, // log changes
|
|
86521
86525
|
mouse_button_left: {
|
|
86522
86526
|
shift: "Zoom",
|
|
86523
86527
|
ctrl: "Pan",
|
|
@@ -88977,7 +88981,7 @@ module.exports = JSON.parse('{"x00000000":{"tag":"x00000000","vr":"UL","vm":"1",
|
|
|
88977
88981
|
/***/ ((module) => {
|
|
88978
88982
|
|
|
88979
88983
|
"use strict";
|
|
88980
|
-
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.15","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"}}');
|
|
88981
88985
|
|
|
88982
88986
|
/***/ })
|
|
88983
88987
|
|