From b07749a936c841ef7a67897b5417a83266af82e9 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 25 Nov 2024 12:16:16 +0000 Subject: [PATCH] CI run 545 pushed to gh-pages --- demo/stable/Gruntfile.js | 11 - demo/stable/eslint.config.mjs | 126 + demo/stable/node_modules/.yarn-integrity | 172 +- .../node_modules/dwv/decoders/pdfjs/readme.md | 27 +- .../dwv/decoders/rii-mango/readme.md | 21 +- demo/stable/node_modules/dwv/dist/dwv.d.ts | 3683 +- demo/stable/node_modules/dwv/dist/dwv.min.js | 2 +- .../node_modules/dwv/dist/dwv.min.js.map | 2 +- demo/stable/node_modules/dwv/package.json | 58 +- demo/stable/node_modules/dwv/readme.md | 25 +- .../CHANGELOG.md | 5 + .../README.md | 15 +- .../cjs/i18nextBrowserLanguageDetector.js | 371 +- .../esm/i18nextBrowserLanguageDetector.js | 366 +- .../dist/esm/package.json | 2 +- .../umd/i18nextBrowserLanguageDetector.js | 413 +- .../umd/i18nextBrowserLanguageDetector.min.js | 2 +- .../i18nextBrowserLanguageDetector.js | 413 +- .../i18nextBrowserLanguageDetector.min.js | 2 +- .../package.json | 2 +- .../i18next-http-backend/CHANGELOG.md | 20 + .../i18next-http-backend/README.md | 7 +- .../i18next-http-backend/cjs/getFetch.js | 2 +- .../i18next-http-backend/cjs/index.d.ts | 2 +- .../i18next-http-backend/cjs/index.js | 28 +- .../i18next-http-backend/cjs/request.js | 6 +- .../i18next-http-backend/esm/getFetch.cjs | 2 +- .../i18next-http-backend/esm/index.d.ts | 2 +- .../i18next-http-backend/esm/index.js | 26 +- .../i18next-http-backend/esm/request.js | 4 +- .../i18nextHttpBackend.js | 36 +- .../i18nextHttpBackend.min.js | 2 +- .../i18next-http-backend/index.d.ts | 2 +- .../i18next-http-backend/lib/getFetch.cjs | 2 +- .../i18next-http-backend/lib/index.js | 20 +- .../node_modules/i18next-http-backend/licence | 2 +- .../i18next-http-backend/package.json | 22 +- .../node_modules/i18next/dist/cjs/i18next.js | 771 +- .../i18next/dist/esm/i18next.bundled.js | 771 +- .../node_modules/i18next/dist/esm/i18next.js | 771 +- .../i18next/dist/esm/package.json | 2 +- .../node_modules/i18next/dist/umd/i18next.js | 771 +- .../i18next/dist/umd/i18next.min.js | 2 +- demo/stable/node_modules/i18next/i18next.js | 771 +- .../node_modules/i18next/i18next.min.js | 2 +- demo/stable/node_modules/i18next/index.d.ts | 17 +- .../stable/node_modules/i18next/index.v4.d.ts | 17 +- demo/stable/node_modules/i18next/package.json | 21 +- .../i18next/typescript/helpers.d.ts | 8 + .../i18next/typescript/options.d.ts | 12 +- .../node_modules/i18next/typescript/t.d.ts | 40 +- .../node_modules/i18next/typescript/t.v4.d.ts | 18 +- demo/stable/node_modules/konva/README.md | 18 +- .../node_modules/konva/cmj/Animation.d.ts | 24 - .../node_modules/konva/cmj/Animation.js | 145 - .../stable/node_modules/konva/cmj/Canvas.d.ts | 32 - demo/stable/node_modules/konva/cmj/Canvas.js | 114 - .../node_modules/konva/cmj/Container.d.ts | 47 - .../node_modules/konva/cmj/Container.js | 325 - .../node_modules/konva/cmj/Context.d.ts | 85 - demo/stable/node_modules/konva/cmj/Context.js | 538 - demo/stable/node_modules/konva/cmj/Core.d.ts | 3 - demo/stable/node_modules/konva/cmj/Core.js | 7 - .../node_modules/konva/cmj/DragAndDrop.d.ts | 17 - .../node_modules/konva/cmj/DragAndDrop.js | 111 - .../node_modules/konva/cmj/Factory.d.ts | 11 - demo/stable/node_modules/konva/cmj/Factory.js | 125 - .../node_modules/konva/cmj/FastLayer.d.ts | 4 - .../node_modules/konva/cmj/FastLayer.js | 16 - .../stable/node_modules/konva/cmj/Global.d.ts | 34 - demo/stable/node_modules/konva/cmj/Global.js | 61 - demo/stable/node_modules/konva/cmj/Group.d.ts | 8 - demo/stable/node_modules/konva/cmj/Group.js | 17 - demo/stable/node_modules/konva/cmj/Layer.d.ts | 61 - demo/stable/node_modules/konva/cmj/Layer.js | 309 - demo/stable/node_modules/konva/cmj/Node.d.ts | 328 - demo/stable/node_modules/konva/cmj/Node.js | 1420 - .../node_modules/konva/cmj/PointerEvents.d.ts | 11 - .../node_modules/konva/cmj/PointerEvents.js | 45 - demo/stable/node_modules/konva/cmj/Shape.d.ts | 186 - demo/stable/node_modules/konva/cmj/Shape.js | 521 - demo/stable/node_modules/konva/cmj/Stage.d.ts | 85 - demo/stable/node_modules/konva/cmj/Stage.js | 692 - demo/stable/node_modules/konva/cmj/Tween.d.ts | 86 - demo/stable/node_modules/konva/cmj/Tween.js | 520 - demo/stable/node_modules/konva/cmj/Util.d.ts | 91 - demo/stable/node_modules/konva/cmj/Util.js | 801 - .../node_modules/konva/cmj/Validators.d.ts | 11 - .../node_modules/konva/cmj/Validators.js | 192 - .../konva/cmj/_CoreInternals.d.ts | 152 - .../node_modules/konva/cmj/_CoreInternals.js | 37 - .../konva/cmj/_FullInternals.d.ts | 196 - .../node_modules/konva/cmj/_FullInternals.js | 81 - .../node_modules/konva/cmj/filters/Blur.d.ts | 2 - .../node_modules/konva/cmj/filters/Blur.js | 701 - .../konva/cmj/filters/Brighten.d.ts | 2 - .../konva/cmj/filters/Brighten.js | 16 - .../konva/cmj/filters/Contrast.d.ts | 2 - .../konva/cmj/filters/Contrast.js | 38 - .../konva/cmj/filters/Emboss.d.ts | 2 - .../node_modules/konva/cmj/filters/Emboss.js | 106 - .../konva/cmj/filters/Enhance.d.ts | 2 - .../node_modules/konva/cmj/filters/Enhance.js | 87 - .../konva/cmj/filters/Grayscale.d.ts | 2 - .../konva/cmj/filters/Grayscale.js | 13 - .../node_modules/konva/cmj/filters/HSL.d.ts | 2 - .../node_modules/konva/cmj/filters/HSL.js | 28 - .../node_modules/konva/cmj/filters/HSV.d.ts | 2 - .../node_modules/konva/cmj/filters/HSV.js | 28 - .../konva/cmj/filters/Invert.d.ts | 2 - .../node_modules/konva/cmj/filters/Invert.js | 12 - .../konva/cmj/filters/Kaleidoscope.d.ts | 2 - .../konva/cmj/filters/Kaleidoscope.js | 137 - .../node_modules/konva/cmj/filters/Mask.d.ts | 2 - .../node_modules/konva/cmj/filters/Mask.js | 144 - .../node_modules/konva/cmj/filters/Noise.d.ts | 2 - .../node_modules/konva/cmj/filters/Noise.js | 16 - .../konva/cmj/filters/Pixelate.d.ts | 2 - .../konva/cmj/filters/Pixelate.js | 64 - .../konva/cmj/filters/Posterize.d.ts | 2 - .../konva/cmj/filters/Posterize.js | 14 - .../node_modules/konva/cmj/filters/RGB.d.ts | 2 - .../node_modules/konva/cmj/filters/RGB.js | 43 - .../node_modules/konva/cmj/filters/RGBA.d.ts | 2 - .../node_modules/konva/cmj/filters/RGBA.js | 53 - .../node_modules/konva/cmj/filters/Sepia.d.ts | 2 - .../node_modules/konva/cmj/filters/Sepia.js | 15 - .../konva/cmj/filters/Solarize.d.ts | 2 - .../konva/cmj/filters/Solarize.js | 29 - .../konva/cmj/filters/Threshold.d.ts | 2 - .../konva/cmj/filters/Threshold.js | 14 - .../node_modules/konva/cmj/index-node.d.ts | 2 - .../node_modules/konva/cmj/index-node.js | 21 - .../node_modules/konva/cmj/index-types.d.ts | 181 - demo/stable/node_modules/konva/cmj/index.d.ts | 2 - demo/stable/node_modules/konva/cmj/index.js | 4 - .../node_modules/konva/cmj/package.json | 6 - .../node_modules/konva/cmj/shapes/Arc.d.ts | 26 - .../node_modules/konva/cmj/shapes/Arc.js | 59 - .../node_modules/konva/cmj/shapes/Arrow.d.ts | 26 - .../node_modules/konva/cmj/shapes/Arrow.js | 103 - .../node_modules/konva/cmj/shapes/Circle.d.ts | 14 - .../node_modules/konva/cmj/shapes/Circle.js | 37 - .../konva/cmj/shapes/Ellipse.d.ts | 17 - .../node_modules/konva/cmj/shapes/Ellipse.js | 41 - .../node_modules/konva/cmj/shapes/Image.d.ts | 25 - .../node_modules/konva/cmj/shapes/Image.js | 117 - .../node_modules/konva/cmj/shapes/Label.d.ts | 36 - .../node_modules/konva/cmj/shapes/Label.js | 178 - .../node_modules/konva/cmj/shapes/Line.d.ts | 28 - .../node_modules/konva/cmj/shapes/Line.js | 159 - .../node_modules/konva/cmj/shapes/Path.d.ts | 37 - .../node_modules/konva/cmj/shapes/Path.js | 631 - .../node_modules/konva/cmj/shapes/Rect.d.ts | 10 - .../node_modules/konva/cmj/shapes/Rect.js | 26 - .../konva/cmj/shapes/RegularPolygon.d.ts | 23 - .../konva/cmj/shapes/RegularPolygon.js | 69 - .../node_modules/konva/cmj/shapes/Ring.d.ts | 16 - .../node_modules/konva/cmj/shapes/Ring.js | 37 - .../node_modules/konva/cmj/shapes/Sprite.d.ts | 31 - .../node_modules/konva/cmj/shapes/Sprite.js | 112 - .../node_modules/konva/cmj/shapes/Star.d.ts | 18 - .../node_modules/konva/cmj/shapes/Star.js | 42 - .../node_modules/konva/cmj/shapes/Text.d.ts | 63 - .../node_modules/konva/cmj/shapes/Text.js | 373 - .../konva/cmj/shapes/TextPath.d.ts | 56 - .../node_modules/konva/cmj/shapes/TextPath.js | 351 - .../konva/cmj/shapes/Transformer.d.ts | 116 - .../konva/cmj/shapes/Transformer.js | 971 - .../node_modules/konva/cmj/shapes/Wedge.d.ts | 18 - .../node_modules/konva/cmj/shapes/Wedge.js | 42 - demo/stable/node_modules/konva/cmj/types.d.ts | 50 - demo/stable/node_modules/konva/cmj/types.js | 25 - demo/stable/node_modules/konva/konva.js | 34441 ++++++++-------- demo/stable/node_modules/konva/konva.min.js | 6 +- .../node_modules/konva/lib/Animation.d.ts | 8 +- .../node_modules/konva/lib/Animation.js | 71 +- .../konva/lib/BezierFunctions.d.ts | 6 + .../node_modules/konva/lib/BezierFunctions.js | 790 + .../stable/node_modules/konva/lib/Canvas.d.ts | 1 + demo/stable/node_modules/konva/lib/Canvas.js | 56 +- .../node_modules/konva/lib/Container.d.ts | 26 +- .../node_modules/konva/lib/Container.js | 103 +- .../node_modules/konva/lib/Context.d.ts | 66 +- demo/stable/node_modules/konva/lib/Context.js | 199 +- demo/stable/node_modules/konva/lib/Core.js | 10 +- .../node_modules/konva/lib/DragAndDrop.d.ts | 4 +- .../node_modules/konva/lib/DragAndDrop.js | 57 +- .../node_modules/konva/lib/Factory.d.ts | 3 +- demo/stable/node_modules/konva/lib/Factory.js | 65 +- .../node_modules/konva/lib/FastLayer.js | 16 +- .../stable/node_modules/konva/lib/Global.d.ts | 8 +- demo/stable/node_modules/konva/lib/Global.js | 35 +- demo/stable/node_modules/konva/lib/Group.js | 18 +- demo/stable/node_modules/konva/lib/Layer.d.ts | 8 +- demo/stable/node_modules/konva/lib/Layer.js | 102 +- demo/stable/node_modules/konva/lib/Node.d.ts | 49 +- demo/stable/node_modules/konva/lib/Node.js | 411 +- .../node_modules/konva/lib/PointerEvents.d.ts | 2 +- .../node_modules/konva/lib/PointerEvents.js | 21 +- demo/stable/node_modules/konva/lib/Shape.d.ts | 20 +- demo/stable/node_modules/konva/lib/Shape.js | 282 +- demo/stable/node_modules/konva/lib/Stage.d.ts | 18 +- demo/stable/node_modules/konva/lib/Stage.js | 199 +- demo/stable/node_modules/konva/lib/Tween.d.ts | 6 +- demo/stable/node_modules/konva/lib/Tween.js | 86 +- demo/stable/node_modules/konva/lib/Util.d.ts | 82 +- demo/stable/node_modules/konva/lib/Util.js | 180 +- .../node_modules/konva/lib/Validators.d.ts | 18 +- .../node_modules/konva/lib/Validators.js | 105 +- .../konva/lib/_CoreInternals.d.ts | 96 +- .../node_modules/konva/lib/_CoreInternals.js | 69 +- .../konva/lib/_FullInternals.d.ts | 96 +- .../node_modules/konva/lib/_FullInternals.js | 153 +- .../node_modules/konva/lib/filters/Blur.js | 587 +- .../konva/lib/filters/Brighten.js | 16 +- .../konva/lib/filters/Contrast.js | 18 +- .../node_modules/konva/lib/filters/Emboss.js | 62 +- .../node_modules/konva/lib/filters/Enhance.js | 22 +- .../konva/lib/filters/Grayscale.js | 8 +- .../node_modules/konva/lib/filters/HSL.js | 30 +- .../node_modules/konva/lib/filters/HSV.js | 32 +- .../node_modules/konva/lib/filters/Invert.js | 8 +- .../konva/lib/filters/Kaleidoscope.js | 60 +- .../node_modules/konva/lib/filters/Mask.js | 128 +- .../node_modules/konva/lib/filters/Noise.js | 18 +- .../konva/lib/filters/Pixelate.js | 20 +- .../konva/lib/filters/Posterize.js | 16 +- .../node_modules/konva/lib/filters/RGB.js | 20 +- .../node_modules/konva/lib/filters/RGBA.js | 26 +- .../node_modules/konva/lib/filters/Sepia.js | 8 +- .../konva/lib/filters/Solarize.js | 21 +- .../konva/lib/filters/Threshold.js | 18 +- .../node_modules/konva/lib/index-node.js | 12 +- .../node_modules/konva/lib/index-types.d.ts | 18 +- demo/stable/node_modules/konva/lib/index.js | 6 +- .../node_modules/konva/lib/shapes/Arc.js | 30 +- .../node_modules/konva/lib/shapes/Arrow.js | 50 +- .../node_modules/konva/lib/shapes/Circle.js | 18 +- .../node_modules/konva/lib/shapes/Ellipse.js | 24 +- .../node_modules/konva/lib/shapes/Image.js | 47 +- .../node_modules/konva/lib/shapes/Label.d.ts | 2 +- .../node_modules/konva/lib/shapes/Label.js | 43 +- .../node_modules/konva/lib/shapes/Line.d.ts | 2 +- .../node_modules/konva/lib/shapes/Line.js | 50 +- .../node_modules/konva/lib/shapes/Path.d.ts | 32 +- .../node_modules/konva/lib/shapes/Path.js | 277 +- .../node_modules/konva/lib/shapes/Rect.js | 24 +- .../konva/lib/shapes/RegularPolygon.d.ts | 8 +- .../konva/lib/shapes/RegularPolygon.js | 32 +- .../node_modules/konva/lib/shapes/Ring.js | 22 +- .../node_modules/konva/lib/shapes/Sprite.js | 52 +- .../node_modules/konva/lib/shapes/Star.js | 32 +- .../node_modules/konva/lib/shapes/Text.d.ts | 18 +- .../node_modules/konva/lib/shapes/Text.js | 193 +- .../konva/lib/shapes/TextPath.d.ts | 18 +- .../node_modules/konva/lib/shapes/TextPath.js | 316 +- .../konva/lib/shapes/Transformer.d.ts | 20 +- .../konva/lib/shapes/Transformer.js | 376 +- .../node_modules/konva/lib/shapes/Wedge.js | 28 +- demo/stable/node_modules/konva/lib/types.d.ts | 6 + demo/stable/node_modules/konva/lib/types.js | 7 +- demo/stable/node_modules/konva/package.json | 68 +- demo/stable/package.json | 22 +- demo/stable/readme.md | 2 +- demo/stable/service-worker.js | 2 +- demo/stable/src/applauncher.js | 5 +- demo/stable/src/gui/colourMap.js | 6 +- demo/stable/src/gui/custom.js | 14 +- demo/stable/src/gui/filter.js | 7 +- demo/stable/src/gui/generic.js | 119 +- demo/stable/src/gui/help.js | 12 +- demo/stable/src/gui/plot.js | 6 +- demo/stable/src/gui/tools.js | 2 +- demo/stable/yarn.lock | 789 +- 275 files changed, 27680 insertions(+), 37506 deletions(-) create mode 100644 demo/stable/eslint.config.mjs delete mode 100644 demo/stable/node_modules/konva/cmj/Animation.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/Animation.js delete mode 100644 demo/stable/node_modules/konva/cmj/Canvas.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/Canvas.js delete mode 100644 demo/stable/node_modules/konva/cmj/Container.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/Container.js delete mode 100644 demo/stable/node_modules/konva/cmj/Context.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/Context.js delete mode 100644 demo/stable/node_modules/konva/cmj/Core.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/Core.js delete mode 100644 demo/stable/node_modules/konva/cmj/DragAndDrop.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/DragAndDrop.js delete mode 100644 demo/stable/node_modules/konva/cmj/Factory.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/Factory.js delete mode 100644 demo/stable/node_modules/konva/cmj/FastLayer.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/FastLayer.js delete mode 100644 demo/stable/node_modules/konva/cmj/Global.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/Global.js delete mode 100644 demo/stable/node_modules/konva/cmj/Group.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/Group.js delete mode 100644 demo/stable/node_modules/konva/cmj/Layer.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/Layer.js delete mode 100644 demo/stable/node_modules/konva/cmj/Node.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/Node.js delete mode 100644 demo/stable/node_modules/konva/cmj/PointerEvents.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/PointerEvents.js delete mode 100644 demo/stable/node_modules/konva/cmj/Shape.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/Shape.js delete mode 100644 demo/stable/node_modules/konva/cmj/Stage.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/Stage.js delete mode 100644 demo/stable/node_modules/konva/cmj/Tween.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/Tween.js delete mode 100644 demo/stable/node_modules/konva/cmj/Util.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/Util.js delete mode 100644 demo/stable/node_modules/konva/cmj/Validators.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/Validators.js delete mode 100644 demo/stable/node_modules/konva/cmj/_CoreInternals.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/_CoreInternals.js delete mode 100644 demo/stable/node_modules/konva/cmj/_FullInternals.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/_FullInternals.js delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Blur.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Blur.js delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Brighten.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Brighten.js delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Contrast.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Contrast.js delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Emboss.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Emboss.js delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Enhance.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Enhance.js delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Grayscale.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Grayscale.js delete mode 100644 demo/stable/node_modules/konva/cmj/filters/HSL.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/filters/HSL.js delete mode 100644 demo/stable/node_modules/konva/cmj/filters/HSV.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/filters/HSV.js delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Invert.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Invert.js delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Kaleidoscope.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Kaleidoscope.js delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Mask.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Mask.js delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Noise.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Noise.js delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Pixelate.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Pixelate.js delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Posterize.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Posterize.js delete mode 100644 demo/stable/node_modules/konva/cmj/filters/RGB.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/filters/RGB.js delete mode 100644 demo/stable/node_modules/konva/cmj/filters/RGBA.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/filters/RGBA.js delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Sepia.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Sepia.js delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Solarize.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Solarize.js delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Threshold.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/filters/Threshold.js delete mode 100644 demo/stable/node_modules/konva/cmj/index-node.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/index-node.js delete mode 100644 demo/stable/node_modules/konva/cmj/index-types.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/index.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/index.js delete mode 100644 demo/stable/node_modules/konva/cmj/package.json delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Arc.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Arc.js delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Arrow.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Arrow.js delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Circle.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Circle.js delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Ellipse.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Ellipse.js delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Image.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Image.js delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Label.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Label.js delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Line.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Line.js delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Path.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Path.js delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Rect.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Rect.js delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/RegularPolygon.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/RegularPolygon.js delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Ring.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Ring.js delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Sprite.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Sprite.js delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Star.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Star.js delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Text.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Text.js delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/TextPath.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/TextPath.js delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Transformer.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Transformer.js delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Wedge.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/shapes/Wedge.js delete mode 100644 demo/stable/node_modules/konva/cmj/types.d.ts delete mode 100644 demo/stable/node_modules/konva/cmj/types.js create mode 100644 demo/stable/node_modules/konva/lib/BezierFunctions.d.ts create mode 100644 demo/stable/node_modules/konva/lib/BezierFunctions.js diff --git a/demo/stable/Gruntfile.js b/demo/stable/Gruntfile.js index 95e5bfc3..ebdb1ad4 100644 --- a/demo/stable/Gruntfile.js +++ b/demo/stable/Gruntfile.js @@ -2,14 +2,6 @@ module.exports = function (grunt) { // Project configuration grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), - eslint: { - files: [ - 'Gruntfile.js', - 'service-worker.js', - 'src/**/*.js', - '!src/utils/modernizr.js' - ] - }, copy: { dev: { src: 'index.html', @@ -67,11 +59,8 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-connect'); grunt.loadNpmTasks('grunt-contrib-watch'); - grunt.loadNpmTasks('grunt-eslint'); // Task to run tests - grunt.registerTask('lint', ['eslint']); - grunt.registerTask('test', ['eslint']); grunt.registerTask('start', ['connect:prod', 'watch']); grunt.registerTask('dev', ['copy:dev', 'connect:dev', 'watch']); }; diff --git a/demo/stable/eslint.config.mjs b/demo/stable/eslint.config.mjs new file mode 100644 index 00000000..69839b61 --- /dev/null +++ b/demo/stable/eslint.config.mjs @@ -0,0 +1,126 @@ +import globals from 'globals'; +import js from '@eslint/js'; +import stylisticJs from '@stylistic/eslint-plugin-js'; + +export default [ + js.configs.recommended, + { + languageOptions: { + globals: { + ...globals.browser, + ...globals.node, + ...globals.jquery, + dwv: 'readonly', + }, + }, + plugins: { + '@stylistic/js': stylisticJs + }, + rules: { + // require triple equal + // https://eslint.org/docs/rules/eqeqeq + eqeqeq: 'error', + // force using curly braces + // https://eslint.org/docs/rules/curly + curly: 'error', + // no var + // https://eslint.org/docs/rules/no-var + //'no-var': 'error', + // prefer const + // https://eslint.org/docs/rules/prefer-const + //'prefer-const': 'error', + // allow for some unused args + // https://eslint.org/docs/rules/no-unused-vars + 'no-unused-vars': ['error', {argsIgnorePattern: '^_'}], + + // formatting rules + + // force semi colon + // https://eslint.style/rules/js/semi + '@stylistic/js/semi': ['error'], + // force 2 space indent (default: 4) + // https://eslint.style/rules/js/indent + '@stylistic/js/indent': ['error', 2], + // force single quotes (default 'double') + // https://eslint.style/rules/js/quotes + '@stylistic/js/quotes': ['error', 'single'], + // no space for named functions (default 'always') + // https://eslint.style/rules/js/space-before-function-paren + '@stylistic/js/space-before-function-paren': ['error', {named: 'never'}], + // newline at object curly + // https://eslint.style/rules/js/object-curly-newline + '@stylistic/js/object-curly-newline': ['error', {consistent: true}], + // newline at object properties + // https://eslint.style/rules/js/object-property-newline + '@stylistic/js/object-property-newline': [ + 'error', {allowAllPropertiesOnSameLine: true} + ], + // newline at array brackets + // https://eslint.style/rules/js/array-bracket-newline + '@stylistic/js/array-bracket-newline': ['error', 'consistent'], + // newline at array elements (default: always) + // https://eslint.style/rules/js/array-element-newline + '@stylistic/js/array-element-newline': ['error', 'consistent'], + // force 'one true brace style' (1tbs) + // https://eslint.style/rules/js/brace-style + '@stylistic/js/brace-style': 'error', + // give error for long lines (default: 80) + // https://eslint.style/rules/js/max-len + '@stylistic/js/max-len': [ + 'error', {ignoreRegExpLiterals: true, ignoreUrls: true} + ], + // spaces in parenthesis (default: never) + // https://eslint.style/rules/js/space-in-parens + '@stylistic/js/space-in-parens': 'error', + // space before blocks + // https://eslint.style/rules/js/space-before-blocks + '@stylistic/js/space-before-blocks': 'error', + // spaces inside brackets (default: never) + // https://eslint.style/rules/js/array-bracket-spacing + '@stylistic/js/array-bracket-spacing': 'error', + // spaces in curly (default: never) + // https://eslint.style/rules/js/object-curly-spacing + '@stylistic/js/object-curly-spacing': 'error', + // no space in computed properties (default: never) + // https://eslint.style/rules/js/computed-property-spacing + '@stylistic/js/computed-property-spacing': 'error', + // spaces around comma (default: {"before": false, "after": true}) + // https://eslint.style/rules/js/comma-spacing + '@stylistic/js/comma-spacing': 'error', + // space around unary operator + // https://eslint.style/rules/js/space-unary-ops + '@stylistic/js/space-unary-ops': 'error', + // space around operator + // https://eslint.style/rules/js/space-infix-ops + '@stylistic/js/space-infix-ops': 'error', + // space around keywords (default: {'before': true, 'after': true}) + // https://eslint.style/rules/js/keyword-spacing + '@stylistic/js/keyword-spacing': 'error', + // no space before function call (default: never) + // https://eslint.style/rules/js/function-call-spacing + '@stylistic/js/func-call-spacing': 'error', + // spacing around colon + // (default: {'beforeColon': false, 'afterColon': true}) + // https://eslint.style/rules/js/key-spacing + '@stylistic/js/key-spacing': 'error', + // spacing around semi-colon + // https://eslint.style/rules/js/semi-spacing + '@stylistic/js/semi-spacing': 'error', + // no trailing spaces + // https://eslint.style/rules/js/no-trailing-spaces + '@stylistic/js/no-trailing-spaces': 'error', + // no multi spaces + // https://eslint.style/rules/js/no-multi-spaces + '@stylistic/js/no-multi-spaces': 'error', + // no space for named functions (default {'max': 2}) + // https://eslint.style/rules/js/no-multiple-empty-lines + '@stylistic/js/no-multiple-empty-lines': 'error', + // linebreak after operator + // https://eslint.style/rules/js/operator-linebreak + '@stylistic/js/operator-linebreak': 'error', + // quotes around object property names + // https://eslint.style/rules/js/quote-props + '@stylistic/js/quote-props': ['error', 'as-needed'] + }, + } +]; diff --git a/demo/stable/node_modules/.yarn-integrity b/demo/stable/node_modules/.yarn-integrity index 8ef477b2..df207a39 100644 --- a/demo/stable/node_modules/.yarn-integrity +++ b/demo/stable/node_modules/.yarn-integrity @@ -1,5 +1,5 @@ { - "systemParams": "linux-x64-108", + "systemParams": "linux-x64-115", "modulesFolders": [ "node_modules" ], @@ -8,63 +8,67 @@ ], "linkedModules": [], "topLevelPatterns": [ - "dwv@0.32.4", + "@eslint/js@^9.4.0", + "@stylistic/eslint-plugin-js@^2.1.0", + "dwv@0.34.0", + "eslint@^9.4.0", + "globals@^15.4.0", "grunt-cli@^1.4.2", - "grunt-contrib-connect@^4.0.0", + "grunt-contrib-connect@^5.0.0", "grunt-contrib-copy@^1.0.0", "grunt-contrib-watch@^1.1.0", - "grunt-eslint@^24.0.0", "grunt@^1.4.0", - "i18next-browser-languagedetector@~7.2.0", - "i18next-http-backend@~2.5.0", - "i18next@~23.11.2", + "i18next-browser-languagedetector@~8.0.0", + "i18next-http-backend@~2.6.0", + "i18next@~23.16.0", "jquery@3.4.1" ], "lockfileEntries": { "@aashutoshrathi/word-wrap@^1.2.3": "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf", "@babel/runtime@^7.23.2": "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.2.tgz#062b0ac103261d68a966c4c7baf2ae3e62ec3885", "@eslint-community/eslint-utils@^4.2.0": "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59", - "@eslint-community/regexpp@^4.4.0": "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.5.1.tgz#cdd35dce4fa1a89a4fd42b1599eb35b3af408884", - "@eslint/eslintrc@^2.1.0": "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.0.tgz#82256f164cc9e0b59669efc19d57f8092706841d", - "@eslint/js@8.44.0": "https://registry.yarnpkg.com/@eslint/js/-/js-8.44.0.tgz#961a5903c74139390478bdc808bcde3fc45ab7af", - "@humanwhocodes/config-array@^0.11.10": "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.10.tgz#5a3ffe32cc9306365fb3fd572596cd602d5e12d2", + "@eslint-community/regexpp@^4.12.1": "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.1.tgz#cfc6cffe39df390a3841cde2abccf92eaa7ae0e0", + "@eslint/config-array@^0.19.0": "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.19.0.tgz#3251a528998de914d59bb21ba4c11767cf1b3519", + "@eslint/core@^0.9.0": "https://registry.yarnpkg.com/@eslint/core/-/core-0.9.0.tgz#168ee076f94b152c01ca416c3e5cf82290ab4fcd", + "@eslint/eslintrc@^3.2.0": "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.2.0.tgz#57470ac4e2e283a6bf76044d63281196e370542c", + "@eslint/js@9.15.0": "https://registry.yarnpkg.com/@eslint/js/-/js-9.15.0.tgz#df0e24fe869143b59731942128c19938fdbadfb5", + "@eslint/js@^9.4.0": "https://registry.yarnpkg.com/@eslint/js/-/js-9.15.0.tgz#df0e24fe869143b59731942128c19938fdbadfb5", + "@eslint/object-schema@^2.1.4": "https://registry.yarnpkg.com/@eslint/object-schema/-/object-schema-2.1.4.tgz#9e69f8bb4031e11df79e03db09f9dbbae1740843", + "@eslint/plugin-kit@^0.2.3": "https://registry.yarnpkg.com/@eslint/plugin-kit/-/plugin-kit-0.2.3.tgz#812980a6a41ecf3a8341719f92a6d1e784a2e0e8", + "@humanfs/core@^0.19.1": "https://registry.yarnpkg.com/@humanfs/core/-/core-0.19.1.tgz#17c55ca7d426733fe3c561906b8173c336b40a77", + "@humanfs/node@^0.16.6": "https://registry.yarnpkg.com/@humanfs/node/-/node-0.16.6.tgz#ee2a10eaabd1131987bf0488fd9b820174cd765e", "@humanwhocodes/module-importer@^1.0.1": "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c", - "@humanwhocodes/object-schema@^1.2.1": "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45", - "@nodelib/fs.scandir@2.1.5": "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5", - "@nodelib/fs.stat@2.0.5": "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b", - "@nodelib/fs.walk@^1.2.8": "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a", + "@humanwhocodes/retry@^0.3.0": "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.3.1.tgz#c72a5c76a9fbaf3488e231b13dc52c0da7bab42a", + "@humanwhocodes/retry@^0.4.1": "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.4.1.tgz#9a96ce501bc62df46c4031fbd970e3cc6b10f07b", + "@stylistic/eslint-plugin-js@^2.1.0": "https://registry.yarnpkg.com/@stylistic/eslint-plugin-js/-/eslint-plugin-js-2.10.1.tgz#96e5b8daaa7da5565cb6e11802896475ce1852fe", + "@types/estree@^1.0.6": "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50", + "@types/json-schema@^7.0.15": "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841", "abbrev@1": "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8", "accepts@~1.3.4": "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd", "acorn-jsx@^5.3.2": "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937", - "acorn@^8.9.0": "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5", - "ajv@^6.10.0": "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4", + "acorn@^8.14.0": "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0", "ajv@^6.12.4": "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4", "ansi-regex@^2.0.0": "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df", - "ansi-regex@^5.0.1": "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304", "ansi-styles@^2.2.1": "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe", "ansi-styles@^4.1.0": "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937", "argparse@^1.0.7": "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911", "argparse@^2.0.1": "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38", "array-each@^1.0.1": "https://registry.yarnpkg.com/array-each/-/array-each-1.0.1.tgz#a794af0c05ab1752846ee753a1f211a05ba0c44f", "array-slice@^1.0.0": "https://registry.yarnpkg.com/array-slice/-/array-slice-1.1.0.tgz#e368ea15f89bc7069f7ffb89aec3a6c7d4ac22d4", - "assert@1.4.1": "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91", - "async-limiter@~1.0.0": "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd", "async@^2.6.0": "https://registry.yarnpkg.com/async/-/async-2.6.4.tgz#706b7ff6084664cd7eae713f6f965433b5504221", - "async@^3.2.0": "https://registry.yarnpkg.com/async/-/async-3.2.0.tgz#b3a2685c5ebb641d3de02d161002c60fc9f85720", - "async@~3.2.0": "https://registry.yarnpkg.com/async/-/async-3.2.0.tgz#b3a2685c5ebb641d3de02d161002c60fc9f85720", + "async@^3.2.5": "https://registry.yarnpkg.com/async/-/async-3.2.5.tgz#ebd52a8fdaf7a2289a24df399f8d8485c8a46b66", + "async@~3.2.0": "https://registry.yarnpkg.com/async/-/async-3.2.5.tgz#ebd52a8fdaf7a2289a24df399f8d8485c8a46b66", "balanced-match@^1.0.0": "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee", "basic-auth@~2.0.1": "https://registry.yarnpkg.com/basic-auth/-/basic-auth-2.0.1.tgz#b998279bf47ce38344b4f3cf916d4679bbf51e3a", "batch@0.6.1": "https://registry.yarnpkg.com/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16", "body@^5.1.0": "https://registry.yarnpkg.com/body/-/body-5.1.0.tgz#e4ba0ce410a46936323367609ecb4e6553125069", "brace-expansion@^1.1.7": "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd", - "braces@^3.0.1": "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107", - "braces@^3.0.2": "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107", + "braces@^3.0.3": "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789", "bytes@1": "https://registry.yarnpkg.com/bytes/-/bytes-1.0.0.tgz#3569ede8ba34315fab99c3e92cb04c7220de1fa8", "call-bind@^1.0.0": "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c", "callsites@^3.0.0": "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73", "chalk@^1.1.1": "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98", "chalk@^4.0.0": "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01", - "chalk@^4.1.2": "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01", "chalk@~4.1.0": "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01", "color-convert@^2.0.1": "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3", "color-name@~1.1.4": "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2", @@ -75,42 +79,41 @@ "continuable-cache@^0.3.1": "https://registry.yarnpkg.com/continuable-cache/-/continuable-cache-0.3.1.tgz#bd727a7faed77e71ff3985ac93351a912733ad0f", "core-util-is@~1.0.0": "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7", "cross-fetch@4.0.0": "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-4.0.0.tgz#f037aef1580bb3a1a35164ea2a848ba81b445983", - "cross-spawn@^7.0.2": "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6", + "cross-spawn@^7.0.5": "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.5.tgz#910aac880ff5243da96b728bc6521a5f6c2f2f82", "dateformat@~4.6.2": "https://registry.yarnpkg.com/dateformat/-/dateformat-4.6.3.tgz#556fa6497e5217fedb78821424f8a1c22fa3f4b5", "debug@2.6.9": "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f", "debug@^3.1.0": "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a", - "debug@^4.1.1": "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee", - "debug@^4.3.2": "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b", + "debug@^4.3.1": "https://registry.yarnpkg.com/debug/-/debug-4.3.5.tgz#e83444eceb9fedd4a1da56d671ae2446a01a6e1e", + "debug@^4.3.2": "https://registry.yarnpkg.com/debug/-/debug-4.3.5.tgz#e83444eceb9fedd4a1da56d671ae2446a01a6e1e", "deep-is@^0.1.3": "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34", "define-lazy-prop@^2.0.0": "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f", + "depd@2.0.0": "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df", "depd@~1.1.2": "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9", "depd@~2.0.0": "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df", - "destroy@~1.0.4": "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80", + "destroy@1.2.0": "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015", "detect-file@^1.0.0": "https://registry.yarnpkg.com/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7", - "doctrine@^3.0.0": "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961", - "duplexify@^3.5.1": "https://registry.yarnpkg.com/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309", - "dwv@0.32.4": "https://registry.yarnpkg.com/dwv/-/dwv-0.32.4.tgz#b2d331f3d4fba1c3743bdaff5ebdb1af66a60046", + "dwv@0.34.0": "https://registry.yarnpkg.com/dwv/-/dwv-0.34.0.tgz#d4b5a137fa72bfb2c4d30ae1bb0bcb5f7778e1b7", "ee-first@1.1.1": "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d", "encodeurl@~1.0.2": "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59", - "end-of-stream@^1.0.0": "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0", + "encodeurl@~2.0.0": "https://registry.yarnpkg.com/encodeurl/-/encodeurl-2.0.0.tgz#7b8ea898077d7e409d3ac45474ea38eaf0857a58", "error@^7.0.0": "https://registry.yarnpkg.com/error/-/error-7.2.1.tgz#eab21a4689b5f684fc83da84a0e390de82d94894", "escape-html@~1.0.3": "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988", "escape-string-regexp@^1.0.2": "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4", "escape-string-regexp@^4.0.0": "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34", - "eslint-scope@^7.2.0": "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.0.tgz#f21ebdafda02352f103634b96dd47d9f81ca117b", + "eslint-scope@^8.2.0": "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.2.0.tgz#377aa6f1cb5dc7592cfd0b7f892fd0cf352ce442", "eslint-visitor-keys@^3.3.0": "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz#c22c48f48942d08ca824cc526211ae400478a994", - "eslint-visitor-keys@^3.4.1": "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz#c22c48f48942d08ca824cc526211ae400478a994", - "eslint@^8.44.0": "https://registry.yarnpkg.com/eslint/-/eslint-8.45.0.tgz#bab660f90d18e1364352c0a6b7c6db8edb458b78", - "espree@^9.6.0": "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f", + "eslint-visitor-keys@^4.2.0": "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz#687bacb2af884fcdda8a6e7d65c606f46a14cd45", + "eslint@^9.4.0": "https://registry.yarnpkg.com/eslint/-/eslint-9.15.0.tgz#77c684a4e980e82135ebff8ee8f0a9106ce6b8a6", + "espree@^10.0.1": "https://registry.yarnpkg.com/espree/-/espree-10.3.0.tgz#29267cf5b0cb98735b65e64ba07e0ed49d1eed8a", + "espree@^10.3.0": "https://registry.yarnpkg.com/espree/-/espree-10.3.0.tgz#29267cf5b0cb98735b65e64ba07e0ed49d1eed8a", "esprima@^4.0.0": "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71", - "esquery@^1.4.2": "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b", + "esquery@^1.5.0": "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b", "esrecurse@^4.3.0": "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921", "estraverse@^5.1.0": "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880", "estraverse@^5.2.0": "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880", "esutils@^2.0.2": "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64", "etag@~1.8.1": "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887", "eventemitter2@~0.4.13": "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-0.4.14.tgz#8f61b75cde012b2e9eb284d4545583b5643b61ab", - "events@1.1.1": "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924", "exit@~0.1.2": "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c", "expand-tilde@^2.0.0": "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-2.0.2.tgz#97e801aa052df02454de46b02bf621642cdc8502", "expand-tilde@^2.0.2": "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-2.0.2.tgz#97e801aa052df02454de46b02bf621642cdc8502", @@ -119,19 +122,18 @@ "fast-deep-equal@^3.1.3": "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525", "fast-json-stable-stringify@^2.0.0": "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633", "fast-levenshtein@^2.0.6": "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917", - "fastq@^1.6.0": "https://registry.yarnpkg.com/fastq/-/fastq-1.15.0.tgz#d04d07c6a2a68fe4599fea8d2e103a937fae6b3a", "faye-websocket@~0.10.0": "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.10.0.tgz#4e492f8d04dfb6f89003507f6edbf2d501e7c6f4", - "file-entry-cache@^6.0.1": "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027", + "file-entry-cache@^8.0.0": "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-8.0.0.tgz#7787bddcf1131bffb92636c69457bbc0edd6d81f", "file-sync-cmp@^0.1.0": "https://registry.yarnpkg.com/file-sync-cmp/-/file-sync-cmp-0.1.1.tgz#a5e7a8ffbfa493b43b923bbd4ca89a53b63b612b", - "fill-range@^7.0.1": "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40", + "fill-range@^7.1.1": "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292", "finalhandler@1.1.2": "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d", "find-up@^5.0.0": "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc", "findup-sync@^4.0.0": "https://registry.yarnpkg.com/findup-sync/-/findup-sync-4.0.0.tgz#956c9cdde804052b881b428512905c4a5f2cdef0", "findup-sync@~5.0.0": "https://registry.yarnpkg.com/findup-sync/-/findup-sync-5.0.0.tgz#54380ad965a7edca00cc8f63113559aadc541bd2", "fined@^1.2.0": "https://registry.yarnpkg.com/fined/-/fined-1.2.0.tgz#d00beccf1aa2b475d16d423b0238b713a2c4a37b", "flagged-respawn@^1.0.1": "https://registry.yarnpkg.com/flagged-respawn/-/flagged-respawn-1.0.1.tgz#e7de6f1279ddd9ca9aac8a5971d618606b3aab41", - "flat-cache@^3.0.4": "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11", - "flatted@^3.1.0": "https://registry.yarnpkg.com/flatted/-/flatted-3.1.1.tgz#c4b489e80096d9df1dfc97c79871aea7c617c469", + "flat-cache@^4.0.0": "https://registry.yarnpkg.com/flat-cache/-/flat-cache-4.0.1.tgz#0ece39fcb14ee012f4b0410bd33dd9c1f011127c", + "flatted@^3.2.9": "https://registry.yarnpkg.com/flatted/-/flatted-3.3.1.tgz#21db470729a6734d4997002f439cb308987f567a", "for-in@^1.0.1": "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80", "for-own@^1.0.0": "https://registry.yarnpkg.com/for-own/-/for-own-1.0.0.tgz#c63332f415cedc4b04dbfe70cf836494c53cb44b", "fresh@0.5.2": "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7", @@ -141,20 +143,18 @@ "get-intrinsic@^1.0.2": "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.3.tgz#063c84329ad93e83893c7f4f243ef63ffa351385", "getobject@~1.0.0": "https://registry.yarnpkg.com/getobject/-/getobject-1.0.0.tgz#27eeb6394716cfb6adcef275a33c2752df9ca49a", "glob-parent@^6.0.2": "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3", - "glob@^7.1.3": "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6", "glob@~7.1.1": "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6", "glob@~7.1.6": "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6", "global-modules@^1.0.0": "https://registry.yarnpkg.com/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea", "global-prefix@^1.0.1": "https://registry.yarnpkg.com/global-prefix/-/global-prefix-1.0.2.tgz#dbf743c6c14992593c655568cb66ed32c0122ebe", - "globals@^13.19.0": "https://registry.yarnpkg.com/globals/-/globals-13.20.0.tgz#ea276a1e508ffd4f1612888f9d1bad1e2717bf82", + "globals@^14.0.0": "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e", + "globals@^15.4.0": "https://registry.yarnpkg.com/globals/-/globals-15.12.0.tgz#1811872883ad8f41055b61457a130221297de5b5", "globule@^1.0.0": "https://registry.yarnpkg.com/globule/-/globule-1.3.2.tgz#d8bdd9e9e4eef8f96e245999a5dee7eb5d8529c4", - "graphemer@^1.4.0": "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6", - "grunt-cli@^1.4.2": "https://registry.yarnpkg.com/grunt-cli/-/grunt-cli-1.4.3.tgz#22c9f1a3d2780bf9b0d206e832e40f8f499175ff", + "grunt-cli@^1.4.2": "https://registry.yarnpkg.com/grunt-cli/-/grunt-cli-1.5.0.tgz#24fa92225946b2002c535c7583a003e15203876f", "grunt-cli@~1.4.3": "https://registry.yarnpkg.com/grunt-cli/-/grunt-cli-1.4.3.tgz#22c9f1a3d2780bf9b0d206e832e40f8f499175ff", - "grunt-contrib-connect@^4.0.0": "https://registry.yarnpkg.com/grunt-contrib-connect/-/grunt-contrib-connect-4.0.0.tgz#b0ccc748ef3c1f51dd2ae21aceea0666456211a5", + "grunt-contrib-connect@^5.0.0": "https://registry.yarnpkg.com/grunt-contrib-connect/-/grunt-contrib-connect-5.0.1.tgz#c8cc828a3c806520d9126377870b62eeb8bd2f92", "grunt-contrib-copy@^1.0.0": "https://registry.yarnpkg.com/grunt-contrib-copy/-/grunt-contrib-copy-1.0.0.tgz#7060c6581e904b8ab0d00f076e0a8f6e3e7c3573", "grunt-contrib-watch@^1.1.0": "https://registry.yarnpkg.com/grunt-contrib-watch/-/grunt-contrib-watch-1.1.0.tgz#c143ca5b824b288a024b856639a5345aedb78ed4", - "grunt-eslint@^24.0.0": "https://registry.yarnpkg.com/grunt-eslint/-/grunt-eslint-24.3.0.tgz#2b82d107f6963de91daf58cf8311221a806a6de5", "grunt-known-options@~2.0.0": "https://registry.yarnpkg.com/grunt-known-options/-/grunt-known-options-2.0.0.tgz#cac641e897f9a0a680b8c9839803d35f3325103c", "grunt-legacy-log-utils@~2.1.0": "https://registry.yarnpkg.com/grunt-legacy-log-utils/-/grunt-legacy-log-utils-2.1.0.tgz#49a8c7dc74051476dcc116c32faf9db8646856ef", "grunt-legacy-log@~3.0.0": "https://registry.yarnpkg.com/grunt-legacy-log/-/grunt-legacy-log-3.0.0.tgz#1c6eaf92371ea415af31ea84ce50d434ef6d39c4", @@ -166,13 +166,13 @@ "has@^1.0.3": "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796", "homedir-polyfill@^1.0.1": "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8", "hooker@~0.2.3": "https://registry.yarnpkg.com/hooker/-/hooker-0.2.3.tgz#b834f723cc4a242aa65963459df6d984c5d3d959", + "http-errors@2.0.0": "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3", "http-errors@~1.6.2": "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d", - "http-errors@~1.7.2": "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06", "http-parser-js@>=0.5.1": "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.3.tgz#01d2709c79d41698bb01d4decc5e9da4e4a033d9", - "https-browserify@0.0.1": "https://registry.yarnpkg.com/https-browserify/-/https-browserify-0.0.1.tgz#3f91365cabe60b77ed0ebba24b454e3e09d95a82", - "i18next-browser-languagedetector@~7.2.0": "https://registry.yarnpkg.com/i18next-browser-languagedetector/-/i18next-browser-languagedetector-7.2.1.tgz#1968196d437b4c8db847410c7c33554f6c448f6f", - "i18next-http-backend@~2.5.0": "https://registry.yarnpkg.com/i18next-http-backend/-/i18next-http-backend-2.5.0.tgz#8396a7df30bfe722eff7a65f629df32a61720414", - "i18next@~23.11.2": "https://registry.yarnpkg.com/i18next/-/i18next-23.11.2.tgz#4c0e8192a9ba230fe7dc68b76459816ab601826e", + "http2-wrapper@^2.2.1": "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-2.2.1.tgz#310968153dcdedb160d8b72114363ef5fce1f64a", + "i18next-browser-languagedetector@~8.0.0": "https://registry.yarnpkg.com/i18next-browser-languagedetector/-/i18next-browser-languagedetector-8.0.0.tgz#b6fdd9b43af67c47f2c26c9ba27710a1eaf31e2f", + "i18next-http-backend@~2.6.0": "https://registry.yarnpkg.com/i18next-http-backend/-/i18next-http-backend-2.6.2.tgz#b25516446ae6f251ce8231e70e6ffbca833d46a5", + "i18next@~23.16.0": "https://registry.yarnpkg.com/i18next/-/i18next-23.16.5.tgz#53d48ae9f985fd73fc1fcb96e6c7d90ababf0831", "iconv-lite@~0.6.3": "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501", "ignore@^5.2.0": "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324", "immediate@~3.0.5": "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b", @@ -180,11 +180,8 @@ "imurmurhash@^0.1.4": "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea", "inflight@^1.0.4": "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9", "inherits@2": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c", - "inherits@2.0.1": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1", "inherits@2.0.3": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de", "inherits@2.0.4": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c", - "inherits@^2.0.1": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c", - "inherits@~2.0.1": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c", "inherits@~2.0.3": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c", "ini@^1.3.4": "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c", "interpret@~1.1.0": "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614", @@ -193,11 +190,10 @@ "is-docker@^2.0.0": "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa", "is-docker@^2.1.1": "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa", "is-extglob@^2.1.1": "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2", - "is-glob@^4.0.0": "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc", + "is-glob@^4.0.0": "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084", "is-glob@^4.0.3": "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084", "is-number-like@^1.0.3": "https://registry.yarnpkg.com/is-number-like/-/is-number-like-1.0.8.tgz#2e129620b50891042e44e9bbbb30593e75cfbbe3", "is-number@^7.0.0": "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b", - "is-path-inside@^3.0.3": "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283", "is-plain-object@^2.0.3": "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677", "is-plain-object@^2.0.4": "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677", "is-relative@^1.0.0": "https://registry.yarnpkg.com/is-relative/-/is-relative-1.0.0.tgz#a1bb6935ce8c5dba1e8b9754b9b2dcc020e2260d", @@ -211,11 +207,13 @@ "jquery@3.4.1": "https://registry.yarnpkg.com/jquery/-/jquery-3.4.1.tgz#714f1f8d9dde4bdfa55764ba37ef214630d80ef2", "js-yaml@^4.1.0": "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602", "js-yaml@~3.14.0": "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537", + "json-buffer@3.0.1": "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13", "json-schema-traverse@^0.4.1": "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660", "json-stable-stringify-without-jsonify@^1.0.1": "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651", - "jszip@~3.10.1": "https://registry.yarnpkg.com/jszip/-/jszip-3.10.1.tgz#34aee70eb18ea1faec2f589208a157d1feb091c2", + "jszip@^3.10.1": "https://registry.yarnpkg.com/jszip/-/jszip-3.10.1.tgz#34aee70eb18ea1faec2f589208a157d1feb091c2", + "keyv@^4.5.4": "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93", "kind-of@^6.0.2": "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd", - "konva@~8.4.2": "https://registry.yarnpkg.com/konva/-/konva-8.4.3.tgz#d6754fdb53e69295c24dbdfe967a27f92da51e47", + "konva@~9.3.16": "https://registry.yarnpkg.com/konva/-/konva-9.3.16.tgz#0e8b52e8cb20c80c5e4cb98d0babd89ff6f95a2c", "levn@^0.4.1": "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade", "lie@~3.3.0": "https://registry.yarnpkg.com/lie/-/lie-3.3.0.tgz#dcf82dee545f46074daf200c7c1c5a08e0f40f6a", "liftup@~3.0.1": "https://registry.yarnpkg.com/liftup/-/liftup-3.0.1.tgz#1cb81aff0f368464ed3a5f1a7286372d6b1a60ce", @@ -231,37 +229,36 @@ "magic-wand-tool@~1.1.7": "https://registry.yarnpkg.com/magic-wand-tool/-/magic-wand-tool-1.1.7.tgz#c1d49c5f26307bec06eb8c6ac51e03fff5b9d61b", "make-iterator@^1.0.0": "https://registry.yarnpkg.com/make-iterator/-/make-iterator-1.0.1.tgz#29b33f312aa8f547c4a5e490f56afcec99133ad6", "map-cache@^0.2.0": "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf", - "micromatch@^4.0.2": "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9", - "micromatch@^4.0.4": "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6", + "micromatch@^4.0.2": "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202", + "micromatch@^4.0.4": "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202", "mime-db@1.47.0": "https://registry.yarnpkg.com/mime-db/-/mime-db-1.47.0.tgz#8cb313e59965d3c05cfbf898915a267af46a335c", "mime-types@~2.1.17": "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.30.tgz#6e7be8b4c479825f85ed6326695db73f9305d62d", "mime-types@~2.1.24": "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.30.tgz#6e7be8b4c479825f85ed6326695db73f9305d62d", "mime@1.6.0": "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1", - "minimatch@^3.0.4": "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.8.tgz#5e6a59bd11e2ab0de1cfb843eb2d82e546c321c1", - "minimatch@^3.0.5": "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b", + "minimatch@^3.0.4": "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b", "minimatch@^3.1.2": "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b", "minimatch@~3.0.2": "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.8.tgz#5e6a59bd11e2ab0de1cfb843eb2d82e546c321c1", "minimatch@~3.0.4": "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.8.tgz#5e6a59bd11e2ab0de1cfb843eb2d82e546c321c1", "morgan@^1.10.0": "https://registry.yarnpkg.com/morgan/-/morgan-1.10.0.tgz#091778abc1fc47cd3509824653dae1faab6b17d7", "ms@2.0.0": "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8", - "ms@2.1.1": "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a", "ms@2.1.2": "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009", + "ms@2.1.3": "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2", "ms@^2.1.1": "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2", "natural-compare@^1.4.0": "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7", "negotiator@0.6.2": "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb", "node-fetch@^2.6.12": "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d", - "node-http2@^4.0.1": "https://registry.yarnpkg.com/node-http2/-/node-http2-4.0.1.tgz#164ff53b5dd22c84f0af142b877c5eaeb6809959", "nopt@~3.0.6": "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9", "nopt@~4.0.1": "https://registry.yarnpkg.com/nopt/-/nopt-4.0.3.tgz#a375cad9d02fd921278d954c2254d5aa57e15e48", + "nopt@~5.0.0": "https://registry.yarnpkg.com/nopt/-/nopt-5.0.0.tgz#530942bb58a512fccafe53fe210f13a25355dc88", "object-assign@^4.1.0": "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863", "object-inspect@^1.9.0": "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea", "object.defaults@^1.1.0": "https://registry.yarnpkg.com/object.defaults/-/object.defaults-1.1.0.tgz#3a7f868334b407dea06da16d88d5cd29e435fecf", "object.map@^1.0.1": "https://registry.yarnpkg.com/object.map/-/object.map-1.0.1.tgz#cf83e59dc8fcc0ad5f4250e1f78b3b81bd801d37", "object.pick@^1.2.0": "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747", + "on-finished@2.4.1": "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f", "on-finished@~2.3.0": "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947", "on-headers@~1.0.2": "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.2.tgz#772b0ae6aaa525c399e489adfad90c403eb3c28f", "once@^1.3.0": "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1", - "once@^1.4.0": "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1", "open@^8.0.0": "https://registry.yarnpkg.com/open/-/open-8.4.2.tgz#5b5ffe2a8f793dcd2aad73e550cb87b59cb084f9", "optionator@^0.9.3": "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64", "os-homedir@^1.0.0": "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3", @@ -281,95 +278,74 @@ "path-parse@^1.0.6": "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735", "path-root-regex@^0.1.0": "https://registry.yarnpkg.com/path-root-regex/-/path-root-regex-0.1.2.tgz#bfccdc8df5b12dc52c8b43ec38d18d72c04ba96d", "path-root@^0.1.1": "https://registry.yarnpkg.com/path-root/-/path-root-0.1.1.tgz#9a4a6814cac1c0cd73360a95f32083c8ea4745b7", - "picomatch@^2.2.3": "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.3.tgz#465547f359ccc206d3c48e46a1bcb89bf7ee619d", "picomatch@^2.3.1": "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42", "portscanner@^2.2.0": "https://registry.yarnpkg.com/portscanner/-/portscanner-2.2.0.tgz#6059189b3efa0965c9d96a56b958eb9508411cf1", "prelude-ls@^1.2.1": "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396", "process-nextick-args@~2.0.0": "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2", - "punycode@1.3.2": "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d", "punycode@^2.1.0": "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec", "qs@^6.4.0": "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a", - "querystring@0.2.0": "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620", - "queue-microtask@^1.2.2": "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243", + "quick-lru@^5.1.1": "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932", "range-parser@~1.2.1": "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031", "raw-body@~1.1.0": "https://registry.yarnpkg.com/raw-body/-/raw-body-1.1.7.tgz#1d027c2bfa116acc6623bca8f00016572a87d425", - "readable-stream@^2.0.0": "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57", - "readable-stream@^2.0.2": "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57", - "readable-stream@^2.3.3": "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57", "readable-stream@~2.3.6": "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57", "rechoir@^0.7.0": "https://registry.yarnpkg.com/rechoir/-/rechoir-0.7.0.tgz#32650fd52c21ab252aa5d65b19310441c7e03aca", "regenerator-runtime@^0.14.0": "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45", + "resolve-alpn@^1.2.0": "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9", "resolve-dir@^1.0.0": "https://registry.yarnpkg.com/resolve-dir/-/resolve-dir-1.0.1.tgz#79a40644c362be82f26effe739c9bb5382046f43", "resolve-dir@^1.0.1": "https://registry.yarnpkg.com/resolve-dir/-/resolve-dir-1.0.1.tgz#79a40644c362be82f26effe739c9bb5382046f43", "resolve-from@^4.0.0": "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6", "resolve@^1.19.0": "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975", "resolve@^1.9.0": "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975", - "reusify@^1.0.4": "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76", - "rimraf@^3.0.2": "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a", - "run-parallel@^1.1.9": "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee", "safe-buffer@5.1.2": "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d", "safe-buffer@>=5.1.0": "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6", - "safe-buffer@^5.1.2": "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6", "safe-buffer@~5.1.0": "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d", "safe-buffer@~5.1.1": "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d", "safe-json-parse@~1.0.1": "https://registry.yarnpkg.com/safe-json-parse/-/safe-json-parse-1.0.1.tgz#3e76723e38dfdda13c9b1d29a1e07ffee4b30b57", "safer-buffer@>= 2.1.2 < 3.0.0": "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a", - "send@0.17.1": "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8", + "send@0.19.0": "https://registry.yarnpkg.com/send/-/send-0.19.0.tgz#bbc5a388c8ea6c048967049dbeac0e4a3f09d7f8", "serve-index@^1.9.1": "https://registry.yarnpkg.com/serve-index/-/serve-index-1.9.1.tgz#d3768d69b1e7d82e5ce050fff5b453bea12a9239", - "serve-static@^1.14.1": "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9", - "setimmediate@^1.0.4": "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285", + "serve-static@^1.15.0": "https://registry.yarnpkg.com/serve-static/-/serve-static-1.16.2.tgz#b6a5343da47f6bdd2673848bf45754941e803296", "setimmediate@^1.0.5": "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285", "setprototypeof@1.1.0": "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656", - "setprototypeof@1.1.1": "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683", + "setprototypeof@1.2.0": "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424", "shebang-command@^2.0.0": "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea", "shebang-regex@^3.0.0": "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172", "side-channel@^1.0.4": "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf", "sprintf-js@^1.0.3": "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.2.tgz#da1765262bf8c0f571749f2ad6c26300207ae673", "sprintf-js@~1.0.2": "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c", + "statuses@2.0.1": "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63", "statuses@>= 1.4.0 < 2": "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c", - "statuses@>= 1.5.0 < 2": "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c", "statuses@~1.5.0": "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c", - "stream-browserify@2.0.1": "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db", - "stream-shift@^1.0.0": "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d", "string-template@~0.2.1": "https://registry.yarnpkg.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add", "string_decoder@0.10": "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94", "string_decoder@~1.1.1": "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8", "strip-ansi@^3.0.0": "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf", - "strip-ansi@^6.0.1": "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9", "strip-json-comments@^3.1.1": "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006", "supports-color@^2.0.0": "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7", "supports-color@^7.1.0": "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da", - "text-table@^0.2.0": "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4", - "timers-browserify@2.0.2": "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.2.tgz#ab4883cf597dcd50af211349a00fbca56ac86b86", "tiny-lr@^1.1.1": "https://registry.yarnpkg.com/tiny-lr/-/tiny-lr-1.1.1.tgz#9fa547412f238fedb068ee295af8b682c98b2aab", "to-regex-range@^5.0.1": "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4", - "toidentifier@1.0.0": "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553", + "toidentifier@1.0.1": "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35", "tr46@~0.0.3": "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a", "type-check@^0.4.0": "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1", "type-check@~0.4.0": "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1", - "type-fest@^0.20.2": "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4", - "ultron@~1.1.0": "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c", "unc-path-regex@^0.1.2": "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa", "underscore.string@~3.3.5": "https://registry.yarnpkg.com/underscore.string/-/underscore.string-3.3.5.tgz#fc2ad255b8bd309e239cbc5816fd23a9b7ea4023", "unpipe@~1.0.0": "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec", "uri-js@^4.2.2": "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e", - "url@^0.11.0": "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1", "util-deprecate@^1.0.2": "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf", "util-deprecate@~1.0.1": "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf", - "util@0.10.3": "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9", "utils-merge@1.0.1": "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713", + "v8flags@^4.0.1": "https://registry.yarnpkg.com/v8flags/-/v8flags-4.0.1.tgz#98fe6c4308317c5f394d85a435eb192490f7e132", "v8flags@~3.2.0": "https://registry.yarnpkg.com/v8flags/-/v8flags-3.2.0.tgz#b243e3b4dfd731fa774e7492128109a0fe66d656", "webidl-conversions@^3.0.0": "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871", "websocket-driver@>=0.5.1": "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.7.4.tgz#89ad5295bbf64b480abcba31e4953aca706f5760", "websocket-extensions@>=0.1.1": "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42", - "websocket-stream@^5.0.1": "https://registry.yarnpkg.com/websocket-stream/-/websocket-stream-5.5.2.tgz#49d87083d96839f0648f5513bbddd581f496b8a2", "whatwg-url@^5.0.0": "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d", "which@^1.2.14": "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a", "which@^2.0.1": "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1", "which@~2.0.2": "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1", "wrappy@1": "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f", - "ws@^3.2.0": "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2", - "xtend@^4.0.0": "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54", "yocto-queue@^0.1.0": "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" }, "files": [], diff --git a/demo/stable/node_modules/dwv/decoders/pdfjs/readme.md b/demo/stable/node_modules/dwv/decoders/pdfjs/readme.md index c16f68d5..2ca911b4 100644 --- a/demo/stable/node_modules/dwv/decoders/pdfjs/readme.md +++ b/demo/stable/node_modules/dwv/decoders/pdfjs/readme.md @@ -1,15 +1,14 @@ -Third Party: pdf.js -===================== +# Third Party: pdf.js -* Web: https://github.com/mozilla/pdf.js -* Version: v1.1.1 (pdf.js) and commit fcaf281 of jpambrun -* Date: copied on 05/05/2015 -* Download: - * [jpg.js](https://github.com/mozilla/pdf.js/blob/master/src/core/jpg.js) modified as in - https://github.com/notmasteryet/jpgjs/pull/33 - * [jpx.js](https://github.com/jpambrun/jpx-medical/blob/master/jpx.js) - * [arithmetic_decoder.js](https://github.com/mozilla/pdf.js/blob/v1.1.1/src/core/arithmetic_decoder.js) - * [util.js](https://github.com/mozilla/pdf.js/blob/v1.1.1/src/shared/util.js) -* License: Apache 2.0 (see [license.txt](https://github.com/mozilla/pdf.js/blob/master/LICENSE)) -* Description: Mozilla's JPEG and JPEG2000 decoder from PDF.js with added support for 16 bit signed grayscale images. -* Purpose for dwv: read DICOM files containing JPEG or JPEG2000 data. +- Web: https://github.com/mozilla/pdf.js +- Version: v1.1.1 (pdf.js) and commit fcaf281 of jpambrun +- Date: copied on 05/05/2015 +- Download: +- [jpg.js](https://github.com/mozilla/pdf.js/blob/master/src/core/jpg.js) modified as in + https://github.com/notmasteryet/jpgjs/pull/33 +- [jpx.js](https://github.com/jpambrun/jpx-medical/blob/master/jpx.js) +- [arithmetic_decoder.js](https://github.com/mozilla/pdf.js/blob/v1.1.1/src/core/arithmetic_decoder.js) +- [util.js](https://github.com/mozilla/pdf.js/blob/v1.1.1/src/shared/util.js) +- License: Apache 2.0 (see [license.txt](https://github.com/mozilla/pdf.js/blob/master/LICENSE)) +- Description: Mozilla's JPEG and JPEG2000 decoder from PDF.js with added support for 16 bit signed grayscale images. +- Purpose for dwv: read DICOM files containing JPEG or JPEG2000 data. diff --git a/demo/stable/node_modules/dwv/decoders/rii-mango/readme.md b/demo/stable/node_modules/dwv/decoders/rii-mango/readme.md index 5fd2d0fe..b114a312 100644 --- a/demo/stable/node_modules/dwv/decoders/rii-mango/readme.md +++ b/demo/stable/node_modules/dwv/decoders/rii-mango/readme.md @@ -1,12 +1,11 @@ -Third Party: rii-mango -====================== +# Third Party: rii-mango -JPEGLosslessDecoderJS ---------------------- -* Web: https://github.com/rii-mango/JPEGLosslessDecoderJS -* Version: [2.0.2](https://github.com/rii-mango/JPEGLosslessDecoderJS/releases/tag/v2.0.2) -* Date: 19/03/2017 -* Download: see release -* License: MIT (see https://github.com/rii-mango/JPEGLosslessDecoderJS/blob/v2.0.2/LICENSE) -* Description: JPEG Lossless decoder. -* Purpose for dwv: Decode JPEG embeded in DICOM. +## JPEGLosslessDecoderJS + +- Web: https://github.com/rii-mango/JPEGLosslessDecoderJS +- Version: [2.0.2](https://github.com/rii-mango/JPEGLosslessDecoderJS/releases/tag/v2.0.2) +- Date: 19/03/2017 +- Download: see release +- License: MIT (see https://github.com/rii-mango/JPEGLosslessDecoderJS/blob/v2.0.2/LICENSE) +- Description: JPEG Lossless decoder. +- Purpose for dwv: Decode JPEG embeded in DICOM. diff --git a/demo/stable/node_modules/dwv/dist/dwv.d.ts b/demo/stable/node_modules/dwv/dist/dwv.d.ts index 4d90ba08..4f87dc22 100644 --- a/demo/stable/node_modules/dwv/dist/dwv.d.ts +++ b/demo/stable/node_modules/dwv/dist/dwv.d.ts @@ -1,10 +1,312 @@ +import Konva from 'konva'; + /** * Add tags to the dictionary. * * @param {string} group The group key. - * @param {object} tags The tags to add. + * @param {Object} tags The tags to add as an + * object indexed by element key with values as: + * [VR, multiplicity, TagName] (all strings). + */ +export declare function addTagsToDictionary(group: string, tags: { + [x: string]: string[]; +}): void; + +/** + * Image annotation. + */ +export declare class Annotation { + /** + * The ID. + * + * @type {string} + */ + id: string; + /** + * The reference image SOP UID. + * + * @type {string} + */ + referenceSopUID: string; + /** + * The mathematical shape. + * + * @type {object} + */ + mathShape: object; + /** + * Additional points used to define the annotation. + * + * @type {Point2D[]|undefined} + */ + referencePoints: Point2D[] | undefined; + /** + * The color: for example 'green', '#00ff00' or 'rgb(0,255,0)'. + * + * @type {string|undefined} + */ + colour: string | undefined; + /** + * Annotation quantification. + * + * @type {object|undefined} + */ + quantification: object | undefined; + /** + * Text expression. Can contain variables surrounded with '{}' that will + * be extracted from the quantification object. + * + * @type {string|undefined} + */ + textExpr: string | undefined; + /** + * Label position. If undefined, the default shape + * label position will be used. + * + * @type {Point2D|undefined} + */ + labelPosition: Point2D | undefined; + /** + * The plane origin, the 3D position of index [0, 0, k]. + * + * @type {Point3D|undefined} + */ + planeOrigin: Point3D | undefined; + /** + * A couple of points that help define the annotation plane. + * + * @type {Point3D[]|undefined} + */ + planePoints: Point3D[] | undefined; + /** + * Get the orientation name for this annotation. + * + * @returns {string|undefined} The orientation name, + * undefined if same as reference data. + */ + getOrientationName(): string | undefined; + /** + * Initialise the annotation. + * + * @param {ViewController} viewController The associated view controller. + */ + init(viewController: ViewController): void; + /** + * Check if an input view is compatible with the annotation. + * + * @param {PlaneHelper} planeHelper The input view to check. + * @returns {boolean} True if compatible view. + */ + isCompatibleView(planeHelper: PlaneHelper): boolean; + /** + * Set the associated view controller if it is compatible. + * + * @param {ViewController} viewController The view controller. + */ + setViewController(viewController: ViewController): void; + /** + * Get the centroid of the math shape. + * + * @returns {Point|undefined} The 3D centroid point. + */ + getCentroid(): Point | undefined; + /** + * Set the annotation text expression. + * + * @param {Object.} labelText The list of label + * texts indexed by modality. + */ + setTextExpr(labelText: { + [x: string]: string; + }): void; + /** + * Get the annotation label text by applying the + * text expression on the current quantification. + * + * @returns {string} The resulting text. + */ + getText(): string; + /** + * Update the annotation quantification. + */ + updateQuantification(): void; + /** + * Get the math shape associated draw factory. + * + * @returns {object} The factory. + */ + getFactory(): object; + #private; +} + +/** + * Annotation group. + */ +export declare class AnnotationGroup { + /** + * @param {Annotation[]} [list] Optional list, will + * create new if not provided. + */ + constructor(list?: Annotation[]); + /** + * Get the annotation group as an array. + * + * @returns {Annotation[]} The array. + */ + getList(): Annotation[]; + /** + * Get the number of annotations of this list. + * + * @returns {number} The number of annotations. + */ + getLength(): number; + /** + * Check if the annotation group is editable. + * + * @returns {boolean} True if editable. + */ + isEditable(): boolean; + /** + * Set the annotation group editability. + * + * @param {boolean} flag True to make the annotation group editable. + */ + setEditable(flag: boolean): void; + /** + * Get the group colour. + * + * @returns {string} The colour as hex string. + */ + getColour(): string; + /** + * Set the group colour. + * + * @param {string} colour The colour as hex string. + */ + setColour(colour: string): void; + /** + * Add a new annotation. + * + * @param {Annotation} annotation The annotation to add. + */ + add(annotation: Annotation): void; + /** + * Update an existing annotation. + * + * @param {Annotation} annotation The annotation to update. + * @param {string[]} [propKeys] Optional properties that got updated. + */ + update(annotation: Annotation, propKeys?: string[]): void; + /** + * Remove an annotation. + * + * @param {string} id The id of the annotation to remove. + */ + remove(id: string): void; + /** + * Set the associated view controller. + * + * @param {ViewController} viewController The associated view controller. + */ + setViewController(viewController: ViewController): void; + /** + * Find an annotation. + * + * @param {string} id The id of the annotation to find. + * @returns {Annotation|undefined} The found annotation. + */ + find(id: string): Annotation | undefined; + /** + * Get the meta data. + * + * @returns {Object} The meta data. + */ + getMeta(): { + [x: string]: any; + }; + /** + * Check if this list contains a meta data value. + * + * @param {string} key The key to check. + * @returns {boolean} True if the meta data is present. + */ + hasMeta(key: string): boolean; + /** + * Get a meta data value. + * + * @param {string} key The meta data key. + * @returns {string|object} The meta data value. + */ + getMetaValue(key: string): string | object; + /** + * Set a meta data. + * + * @param {string} key The meta data key. + * @param {string|object} value The value of the meta data. + */ + setMetaValue(key: string, value: string | object): void; + /** + * Add an event listener to this class. + * + * @param {string} type The event type. + * @param {Function} callback The function associated with the provided + * event type, will be called with the fired event. + */ + addEventListener(type: string, callback: Function): void; + /** + * Remove an event listener from this class. + * + * @param {string} type The event type. + * @param {Function} callback The function associated with the provided + * event type. + */ + removeEventListener(type: string, callback: Function): void; + #private; +} + +/** + * {@link AnnotationGroup} factory. */ -export declare function addTagsToDictionary(group: string, tags: object): void; +export declare class AnnotationGroupFactory { + /** + * Get a warning string if elements are not as expected. + * Created by checkElements. + * + * @returns {string|undefined} The warning. + */ + getWarning(): string | undefined; + /** + * Check dicom elements. Throws an error if not suitable. + * + * @param {Object} dataElements The DICOM data elements. + * @returns {string|undefined} A possible warning. + */ + checkElements(dataElements: { + [x: string]: DataElement; + }): string | undefined; + /** + * Get an {@link Annotation} object from the read DICOM file. + * + * @param {Object} dataElements The DICOM tags. + * @returns {AnnotationGroup} A new annotation group. + */ + create(dataElements: { + [x: string]: DataElement; + }): AnnotationGroup; + /** + * Convert an annotation group into a DICOM SR object. + * + * @param {AnnotationGroup} annotationGroup The annotation group. + * @param {Object} [extraTags] Optional list of extra tags. + * @returns {Object} A list of dicom elements. + */ + toDicom(annotationGroup: AnnotationGroup, extraTags?: { + [x: string]: any; + }): { + [x: string]: DataElement; + }; + #private; +} /** * List of ViewConfigs indexed by dataIds. @@ -29,82 +331,91 @@ export declare function addTagsToDictionary(group: string, tags: object): void; */ export declare class App { /** - * Get the image. + * Get a DicomData. * - * @param {number} index The data index. - * @returns {Image} The associated image. + * @param {string} dataId The data id. + * @returns {DicomData|undefined} The data. */ - getImage(index: number): Image_2; + getData(dataId: string): DicomData | undefined; /** - * Get the last loaded image. + * Get the image. * - * @returns {Image} The image. + * @param {string} dataId The data id. + * @returns {Image|undefined} The associated image. + * @deprecated Since v0.34, please use the getData method. */ - getLastImage(): Image_2; + getImage(dataId: string): Image_2 | undefined; /** - * Set the image at the given index. + * Set the image at the given id. * - * @param {number} index The data index. + * @param {string} dataId The data id. * @param {Image} img The associated image. */ - setImage(index: number, img: Image_2): void; + setImage(dataId: string, img: Image_2): void; /** - * Set the last image. + * Add a new DicomData. * - * @param {Image} img The associated image. + * @param {DicomData} data The new data. + * @returns {string} The data id. */ - setLastImage(img: Image_2): void; + addData(data: DicomData): string; /** - * Add a new image. + * Get the meta data. * - * @param {Image} image The new image. - * @param {object} meta The image meta. - * @returns {number} The new image id. + * @param {string} dataId The data id. + * @returns {Object|undefined} The list of meta data. */ - addNewImage(image: Image_2, meta: object): number; + getMetaData(dataId: string): { + [x: string]: DataElement; + } | undefined; /** - * Get the meta data. + * Get the list of ids in the data storage. * - * @param {number} index The data index. - * @returns {object} The list of meta data. + * @returns {string[]} The list of data ids. */ - getMetaData(index: number): object; + getDataIds(): string[]; /** - * Get the number of loaded data. + * Get the list of dataIds that contain the input UIDs. * - * @returns {number} The number. + * @param {string[]} uids A list of UIDs. + * @returns {string[]} The list of dataIds that contain the UIDs. */ - getNumberOfLoadedData(): number; + getDataIdsFromSopUids(uids: string[]): string[]; /** - * Can the data be scrolled? + * Can the data (of the active view of the active layer) be scrolled? * * @returns {boolean} True if the data has a third dimension greater than one. + * @deprecated Since v0.33, please use the ViewController + * equivalent directly instead. */ canScroll(): boolean; /** - * Can window and level be applied to the data? + * Can window and level be applied to the data + * (of the active view of the active layer)? * * @returns {boolean} True if the data is monochrome. + * @deprecated Since v0.33, please use the ViewController + * equivalent directly instead. */ canWindowLevel(): boolean; /** - * Get the layer scale on top of the base scale. + * Get the active layer group scale on top of the base scale. * - * @returns {object} The scale as {x,y}. + * @returns {Scalar3D} The scale as {x,y,z}. */ - getAddedScale(): object; + getAddedScale(): Scalar3D; /** - * Get the base scale. + * Get the base scale of the active layer group. * - * @returns {object} The scale as {x,y}. + * @returns {Scalar3D} The scale as {x,y,z}. */ - getBaseScale(): object; + getBaseScale(): Scalar3D; /** - * Get the layer offset. + * Get the layer offset of the active layer group. * - * @returns {object} The offset. + * @returns {Scalar3D} The offset as {x,y,z}. */ - getOffset(): object; + getOffset(): Scalar3D; /** * Get the toolbox controller. * @@ -115,25 +426,51 @@ export declare class App { * Get the active layer group. * The layer is available after the first loaded item. * - * @returns {LayerGroup} The layer group. + * @returns {LayerGroup|undefined} The layer group. */ - getActiveLayerGroup(): LayerGroup; + getActiveLayerGroup(): LayerGroup | undefined; /** - * Get the view layers associated to a data index. + * Set the active layer group. + * + * @param {number} index The layer group index. + */ + setActiveLayerGroup(index: number): void; + /** + * Get the view layers associated to a data id. * The layer are available after the first loaded item. * - * @param {number} index The data index. + * @param {string} dataId The data id. * @returns {ViewLayer[]} The layers. */ - getViewLayersByDataIndex(index: number): ViewLayer[]; + getViewLayersByDataId(dataId: string): ViewLayer[]; + /** + * Get a list of view layers according to an input callback function. + * + * @param {Function} [callbackFn] A function that takes + * a ViewLayer as input and returns a boolean. If undefined, + * returns all view layers. + * @returns {ViewLayer[]} The layers that + * satisfy the callbackFn. + */ + getViewLayers(callbackFn?: Function): ViewLayer[]; /** - * Get the draw layers associated to a data index. + * Get the draw layers associated to a data id. * The layer are available after the first loaded item. * - * @param {number} index The data index. + * @param {string} dataId The data id. * @returns {DrawLayer[]} The layers. */ - getDrawLayersByDataIndex(index: number): DrawLayer[]; + getDrawLayersByDataId(dataId: string): DrawLayer[]; + /** + * Get a list of draw layers according to an input callback function. + * + * @param {Function} [callbackFn] A function that takes + * a DrawLayer as input and returns a boolean. If undefined, + * returns all draw layers. + * @returns {DrawLayer[]} The layers that + * satisfy the callbackFn. + */ + getDrawLayers(callbackFn?: Function): DrawLayer[]; /** * Get a layer group by div id. * The layer is available after the first loaded item. @@ -162,10 +499,19 @@ export declare class App { * @function */ addToUndoStack: (cmd: object) => void; + /** + * Remove a command from the undo stack. + * + * @param {string} name The name of the command to remove. + * @returns {boolean} True if the command was found and removed. + * @fires UndoStack#undoremove + * @function + */ + removeFromUndoStack: (name: string) => boolean; /** * Initialise the application. * - * @param {AppOptions} opt The application options + * @param {AppOptions} opt The application options. * @example * // create the dwv app * const app = new dwv.App(); @@ -227,8 +573,8 @@ export declare class App { * @fires App#loadprogress * @fires App#loaditem * @fires App#loadend - * @fires App#loaderror - * @fires App#loadabort + * @fires App#error + * @fires App#abort * @function */ loadFiles: (files: File[]) => void; @@ -237,15 +583,15 @@ export declare class App { * * @param {string[]} urls The list of urls to load. * @param {object} [options] The options object, can contain: - * - requestHeaders: an array of {name, value} to use as request headers - * - withCredentials: boolean xhr.withCredentials flag to pass to the request - * - batchSize: the size of the request url batch + * - requestHeaders: an array of {name, value} to use as request headers, + * - withCredentials: boolean xhr.withCredentials flag to pass to the request, + * - batchSize: the size of the request url batch. * @fires App#loadstart * @fires App#loadprogress * @fires App#loaditem * @fires App#loadend - * @fires App#loaderror - * @fires App#loadabort + * @fires App#error + * @fires App#abort * @function */ loadURLs: (urls: string[], options?: object) => void; @@ -266,15 +612,21 @@ export declare class App { * @fires App#loadprogress * @fires App#loaditem * @fires App#loadend - * @fires App#loaderror - * @fires App#loadabort + * @fires App#error + * @fires App#abort * @function */ loadImageObject: (data: any[]) => void; /** - * Abort the current load. + * Abort all the current loads. + */ + abortAllLoads(): void; + /** + * Abort an individual data load. + * + * @param {string} dataId The data to stop loading. */ - abortLoad(): void; + abortLoad(dataId: string): void; /** * Fit the display to the data of each layer group. * To be called once the image is loaded. @@ -282,8 +634,38 @@ export declare class App { fitToContainer(): void; /** * Init the Window/Level display + * (of the active layer of the active layer group). + * + * @deprecated Since v0.33, please set the opacity + * of the desired view layer directly. */ initWLDisplay(): void; + /** + * Set the imageSmoothing flag value. Default is false. + * + * @param {boolean} flag True to enable smoothing. + */ + setImageSmoothing(flag: boolean): void; + /** + * Get the layer group configuration from a data id. + * + * @param {string} dataId The data id. + * @param {boolean} [excludeStarConfig] Exclude the star config + * (default to false). + * @returns {ViewConfig[]} The list of associated configs. + */ + getViewConfigs(dataId: string, excludeStarConfig?: boolean): ViewConfig[]; + /** + * Get the layer group configuration for a data id and group + * div id. + * + * @param {string} dataId The data id. + * @param {string} groupDivId The layer group div id. + * @param {boolean} [excludeStarConfig] Exclude the star config + * (default to false). + * @returns {ViewConfig|undefined} The associated config. + */ + getViewConfig(dataId: string, groupDivId: string, excludeStarConfig?: boolean): ViewConfig | undefined; /** * Get the data view config. * Carefull, returns a reference, do not modify without resetting. @@ -302,20 +684,44 @@ export declare class App { setDataViewConfigs(configs: { [x: string]: ViewConfig[]; }): void; + /** + * Add a data view config. + * + * @param {string} dataId The data id. + * @param {ViewConfig} config The view configuration. + */ + addDataViewConfig(dataId: string, config: ViewConfig): void; + /** + * Remove a data view config. + * + * @param {string} dataId The data id. + * @param {string} divId The div id. + */ + removeDataViewConfig(dataId: string, divId: string): void; + /** + * Update an existing data view config. + * Removes and re-creates the layer if found. + * + * @param {string} dataId The data id. + * @param {string} divId The div id. + * @param {ViewConfig} config The view configuration. + */ + updateDataViewConfig(dataId: string, divId: string, config: ViewConfig): void; /** * Set the layer groups binders. * - * @param {Array} list The list of binder names. + * @param {string[]} list The list of binder names. */ - setLayerGroupsBinders(list: any[]): void; + setLayerGroupsBinders(list: string[]): void; /** * Render the current data. * - * @param {number} dataIndex The data index to render. + * @param {string} dataId The data id to render. + * @param {ViewConfig[]} [viewConfigs] The list of configs to render. */ - render(dataIndex: number): void; + render(dataId: string, viewConfigs?: ViewConfig[]): void; /** - * Zoom to the layers. + * Zoom the layers of the active layer group. * * @param {number} step The step to add to the current zoom. * @param {number} cx The zoom center X coordinate. @@ -323,37 +729,38 @@ export declare class App { */ zoom(step: number, cx: number, cy: number): void; /** - * Apply a translation to the layers. + * Apply a translation to the layers of the active layer group. * * @param {number} tx The translation along X. * @param {number} ty The translation along Y. */ translate(tx: number, ty: number): void; /** - * Set the image layer opacity. + * Set the active view layer (of the active layer group) opacity. * * @param {number} alpha The opacity ([0:1] range). + * @deprecated Since v0.33, pplease set the opacity + * of the desired view layer directly. */ setOpacity(alpha: number): void; /** - * Set the drawings on the current stage. + * Set the drawings of the active layer group. * + * @deprecated Since v0.34, please switch to DICOM SR annotations. * @param {Array} drawings An array of drawings. * @param {Array} drawingsDetails An array of drawings details. + * @param {string} dataId The converted data id. */ - setDrawings(drawings: any[], drawingsDetails: any[]): void; - /** - * Get the JSON state of the app. - * - * @returns {string} The state of the app as a JSON string. - */ - getJsonState(): string; + setDrawings(drawings: any[], drawingsDetails: any[], dataId: string): void; /** * Apply a JSON state to this app. * + * @deprecated Since v0.34, please switch to DICOM SR + * for annotations. * @param {string} jsonState The state of the app as a JSON string. + * @param {string} dataId The state data id. */ - applyJsonState(jsonState: string): void; + applyJsonState(jsonState: string, dataId: string): void; /** * Handle resize: fit the display to the window. * To be called once the image is loaded. @@ -372,12 +779,14 @@ export declare class App { onKeydown: (event: KeyboardEvent) => void; /** * Key down event handler example. - * - CRTL-Z: undo - * - CRTL-Y: redo - * - CRTL-ARROW_LEFT: next element on fourth dim - * - CRTL-ARROW_UP: next element on third dim - * - CRTL-ARROW_RIGHT: previous element on fourth dim - * - CRTL-ARROW_DOWN: previous element on third dim + * - CRTL-Z: undo, + * - CRTL-Y: redo, + * - CRTL-ARROW_LEFT: next element on fourth dim, + * - CRTL-ARROW_UP: next element on third dim, + * - CRTL-ARROW_RIGHT: previous element on fourth dim, + * - CRTL-ARROW_DOWN: previous element on third dim. + * + * Applies to the active view of the active layer group. * * @param {KeyboardEvent} event The key down event. * @fires UndoStack#undo @@ -386,27 +795,31 @@ export declare class App { */ defaultOnKeydown: (event: KeyboardEvent) => void; /** - * Reset the display + * Reset the display. */ resetDisplay(): void; /** - * Reset the app zoom.s + * Reset the app zoom. */ resetZoom(): void; /** - * Set the colour map. + * Set the colour map of the active view of the active layer group. * * @param {string} name The colour map name. + * @deprecated Since v0.33, please use the ViewController + * equivalent directly instead. */ setColourMap(name: string): void; /** - * Set the window/level preset. + * Set the window/level preset of the active view of the active layer group. * - * @param {object} preset The window/level preset. + * @param {string} preset The window/level preset. + * @deprecated Since v0.33, please use the ViewController + * equivalent directly instead. */ - setWindowLevelPreset(preset: object): void; + setWindowLevelPreset(preset: string): void; /** - * Set the tool + * Set the tool. * * @param {string} tool The tool. */ @@ -418,13 +831,13 @@ export declare class App { */ setToolFeatures(list: object): void; /** - * Undo the last action + * Undo the last action. * * @fires UndoStack#undo */ undo(): void; /** - * Redo the last action + * Redo the last action. * * @fires UndoStack#redo */ @@ -441,6 +854,42 @@ export declare class App { * @returns {number} The stack index. */ getCurrentStackIndex(): number; + /** + * Get the overlay data for a data id. + * + * @param {string} dataId The data id. + * @returns {OverlayData|undefined} The overlay data. + */ + getOverlayData(dataId: string): OverlayData | undefined; + /** + * Toggle overlay listeners. + * + * @param {string} dataId The data id. + */ + toggleOverlayListeners(dataId: string): void; + /** + * Create new annotation data based on the data of + * the active view layer. + * + * @param {string} refDataId The reference data id. + * @returns {DicomData} The new data. + */ + createAnnotationData(refDataId: string): DicomData; + /** + * Add new data and render it with a simple new data view config. + * + * @param {DicomData} data The data to add. + * @param {string} divId The div where to draw. + * @param {string} refDataId The reference data id. + */ + addAndRenderAnnotationData(data: DicomData, divId: string, refDataId: string): void; + /** + * Add a draw layer. + * + * @param {string} dataId The data id. + * @param {ViewConfig} viewConfig The data view config. + */ + addDrawLayer(dataId: string, viewConfig: ViewConfig): void; #private; } @@ -449,20 +898,20 @@ export declare class App { */ export declare class AppOptions { /** - * @param {Object} dataViewConfigs DataId + * @param {Object} [dataViewConfigs] Optional dataId * indexed object containing the data view configurations. */ - constructor(dataViewConfigs: { + constructor(dataViewConfigs?: { [x: string]: ViewConfig[]; }); /** * DataId indexed object containing the data view configurations. * - * @type {Object} + * @type {Object|undefined} */ dataViewConfigs: { [x: string]: ViewConfig[]; - }; + } | undefined; /** * Tool name indexed object containing individual tool configurations. * @@ -479,25 +928,46 @@ export declare class AppOptions { binders: string[] | undefined; /** * Optional boolean flag to trigger the first data render - * after the first loaded data or not. Defaults to true; + * after the first loaded data or not. Defaults to true. * * @type {boolean|undefined} */ viewOnFirstLoadItem: boolean | undefined; /** - * Optional default chraracter set string used for DICOM parsing if - * not passed in DICOM file. - * Valid values: https://developer.mozilla.org/en-US/docs/Web/API/Encoding_API/Encodings + * Optional default chraracterset string used for DICOM parsing if + * not passed in DICOM file. + * + * Valid values: {@link https://developer.mozilla.org/en-US/docs/Web/API/Encoding_API/Encodings}. * * @type {string|undefined} */ defaultCharacterSet: string | undefined; + /** + * Optional overlay config. + * + * @type {object|undefined} + */ + overlayConfig: object | undefined; + /** + * DOM root document. + * + * @type {DocumentFragment} + */ + rootDocument: DocumentFragment; +} + +export declare namespace BLACK { + let r: number; + let g: number; + let b: number; } /** * Build a multipart message. - * See: https://en.wikipedia.org/wiki/MIME#Multipart_messages - * See: https://hg.orthanc-server.com/orthanc-dicomweb/file/tip/Resources/Samples/JavaScript/stow-rs.js + * + * Ref: + * - {@link https://en.wikipedia.org/wiki/MIME#Multipart_messages}, + * - {@link https://hg.orthanc-server.com/orthanc-dicomweb/file/tip/Resources/Samples/JavaScript/stow-rs.js}. * * @param {Array} parts The message parts as an array of object containing * content headers and messages as the data property (as returned by parse). @@ -507,30 +977,153 @@ export declare class AppOptions { export declare function buildMultipart(parts: any[], boundary: string): Uint8Array; /** - * Colour map: red, green and blue components - * to associate with intensity values. + * Change segment colour command. */ -export declare class ColourMap { +export declare class ChangeSegmentColourCommand { /** - * @param {number[]} red Red component. - * @param {number[]} green Green component. - * @param {number[]} blue Blue component. + * @param {Image} mask The mask image. + * @param {MaskSegment} segment The segment to modify. + * @param {RGB|number} newColour The new segment colour. + * @param {boolean} [silent] Whether to send a creation event or not. */ - constructor(red: number[], green: number[], blue: number[]); + constructor(mask: Image_2, segment: MaskSegment, newColour: RGB | number, silent?: boolean); /** - * Red component: 256 values in the [0, 255] range. + * Get the command name. * - * @type {number[]} + * @returns {string} The command name. */ - red: number[]; + getName(): string; /** - * Green component: 256 values in the [0, 255] range. + * Check if a command is valid and can be executed. * - * @type {number[]} + * @returns {boolean} True if the command is valid. */ - green: number[]; + isValid(): boolean; /** - * Blue component: 256 values in the [0, 255] range. + * Execute the command. + * + * @fires ChangeSegmentColourCommand#changemasksegmentcolour + */ + execute(): void; + /** + * Undo the command. + * + * @fires ChangeSegmentColourCommand#changemasksegmentcolour + */ + undo(): void; + /** + * Handle an execute event. + * + * @param {object} _event The execute event with type and id. + */ + onExecute(_event: object): void; + /** + * Handle an undo event. + * + * @param {object} _event The undo event with type and id. + */ + onUndo(_event: object): void; + #private; +} + +/** + * Circle shape. + */ +export declare class Circle { + /** + * @param {Point2D} centre A Point2D representing the centre + * of the circle. + * @param {number} radius The radius of the circle. + */ + constructor(centre: Point2D, radius: number); + /** + * Get the centre (point) of the circle. + * + * @returns {Point2D} The center (point) of the circle. + */ + getCenter(): Point2D; + /** + * Get the centroid of the circle. + * + * @returns {Point2D} The centroid point. + */ + getCentroid(): Point2D; + /** + * Get the radius of the circle. + * + * @returns {number} The radius of the circle. + */ + getRadius(): number; + /** + * Check for equality. + * + * @param {Circle} rhs The object to compare to. + * @returns {boolean} True if both objects are equal. + */ + equals(rhs: Circle): boolean; + /** + * Get the surface of the circle. + * + * @returns {number} The surface of the circle. + */ + getSurface(): number; + /** + * Get the surface of the circle according to a spacing. + * + * @param {Scalar2D} spacing2D The 2D spacing. + * @returns {number} The surface of the circle multiplied by the given + * spacing or null for null spacings. + */ + getWorldSurface(spacing2D: Scalar2D): number; + /** + * Get the rounded limits of the circle. + * + * See: {@link https://en.wikipedia.org/wiki/Circle#Equations}. + * + * Circle formula: `x*x + y*y = r*r`. + * + * Implies: `y = (+-) sqrt(r*r - x*x)`. + * + * @returns {number[][][]} The rounded limits: + * list of [x, y] pairs (min, max). + */ + getRound(): number[][][]; + /** + * Quantify an circle according to view information. + * + * @param {ViewController} viewController The associated view controller. + * @param {string[]} flags A list of stat values to calculate. + * @returns {object} A quantification object. + */ + quantify(viewController: ViewController, flags: string[]): object; + #private; +} + +/** + * Colour map: red, green and blue components + * to associate with intensity values. + */ +export declare class ColourMap { + /** + * @param {number[]} red Red component. + * @param {number[]} green Green component. + * @param {number[]} blue Blue component. + */ + constructor(red: number[], green: number[], blue: number[]); + /** + * Red component: 256 values in the [0, 255] range. + * + * @type {number[]} + */ + red: number[]; + /** + * Green component: 256 values in the [0, 255] range. + * + * @type {number[]} + */ + green: number[]; + /** + * Blue component: 256 values in the [0, 255] range. * * @type {number[]} */ @@ -540,36 +1133,42 @@ export declare class ColourMap { /** * Create an Image from DICOM elements. * - * @param {object} elements The DICOM elements. + * @param {Object} elements The DICOM elements. * @returns {Image} The Image object. */ -export declare function createImage(elements: object): Image_2; +export declare function createImage(elements: { + [x: string]: DataElement; +}): Image_2; /** * Create a mask Image from DICOM elements. * - * @param {object} elements The DICOM elements. + * @param {Object} elements The DICOM elements. * @returns {Image} The mask Image object. */ -export declare function createMaskImage(elements: object): Image_2; +export declare function createMaskImage(elements: { + [x: string]: DataElement; +}): Image_2; /** * Create a View from DICOM elements and image. * - * @param {object} elements The DICOM elements. + * @param {Object} elements The DICOM elements. * @param {Image} image The associated image. * @returns {View} The View object. */ -export declare function createView(elements: object, image: Image_2): View; +export declare function createView(elements: { + [x: string]: DataElement; +}, image: Image_2): View; export declare namespace customUI { /** * Open a dialogue to edit roi data. Defaults to window.prompt. * - * @param {object} data The roi data. + * @param {Annotation} annotation The roi data. * @param {Function} callback The callback to launch on dialogue exit. */ - export function openRoiDialog(data: any, callback: Function): void; + export function openRoiDialog(annotation: Annotation, callback: Function): void; } /** @@ -643,16 +1242,146 @@ export declare const decoderScripts: { /** * List of default window level presets. * - * @type {Object.>} + * @type {Object.>} */ export declare const defaultPresets: { [x: string]: { + [x: string]: WindowLevel; + }; +}; + +export declare namespace defaults { + let labelText: { [x: string]: { - center: number; - width: number; + [x: string]: string; }; }; -}; +} + +/** + * Delete segment command. + */ +export declare class DeleteSegmentCommand { + /** + * @param {Image} mask The mask image. + * @param {MaskSegment} segment The segment to remove. + * @param {boolean} [silent] Whether to send a creation event or not. + */ + constructor(mask: Image_2, segment: MaskSegment, silent?: boolean); + /** + * Get the command name. + * + * @returns {string} The command name. + */ + getName(): string; + /** + * Check if a command is valid and can be executed. + * + * @returns {boolean} True if the command is valid. + */ + isValid(): boolean; + /** + * Execute the command. + * + * @fires DeleteSegmentCommand#masksegmentdelete + */ + execute(): void; + /** + * Undo the command. + * + * @fires DeleteSegmentCommand#masksegmentredraw + */ + undo(): void; + /** + * Handle an execute event. + * + * @param {object} _event The execute event with type and id. + */ + onExecute(_event: object): void; + /** + * Handle an undo event. + * + * @param {object} _event The undo event with type and id. + */ + onUndo(_event: object): void; + #private; +} + +/** + * DICOM code: item of a basic code sequence. + * + * Ref: {@link https://dicom.nema.org/medical/dicom/2022a/output/chtml/part03/sect_8.8.html}. + */ +export declare class DicomCode { + /** + * @param {string} meaning The code meaning. + */ + constructor(meaning: string); + /** + * Code meaning. + * + * @type {string} + */ + meaning: string; + /** + * Code value. + * + * @type {string|undefined} + */ + value: string | undefined; + /** + * Long code value. + * + * @type {string|undefined} + */ + longValue: string | undefined; + /** + * URN code value. + * + * @type {string|undefined} + */ + urnValue: string | undefined; + /** + * Coding scheme designator. + * + * @type {string|undefined} + */ + schemeDesignator: string | undefined; + /** + * Get a string representation of this object. + * + * @returns {string} The code as string. + */ + toString(): string; +} + +/** + * DICOM data: meta and possible image. + */ +export declare class DicomData { + /** + * @param {object} meta The DICOM meta data. + */ + constructor(meta: object); + /** + * DICOM meta data. + * + * @type {object} + */ + meta: object; + /** + * Image extracted from meta data. + * + * @type {Image|undefined} + */ + image: Image_2 | undefined; + /** + * Annotattion group extracted from meta data. + * + * @type {AnnotationGroup|undefined} + */ + annotationGroup: AnnotationGroup | undefined; +} /** * DicomParser class. @@ -717,6 +1446,55 @@ export declare class DicomParser { #private; } +/** + * DICOM SR content: item of a SR content sequence. + * + * Ref: {@link https://dicom.nema.org/medical/dicom/2022a/output/chtml/part03/sect_C.17.3.html}. + */ +export declare class DicomSRContent { + /** + * @param {string} valueType The content item value type. + */ + constructor(valueType: string); + /** + * Value type. + * + * @type {string} + */ + valueType: string; + /** + * Concept name code. + * + * @type {DicomCode|undefined} + */ + conceptNameCode: DicomCode | undefined; + /** + * Relationship Type. + * + * @type {string} + */ + relationshipType: string; + /** + * Content sequence (0040,A730). + * + * @type {DicomSRContent[]|undefined} + */ + contentSequence: DicomSRContent[] | undefined; + /** + * Value. + * + * @type {object} + */ + value: object; + /** + * Get a string representation of this object. + * + * @param {string} [prefix] An optional prefix for recursive content. + * @returns {string} The object as string. + */ + toString(prefix?: string): string; +} + /** * DICOM writer. * @@ -755,31 +1533,37 @@ export declare class DicomWriter { * @param {boolean} flag True to use UN VR. */ setUseUnVrForPrivateSq(flag: boolean): void; + /** + * Set the vr=UN check and fix flag. + * + * @param {boolean} flag True to activate the check and fix. + */ + setFixUnknownVR(flag: boolean): void; /** * Set the writing rules. - * List of writer rules indexed by either `default`, tagName or groupName. + * List of writer rules indexed by either `default`, + * tagKey, tagName or groupName. * Each DICOM element will be checked to see if a rule is applicable. - * First checked by tagName and then by groupName, + * First checked by tagKey, tagName and then by groupName, * if nothing is found the default rule is applied. * * @param {Object} rules The input rules. + * @param {boolean} [addMissingTags] If true, explicit tags that + * have replace rule and a value will be + * added if missing. Defaults to false. */ setRules(rules: { [x: string]: WriterRule; - }): void; + }, addMissingTags?: boolean): void; /** * Use a TextEncoder instead of the default text decoder. */ useSpecialTextEncoder(): void; - /** - * Use default anonymisation rules. - */ - useDefaultAnonymisationRules(): void; /** * Get the element to write according to the class rules. * Priority order: tagName, groupName, default. * - * @param {DataElement} element The element to check + * @param {DataElement} element The element to check. * @returns {DataElement|null} The element to write, can be null. */ getElementToWrite(element: DataElement): DataElement | null; @@ -795,6 +1579,106 @@ export declare class DicomWriter { #private; } +/** + * Draw controller. + */ +export declare class DrawController { + /** + * @param {AnnotationGroup} [group] Optional annotation group. + */ + constructor(group?: AnnotationGroup); + /** + * Get an annotation. + * + * @param {string} id The annotation id. + * @returns {Annotation|undefined} The annotation. + */ + getAnnotation(id: string): Annotation | undefined; + /** + * Get the annotation group. + * + * @returns {AnnotationGroup} The list. + */ + getAnnotationGroup(): AnnotationGroup; + /** + * Check if the annotation group is editable. + * + * @returns {boolean} True if editable. + */ + isAnnotationGroupEditable(): boolean; + /** + * Set the annotation group editability. + * + * @param {boolean} flag True to make the annotation group editable. + */ + setAnnotationGroupEditable(flag: boolean): void; + /** + * Add an annotation. + * + * @param {Annotation} annotation The annotation to add. + */ + addAnnotation(annotation: Annotation): void; + /** + * Update an anotation from the list. + * + * @param {Annotation} annotation The annotation to update. + * @param {string[]} [propKeys] Optional properties that got updated. + */ + updateAnnotation(annotation: Annotation, propKeys?: string[]): void; + /** + * Remove an anotation for the list. + * + * @param {string} id The id of the annotation to remove. + */ + removeAnnotation(id: string): void; + /** + * Remove an annotation via a remove command (triggers draw actions). + * + * @param {string} id The annotation id. + * @param {Function} exeCallback The undo stack callback. + */ + removeAnnotationWithCommand(id: string, exeCallback: Function): void; + /** + * Update an annotation via an update command (triggers draw actions). + * + * @param {string} id The annotation id. + * @param {object} originalProps The original annotation properties + * that will be updated. + * @param {object} newProps The new annotation properties + * that will replace the original ones. + * @param {Function} exeCallback The undo stack callback. + */ + updateAnnotationWithCommand(id: string, originalProps: object, newProps: object, exeCallback: Function): void; + /** + * Remove all annotations via remove commands (triggers draw actions). + * + * @param {Function} exeCallback The undo stack callback. + */ + removeAllAnnotationsWithCommand(exeCallback: Function): void; + /** + * Check if the annotation group contains a meta data value. + * + * @param {string} key The key to check. + * @returns {boolean} True if the meta data is present. + */ + hasAnnotationMeta(key: string): boolean; + /** + * Set an annotation meta data. + * + * @param {string} key The meta data to set. + * @param {string} value The value of the meta data. + */ + setAnnotationMeta(key: string, value: string): void; + #private; +} + +/** + * Debug function to output the layer hierarchy as text. + * + * @param {object} layer The Konva layer. + * @param {string} prefix A display prefix (used in recursion). + * @returns {string} A text representation of the hierarchy. + */ /** * Draw layer. */ @@ -805,47 +1689,63 @@ export declare class DrawLayer { */ constructor(containerDiv: HTMLDivElement); /** - * Get the associated data index. + * Set the draw shape handler. * - * @returns {number} The index. + * @param {DrawShapeHandler|undefined} handler The shape handler. + */ + setShapeHandler(handler: DrawShapeHandler | undefined): void; + /** + * Get the associated data id. + * + * @returns {string} The id. + */ + getDataId(): string; + /** + * Get the reference data id. + * + * @returns {string} The id. */ - getDataIndex(): number; + getReferenceLayerId(): string; /** * Get the Konva stage. * - * @returns {object} The stage. + * @returns {Konva.Stage} The stage. */ - getKonvaStage(): object; + getKonvaStage(): Konva.Stage; /** * Get the Konva layer. * - * @returns {object} The layer. + * @returns {Konva.Layer} The layer. */ - getKonvaLayer(): object; + getKonvaLayer(): Konva.Layer; /** * Get the draw controller. * - * @returns {object} The controller. + * @returns {DrawController} The controller. */ - getDrawController(): object; + getDrawController(): DrawController; /** * Set the plane helper. * - * @param {object} helper The helper. + * @param {PlaneHelper} helper The helper. */ - setPlaneHelper(helper: object): void; + setPlaneHelper(helper: PlaneHelper): void; /** * Get the id of the layer. * * @returns {string} The string id. */ getId(): string; + /** + * Remove the HTML element from the DOM. + */ + removeFromDOM(): void; /** * Get the layer base size (without scale). * - * @returns {object} The size as {x,y}. + * @returns {Scalar2D} The size as {x,y}. */ - getBaseSize(): object; + getBaseSize(): Scalar2D; /** * Get the layer opacity. * @@ -866,19 +1766,39 @@ export declare class DrawLayer { * Add a flip offset along the layer Y axis. */ addFlipOffsetY(): void; + /** + * Flip the scale along the layer X axis. + */ + flipScaleX(): void; + /** + * Flip the scale along the layer Y axis. + */ + flipScaleY(): void; + /** + * Flip the scale along the layer Z axis. + */ + flipScaleZ(): void; /** * Set the layer scale. * - * @param {object} newScale The scale as {x,y}. + * @param {Scalar3D} newScale The scale as {x,y,z}. * @param {Point3D} [center] The scale center. */ - setScale(newScale: object, center?: Point3D): void; + setScale(newScale: Scalar3D, center?: Point3D): void; + /** + * Initialise the layer scale. + * + * @param {Scalar3D} newScale The scale as {x,y,z}. + * @param {Scalar2D} absoluteZoomOffset The zoom offset as {x,y} + * without the fit scale (as provided by getAbsoluteZoomOffset). + */ + initScale(newScale: Scalar3D, absoluteZoomOffset: Scalar2D): void; /** * Set the layer offset. * - * @param {object} newOffset The offset as {x,y}. + * @param {Scalar3D} newOffset The offset as {x,y,z}. */ - setOffset(newOffset: object): void; + setOffset(newOffset: Scalar3D): void; /** * Set the base layer offset. Updates the layer offset. * @@ -901,54 +1821,93 @@ export declare class DrawLayer { isVisible(): boolean; /** * Draw the content (imageData) of the layer. - * The imageData variable needs to be set + * The imageData variable needs to be set. */ draw(): void; /** - * Initialise the layer: set the canvas and context + * Initialise the layer: set the canvas and context. * - * @param {object} size The image size as {x,y}. - * @param {object} spacing The image spacing as {x,y}. - * @param {number} index The associated data index. + * @param {Scalar2D} size The image size as {x,y}. + * @param {Scalar2D} spacing The image spacing as {x,y}. + * @param {string} refLayerId The reference image dataId. */ - initialise(size: object, spacing: object, index: number): void; + initialise(size: Scalar2D, spacing: Scalar2D, refLayerId: string): void; /** - * Fit the layer to its parent container. + * Set the annotation group. * - * @param {number} fitScale1D The 1D fit scale. - * @param {object} fitSize The fit size as {x,y}. - * @param {object} fitOffset The fit offset as {x,y}. + * @param {AnnotationGroup} annotationGroup The annotation group. + * @param {string} dataId The associated data id. + * @param {object} exeCallback The undo stack callback. */ - fitToContainer(fitScale1D: number, fitSize: object, fitOffset: object): void; + setAnnotationGroup(annotationGroup: AnnotationGroup, dataId: string, exeCallback: object): void; /** - * Check the visibility of a given group. + * Activate shapes at current position. * - * @param {string} id The id of the group. - * @returns {boolean} True if the group is visible. + * @param {boolean} flag The flag to activate or not. */ - isGroupVisible(id: string): boolean; + activateCurrentPositionShapes(flag: boolean): void; /** - * Toggle the visibility of a given group. + * Fit the layer to its parent container. * - * @param {string} id The id of the group. - * @returns {boolean} False if the group cannot be found. + * @param {Scalar2D} containerSize The container size as {x,y}. + * @param {number} divToWorldSizeRatio The div to world size ratio. + * @param {Scalar2D} fitOffset The fit offset as {x,y}. */ - toggleGroupVisibility(id: string): boolean; + fitToContainer(containerSize: Scalar2D, divToWorldSizeRatio: number, fitOffset: Scalar2D): void; /** - * Delete a Draw from the stage. + * Check the visibility of an annotation. * - * @param {string} id The id of the group to delete. - * @param {object} exeCallback The callback to call once the + * @param {string} id The id of the annotation. + * @returns {boolean} True if the annotation is visible. + */ + isAnnotationVisible(id: string): boolean; + /** + * Set the visibility of an annotation. + * + * @param {string} id The id of the annotation. + * @param {boolean} [visible] True to set to visible, + * will toggle visibility if not defined. + * @returns {boolean} False if the annotation shape cannot be found. + */ + setAnnotationVisibility(id: string, visible?: boolean): boolean; + /** + * Set the visibility of all labels. + * + * @param {boolean} [visible] True to set to visible, + * will toggle visibility if not defined. + */ + setLabelsVisibility(visible?: boolean): void; + /** + * Set a shape group label visibility according to + * this layer setting. + * + * @param {Konva.Group} shapeGroup The shape group. + */ + setLabelVisibility(shapeGroup: Konva.Group): void; + /** + * Delete a Draw from the stage. + * + * @deprecated Since v0.34, please switch to `annotationGroup.remove`. + * @param {string} _id The id of the group to delete. + * @param {Function} _exeCallback The callback to call once the * DeleteCommand has been executed. */ - deleteDraw(id: string, exeCallback: object): void; + deleteDraw(_id: string, _exeCallback: Function): void; /** * Delete all Draws from the stage. * - * @param {object} exeCallback The callback to call once the + * @deprecated Since v0.34, please switch to `annotationGroup.remove`. + * @param {Function} _exeCallback The callback to call once the * DeleteCommand has been executed. */ - deleteDraws(exeCallback: object): void; + deleteDraws(_exeCallback: Function): void; + /** + * Get the total number of draws of this layer + * (at all positions). + * + * @returns {number|undefined} The total number of draws. + */ + getNumberOfDraws(): number | undefined; /** * Enable and listen to container interaction events. */ @@ -961,10 +1920,23 @@ export declare class DrawLayer { * Set the current position. * * @param {Point} position The new position. - * @param {Index} index The new index. + * @param {Index} [index] Optional coresponding index. * @returns {boolean} True if the position was updated. */ - setCurrentPosition(position: Point, index: Index): boolean; + setCurrentPosition(position: Point, index?: Index): boolean; + /** + * Get the current position group. + * + * @returns {Konva.Group|undefined} The Konva.Group. + */ + getCurrentPosGroup(): Konva.Group | undefined; + /** + * Get a Konva group using its id. + * + * @param {string} id The group id. + * @returns {object|undefined} The Konva group. + */ + getGroup(id: string): object | undefined; /** * Add an event listener to this class. * @@ -984,6 +1956,149 @@ export declare class DrawLayer { #private; } +/** + * Draw shape handler: handle action on existing shapes. + */ +export declare class DrawShapeHandler { + /** + * @callback eventFn@callback eventFn + * @param {object} event The event. + */ + /** + * @param {App} app The associated application. + * @param {Function} eventCallback Event callback. + */ + constructor(app: App, eventCallback: Function); + /** + * Set the draw editor shape. + * + * @param {Konva.Shape} shape The shape to edit. + * @param {DrawLayer} drawLayer The layer the shape belongs to. + */ + setEditorShape(shape: Konva.Shape, drawLayer: DrawLayer): void; + /** + * Get the currently edited shape group. + * + * @returns {Konva.Group|undefined} The edited group. + */ + getEditorShapeGroup(): Konva.Group | undefined; + /** + * Get the currently edited annotation. + * + * @returns {Annotation|undefined} The edited annotation. + */ + getEditorAnnotation(): Annotation | undefined; + /** + * Disable and reset the shape editor. + */ + disableAndResetEditor(): void; + /** + * Store specific mouse over cursor. + * + * @param {string} cursor The cursor name. + */ + storeMouseOverCursor(cursor: string): void; + /** + * Handle shape group mouseout. + */ + onMouseOutShapeGroup(): void; + /** + * Add shape group listeners. + * + * @param {Konva.Group} shapeGroup The shape group to set on. + * @param {Annotation} annotation The associated annotation. + * @param {DrawLayer} drawLayer The origin draw layer. + */ + addShapeGroupListeners(shapeGroup: Konva.Group, annotation: Annotation, drawLayer: DrawLayer): void; + /** + * Remove shape group listeners. + * + * @param {Konva.Group} shapeGroup The shape group to set off. + */ + removeShapeListeners(shapeGroup: Konva.Group): void; + #private; +} + +/** + * Ellipse shape. + */ +export declare class Ellipse { + /** + * @param {Point2D} centre A Point2D representing the centre + * of the ellipse. + * @param {number} a The radius of the ellipse on the horizontal axe. + * @param {number} b The radius of the ellipse on the vertical axe. + */ + constructor(centre: Point2D, a: number, b: number); + /** + * Get the centre (point) of the ellipse. + * + * @returns {Point2D} The center (point) of the ellipse. + */ + getCenter(): Point2D; + /** + * Get the centroid of the ellipse. + * + * @returns {Point2D} The centroid point. + */ + getCentroid(): Point2D; + /** + * Get the radius of the ellipse on the horizontal axe. + * + * @returns {number} The radius of the ellipse on the horizontal axe. + */ + getA(): number; + /** + * Get the radius of the ellipse on the vertical axe. + * + * @returns {number} The radius of the ellipse on the vertical axe. + */ + getB(): number; + /** + * Check for equality. + * + * @param {Ellipse} rhs The object to compare to. + * @returns {boolean} True if both objects are equal. + */ + equals(rhs: Ellipse): boolean; + /** + * Get the surface of the ellipse. + * + * @returns {number} The surface of the ellipse. + */ + getSurface(): number; + /** + * Get the surface of the ellipse according to a spacing. + * + * @param {Scalar2D} spacing2D The 2D spacing. + * @returns {number} The surface of the ellipse multiplied by the given + * spacing or null for null spacings. + */ + getWorldSurface(spacing2D: Scalar2D): number; + /** + * Get the rounded limits of the ellipse. + * + * See: {@link https://en.wikipedia.org/wiki/Ellipse#Standard_equation}. + * + * Ellipse formula: `x*x / a*a + y*y / b*b = 1`. + * + * Implies: `y = (+-)(b/a) * sqrt(a*a - x*x)`. + * + * @returns {number[][][]} The rounded limits: + * list of [x, y] pairs (min, max). + */ + getRound(): number[][][]; + /** + * Quantify an ellipse according to view information. + * + * @param {ViewController} viewController The associated view controller. + * @param {string[]} flags A list of stat values to calculate. + * @returns {object} A quantification object. + */ + quantify(viewController: ViewController, flags: string[]): object; + #private; +} + /** * 2D/3D Geometry class. */ @@ -1036,9 +2151,9 @@ export declare class Geometry { /** * Get the object origins. * - * @returns {Array} The object origins. + * @returns {Point3D[]} The object origins. */ - getOrigins(): any[]; + getOrigins(): Point3D[]; /** * Check if a point is in the origin list. * @@ -1053,7 +2168,7 @@ export declare class Geometry { * Warning: the size comes as stored in DICOM, meaning that it could * be oriented. * - * @param {Matrix33} [viewOrientation] The view orientation (optional) + * @param {Matrix33} [viewOrientation] The view orientation (optional). * @returns {Size} The object size. */ getSize(viewOrientation?: Matrix33): Size; @@ -1062,7 +2177,7 @@ export declare class Geometry { * Warning: the spacing comes as stored in DICOM, meaning that it could * be oriented. * - * @param {Matrix33} [viewOrientation] The view orientation (optional) + * @param {Matrix33} [viewOrientation] The view orientation (optional). * @returns {Spacing} The object spacing. */ getSpacing(viewOrientation?: Matrix33): Spacing; @@ -1131,10 +2246,10 @@ export declare class Geometry { * Check that a index is within bounds. * * @param {Index} index The index to check. - * @param {Array} [dirs] Optional list of directions to check. + * @param {number[]} [dirs] Optional list of directions to check. * @returns {boolean} True if the given coordinates are within bounds. */ - isIndexInBounds(index: Index, dirs?: any[]): boolean; + isIndexInBounds(index: Index, dirs?: number[]): boolean; /** * Convert an index into world coordinates. * @@ -1166,6 +2281,23 @@ export declare class Geometry { #private; } +/** + * Get the default DICOM seg tags as an object. + * + * @returns {object} The default tags. + */ +export declare function getDefaultDicomSegJson(): object; + +/** + * Get a simple dicom element item from a content item object. + * + * @param {DicomSRContent} content The content item object. + * @returns {Object} The item as a list of (key, value) pairs. + */ +export declare function getDicomSRContentItem(content: DicomSRContent): { + [x: string]: any; +}; + /** * List of DICOM data elements indexed via a 8 character string formed from * the group and element numbers. @@ -1180,28 +2312,58 @@ export declare class Geometry { export declare function getDwvVersion(): string; /** - * Get the DICOM elements from a 'simple' DICOM json tags object. - * The json is a simplified version of the oficial DICOM json with + * Get the DICOM elements from a 'simple' DICOM tags object. + * The input object is a simplified version of the oficial DICOM json with * tag names instead of keys and direct values (no value property) for * simple tags. See synthetic test data (in tests/dicom) for examples. * - * @param {Object} jsonTags The DICOM - * json tags object. + * @param {Object} simpleTags The 'simple' DICOM + * tags object. * @returns {Object} The DICOM elements. */ -export declare function getElementsFromJSONTags(jsonTags: { +export declare function getElementsFromJSONTags(simpleTags: { [x: string]: any; }): { [x: string]: DataElement; }; +/** + * Get the indices that form a ellpise. + * + * @param {Index} center The ellipse center. + * @param {number[]} radius The 2 ellipse radiuses. + * @param {number[]} dir The 2 ellipse directions. + * @returns {Index[]} The indices of the ellipse. + */ +export declare function getEllipseIndices(center: Index, radius: number[], dir: number[]): Index[]; + +/** + * Get the layer details from a mouse event. + * + * @param {object} event The event to get the layer div id from. Expecting + * an event origininating from a canvas inside a layer HTML div + * with the 'layer' class and id generated with `getLayerDivId`. + * @returns {object} The layer details as {groupDivId, layerIndex, layerId}. + */ +export declare function getLayerDetailsFromEvent(event: object): object; + +/** + * Get the offset of an input mouse event. + * + * @param {object} event The event to get the offset from. + * @returns {Point2D} The 2D point. + */ +export declare function getMousePoint(event: object): Point2D; + /** * Get the name of an image orientation patient. * - * @param {Array} orientation The image orientation patient. - * @returns {string} The orientation name: axial, coronal or sagittal. + * @param {number[]} cosines The image orientation + * patient cosines (6 values). + * @returns {string|undefined} The orientation + * name: axial, coronal or sagittal. */ -export declare function getOrientationName(orientation: any[]): string; +export declare function getOrientationName(cosines: number[]): string | undefined; /** * Get the PixelData Tag. @@ -1210,6 +2372,16 @@ export declare function getOrientationName(orientation: any[]): string; */ export declare function getPixelDataTag(): Tag; +/** + * Get the indices that form a rectangle. + * + * @param {Index} center The rectangle center. + * @param {number[]} size The 2 rectangle sizes. + * @param {number[]} dir The 2 rectangle directions. + * @returns {Index[]} The indices of the rectangle. + */ +export declare function getRectangleIndices(center: Index, size: number[], dir: number[]): Index[]; + /** * Get patient orientation label in the reverse direction. * @@ -1218,6 +2390,16 @@ export declare function getPixelDataTag(): Tag; */ export declare function getReverseOrientation(ori: string): string; +/** + * Get a content item object from a dicom element. + * + * @param {Object} dataElements The dicom element. + * @returns {DicomSRContent} A content item object. + */ +export declare function getSRContent(dataElements: { + [x: string]: DataElement; +}): DicomSRContent; + /** * Split a group-element key used to store DICOM elements. * @@ -1226,6 +2408,14 @@ export declare function getReverseOrientation(ori: string): string; */ export declare function getTagFromKey(key: string): Tag; +/** + * Get the offsets of an input touch event. + * + * @param {object} event The event to get the offset from. + * @returns {Point2D[]} The array of points. + */ +export declare function getTouchPoints(event: object): Point2D[]; + /** * Get the appropriate TypedArray in function of arguments. * @@ -1241,11 +2431,14 @@ export declare function getTypedArray(bitsAllocated: number, pixelRepresentation /** * Get a UID for a DICOM tag. - * Note: Use https://github.com/uuidjs/uuid? * - * @see http://dicom.nema.org/dicom/2013/output/chtml/part05/chapter_9.html - * @see http://dicomiseasy.blogspot.com/2011/12/chapter-4-dicom-objects-in-chapter-3.html - * @see https://stackoverflow.com/questions/46304306/how-to-generate-unique-dicom-uid + * Note: Use {@link https://github.com/uuidjs/uuid}? + * + * Ref: + * - {@link http://dicom.nema.org/medical/dicom/2022a/output/chtml/part05/chapter_9.html}, + * - {@link http://dicomiseasy.blogspot.com/2011/12/chapter-4-dicom-objects-in-chapter-3.html}, + * - {@link https://stackoverflow.com/questions/46304306/how-to-generate-unique-dicom-uid}. + * * @param {string} tagName The input tag. * @returns {string} The corresponding UID. */ @@ -1253,8 +2446,9 @@ export declare function getUID(tagName: string): string; /** * Check that an input buffer includes the DICOM prefix 'DICM' - * after the 128 bytes preamble. - * Ref: [DICOM File Meta]{@link https://dicom.nema.org/dicom/2013/output/chtml/part10/chapter_7.html#sect_7.1} + * after the 128 bytes preamble. + * + * Ref: [DICOM File Meta]{@link https://dicom.nema.org/medical/dicom/2022a/output/chtml/part10/chapter_7.html#sect_7.1}. * * @param {ArrayBuffer} buffer The buffer to check. * @returns {boolean} True if the buffer includes the prefix. @@ -1313,9 +2507,9 @@ declare class Image_2 { /** * @param {Geometry} geometry The geometry of the image. * @param {TypedArray} buffer The image data as a one dimensional buffer. - * @param {Array} [imageUids] An array of Uids indexed to slice number. + * @param {string[]} [imageUids] An array of Uids indexed to slice number. */ - constructor(geometry: Geometry, buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, imageUids?: any[]); + constructor(geometry: Geometry, buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, imageUids?: string[]); /** * Get the image UID at a given index. * @@ -1323,6 +2517,27 @@ declare class Image_2 { * @returns {string} The UID. */ getImageUid(index?: Index): string; + /** + * Get the image origin for a image UID. + * + * @param {string} uid The UID. + * @returns {Point3D|undefined} The origin. + */ + getOriginForImageUid(uid: string): Point3D | undefined; + /** + * Check if the image includes an UID. + * + * @param {string} uid The UID. + * @returns {boolean} True if present. + */ + includesImageUid(uid: string): boolean; + /** + * Check if this image includes the input uids. + * + * @param {string[]} uids UIDs to test for presence. + * @returns {boolean} True if all uids are in this image uids. + */ + containsImageUids(uids: string[]): boolean; /** * Get the geometry of the image. * @@ -1332,7 +2547,7 @@ declare class Image_2 { /** * Get the data buffer of the image. * - * @todo dangerous... + * @todo Dangerous... * @returns {TypedArray} The data buffer of the image. */ getBuffer(): Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array; @@ -1346,8 +2561,15 @@ declare class Image_2 { * Can window and level be applied to the data? * * @returns {boolean} True if the data is monochrome. + * @deprecated Since v0.33, please use isMonochrome instead. */ canWindowLevel(): boolean; + /** + * Is the data monochrome. + * + * @returns {boolean} True if the data is monochrome. + */ + isMonochrome(): boolean; /** * Can the data be scrolled? * @@ -1368,16 +2590,17 @@ declare class Image_2 { * Get the rescale slope and intercept. * * @param {Index} [index] The index (only needed for non constant rsi). - * @returns {object} The rescale slope and intercept. + * @returns {RescaleSlopeAndIntercept} The rescale slope and intercept. */ - getRescaleSlopeAndIntercept(index?: Index): object; + getRescaleSlopeAndIntercept(index?: Index): RescaleSlopeAndIntercept; /** * Set the rescale slope and intercept. * - * @param {object} inRsi The input rescale slope and intercept. + * @param {RescaleSlopeAndIntercept} inRsi The input rescale + * slope and intercept. * @param {number} [offset] The rsi offset (only needed for non constant rsi). */ - setRescaleSlopeAndIntercept(inRsi: object, offset?: number): void; + setRescaleSlopeAndIntercept(inRsi: RescaleSlopeAndIntercept, offset?: number): void; /** * Are all the RSIs identity (1,0). * @@ -1423,15 +2646,19 @@ declare class Image_2 { /** * Get the meta information of the image. * - * @returns {object} The meta information of the image. + * @returns {Object} The meta information of the image. */ - getMeta(): object; + getMeta(): { + [x: string]: any; + }; /** * Set the meta information of the image. * - * @param {object} rhs The meta information of the image. + * @param {Object} rhs The meta information of the image. */ - setMeta(rhs: object): void; + setMeta(rhs: { + [x: string]: any; + }): void; /** * Get value at offset. Warning: No size check... * @@ -1443,19 +2670,19 @@ declare class Image_2 { * Get the offsets where the buffer equals the input value. * Loops through the whole volume, can get long for big data... * - * @param {number|object} value The value to check. - * @returns {Array} The list of offsets. + * @param {number|RGB} value The value to check. + * @returns {number[]} The list of offsets. */ - getOffsets(value: number | object): any[]; + getOffsets(value: number | RGB): number[]; /** * Check if the input values are in the buffer. * Could loop through the whole volume, can get long for big data... * * @param {Array} values The values to check. - * @returns {Array} A list of booleans for each input value, + * @returns {boolean[]} A list of booleans for each input value, * set to true if the value is present in the buffer. */ - hasValues(values: any[]): any[]; + hasValues(values: any[]): boolean[]; /** * Clone the image. * @@ -1466,6 +2693,7 @@ declare class Image_2 { * Append a slice to the image. * * @param {Image} rhs The slice to append. + * @fires Image#imagegeometrychange */ appendSlice(rhs: Image_2): void; /** @@ -1485,15 +2713,15 @@ declare class Image_2 { /** * Get the data range. * - * @returns {object} The data range. + * @returns {NumberRange} The data range. */ - getDataRange(): object; + getDataRange(): NumberRange; /** * Get the rescaled data range. * - * @returns {object} The rescaled data range. + * @returns {NumberRange} The rescaled data range. */ - getRescaledDataRange(): object; + getRescaledDataRange(): NumberRange; /** * Get the histogram. * @@ -1519,29 +2747,31 @@ declare class Image_2 { /** * Set the inner buffer values at given offsets. * - * @param {Array} offsets List of offsets where to set the data. - * @param {object} value The value to set at the given offsets. - * @fires Image#imagechange + * @param {number[]} offsets List of offsets where to set the data. + * @param {number|RGB} value The value to set at the given offsets. + * @fires Image#imagecontentchange */ - setAtOffsets(offsets: any[], value: object): void; + setAtOffsets(offsets: number[], value: number | RGB): void; /** * Set the inner buffer values at given offsets. * - * @param {Array} offsetsLists List of offset lists where to set the data. - * @param {object} value The value to set at the given offsets. + * @param {number[][]} offsetsLists List of offset lists where + * to set the data. + * @param {RGB} value The value to set at the given offsets. * @returns {Array} A list of objects representing the original values before * replacing them. - * @fires Image#imagechange + * @fires Image#imagecontentchange */ - setAtOffsetsAndGetOriginals(offsetsLists: any[], value: object): any[]; + setAtOffsetsAndGetOriginals(offsetsLists: number[][], value: RGB): any[]; /** * Set the inner buffer values at given offsets. * - * @param {Array} offsetsLists List of offset lists where to set the data. - * @param {object|Array} value The value to set at the given offsets. - * @fires Image#imagechange + * @param {number[][]} offsetsLists List of offset lists + * where to set the data. + * @param {RGB|Array} value The value to set at the given offsets. + * @fires Image#imagecontentchange */ - setAtOffsetsWithIterator(offsetsLists: any[], value: object | any[]): void; + setAtOffsetsWithIterator(offsetsLists: number[][], value: RGB | any[]): void; /** * Get the value of the image at a specific coordinate. * @@ -1613,20 +2843,20 @@ declare class Image_2 { * * Note: Uses raw buffer values. * - * @param {Array} weights The weights of the 2D kernel as a 3x3 matrix. + * @param {number[]} weights The weights of the 2D kernel as a 3x3 matrix. * @returns {Image} The convoluted image. */ - convolute2D(weights: any[]): Image_2; + convolute2D(weights: number[]): Image_2; /** * Convolute an image buffer with a given 2D kernel. * * Note: Uses raw buffer values. * - * @param {Array} weights The weights of the 2D kernel as a 3x3 matrix. + * @param {number[]} weights The weights of the 2D kernel as a 3x3 matrix. * @param {TypedArray} buffer The buffer to convolute. * @param {number} startOffset The index to start at. */ - convoluteBuffer(weights: any[], buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, startOffset: number): void; + convoluteBuffer(weights: number[], buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, startOffset: number): void; /** * Transform an image using a specific operator. * WARNING: no size check! @@ -1721,49 +2951,48 @@ export declare class Index { * @returns {Index} The new index. */ getWithNew2D(i: number, j: number): Index; - /** - * Get a string id from the index values in the form of: '#0-1_#1-2'. - * - * @param {number[]} [dims] Optional list of dimensions to use. - * @returns {string} The string id. - */ - toStringId(dims?: number[]): string; #private; } +/** + * Check if two rgb objects are equal. + * + * @param {RGB} c1 The first colour. + * @param {RGB} c2 The second colour. + * @returns {boolean} True if both colour are equal. + */ +export declare function isEqualRgb(c1: RGB, c2: RGB): boolean; + +/** + * CIE LAB value (L: [0, 100], a: [-128, 127], b: [-128, 127]) to + * unsigned int CIE LAB ([0, 65535]). + * + * @param {object} triplet CIE XYZ triplet as {l,a,b} with CIE LAB range. + * @returns {object} CIE LAB triplet as {l,a,b} with unsigned range. + */ +export declare function labToUintLab(triplet: object): object; + /** * Layer group. * - * Display position: {x,y} - * Plane position: Index (access: get(i)) - * (world) Position: Point3D (access: getX, getY, getZ) + * - Display position: {x,y}, + * - Plane position: Index (access: get(i)), + * - (world) Position: Point3D (access: getX, getY, getZ). * * Display -> World: - * planePos = viewLayer.displayToPlanePos(displayPos) - * -> compensate for layer scale and offset - * pos = viewController.getPositionFromPlanePoint(planePos) + * - planePos = viewLayer.displayToPlanePos(displayPos) + * -> compensate for layer scale and offset, + * - pos = viewController.getPositionFromPlanePoint(planePos). * - * World -> display - * planePos = viewController.getOffset3DFromPlaneOffset(pos) - * no need yet for a planePos to displayPos... + * World -> Display: + * - planePos = viewController.getOffset3DFromPlaneOffset(pos) + * no need yet for a planePos to displayPos... */ export declare class LayerGroup { /** * @param {HTMLElement} containerDiv The associated HTML div. */ constructor(containerDiv: HTMLElement); - /** - * Get the target orientation. - * - * @returns {Matrix33} The orientation matrix. - */ - getTargetOrientation(): Matrix33; - /** - * Set the target orientation. - * - * @param {Matrix33} orientation The orientation matrix. - */ - setTargetOrientation(orientation: Matrix33): void; /** * Get the showCrosshair flag. * @@ -1776,6 +3005,12 @@ export declare class LayerGroup { * @param {boolean} flag True to display the crosshair. */ setShowCrosshair(flag: boolean): void; + /** + * Set the imageSmoothing flag value. + * + * @param {boolean} flag True to enable smoothing. + */ + setImageSmoothing(flag: boolean): void; /** * Get the Id of the container div. * @@ -1785,46 +3020,95 @@ export declare class LayerGroup { /** * Get the layer scale. * - * @returns {object} The scale as {x,y,z}. + * @returns {Scalar3D} The scale as {x,y,z}. */ - getScale(): object; + getScale(): Scalar3D; /** * Get the base scale. * - * @returns {object} The scale as {x,y,z}. + * @returns {Scalar3D} The scale as {x,y,z}. */ - getBaseScale(): object; + getBaseScale(): Scalar3D; /** - * Get the added scale: the scale added to the base scale + * Get the added scale: the scale added to the base scale. * - * @returns {object} The scale as {x,y,z}. + * @returns {Scalar3D} The scale as {x,y,z}. */ - getAddedScale(): object; + getAddedScale(): Scalar3D; /** * Get the layer offset. * - * @returns {object} The offset as {x,y,z}. + * @returns {Scalar3D} The offset as {x,y,z}. */ - getOffset(): object; + getOffset(): Scalar3D; /** * Get the number of layers handled by this class. * * @returns {number} The number of layers. */ getNumberOfLayers(): number; + /** + * Check if this layerGroup contains a layer with the input id. + * + * @param {string} id The layer id to look for. + * @returns {boolean} True if this group contains + * a layer with the input id. + */ + includes(id: string): boolean; + /** + * Get a list of view layers according to an input callback function. + * + * @param {Function} [callbackFn] A function that takes + * a ViewLayer as input and returns a boolean. If undefined, + * returns all view layers. + * @returns {ViewLayer[]} The layers that + * satisfy the callbackFn. + */ + getViewLayers(callbackFn?: Function): ViewLayer[]; + /** + * Test if one of the view layers satisfies an input callbackFn. + * + * @param {Function} callbackFn A function that takes + * a ViewLayer as input and returns a boolean. + * @returns {boolean} True if one of the ViewLayers + * satisfies the callbackFn. + */ + someViewLayer(callbackFn: Function): boolean; + /** + * Get a list of draw layers according to an input callback function. + * + * @param {Function} [callbackFn] A function that takes + * a DrawLayer as input and returns a boolean. If undefined, + * returns all draw layers. + * @returns {DrawLayer[]} The layers that + * satisfy the callbackFn. + */ + getDrawLayers(callbackFn?: Function): DrawLayer[]; + /** + * Get the number of view layers handled by this class. + * + * @returns {number} The number of layers. + */ + getNumberOfViewLayers(): number; /** * Get the active image layer. * - * @returns {ViewLayer} The layer. + * @returns {ViewLayer|undefined} The layer. */ - getActiveViewLayer(): ViewLayer; + getActiveViewLayer(): ViewLayer | undefined; /** - * Get the view layers associated to a data index. + * Get the base view layer. * - * @param {number} index The data index. + * @returns {ViewLayer|undefined} The layer. + */ + getBaseViewLayer(): ViewLayer | undefined; + /** + * Get the view layers associated to a data id. + * + * @param {string} dataId The data id. * @returns {ViewLayer[]} The layers. */ - getViewLayersByDataIndex(index: number): ViewLayer[]; + getViewLayersByDataId(dataId: string): ViewLayer[]; /** * Search view layers for equal imae meta data. * @@ -1835,22 +3119,22 @@ export declare class LayerGroup { /** * Get the view layers data indices. * - * @returns {Array} The list of indices. + * @returns {string[]} The list of indices. */ - getViewDataIndices(): any[]; + getViewDataIndices(): string[]; /** * Get the active draw layer. * - * @returns {DrawLayer} The layer. + * @returns {DrawLayer|undefined} The layer. */ - getActiveDrawLayer(): DrawLayer; + getActiveDrawLayer(): DrawLayer | undefined; /** - * Get the draw layers associated to a data index. + * Get the draw layers associated to a data id. * - * @param {number} index The data index. + * @param {string} dataId The data id. * @returns {DrawLayer[]} The layers. */ - getDrawLayersByDataIndex(index: number): DrawLayer[]; + getDrawLayersByDataId(dataId: string): DrawLayer[]; /** * Set the active view layer. * @@ -1858,32 +3142,37 @@ export declare class LayerGroup { */ setActiveViewLayer(index: number): void; /** - * Set the active view layer with a data index. + * Set the active view layer with a data id. * - * @param {number} index The data index. + * @param {string} dataId The data id. */ - setActiveViewLayerByDataIndex(index: number): void; + setActiveViewLayerByDataId(dataId: string): void; /** * Set the active draw layer. * - * @param {number} index The index of the layer to set as active. + * @param {number|undefined} index The index of the layer to set as active + * or undefined to not set any. */ - setActiveDrawLayer(index: number): void; + setActiveDrawLayer(index: number | undefined): void; /** - * Set the active draw layer with a data index. + * Set the active draw layer with a data id. * - * @param {number} index The data index. + * @param {string} dataId The data id. */ - setActiveDrawLayerByDataIndex(index: number): void; + setActiveDrawLayerByDataId(dataId: string): void; /** * Add a view layer. * + * The new layer will be marked as the active view layer. + * * @returns {ViewLayer} The created layer. */ addViewLayer(): ViewLayer; /** * Add a draw layer. * + * The new layer will be marked as the active draw layer. + * * @returns {DrawLayer} The created layer. */ addDrawLayer(): DrawLayer; @@ -1891,6 +3180,53 @@ export declare class LayerGroup { * Empty the layer list. */ empty(): void; + /** + * Remove all layers for a specific data. + * + * @param {string} dataId The data to remove its layers. + */ + removeLayersByDataId(dataId: string): void; + /** + * Remove a layer from this layer group. + * Warning: if current active layer, the index will + * be set to `undefined`. Call one of the setActive + * methods to define the active index. + * + * @param {ViewLayer | DrawLayer} layer The layer to remove. + */ + removeLayer(layer: ViewLayer | DrawLayer): void; + /** + * Displays a tooltip in a temporary `span`. + * Works with css to hide/show the span only on mouse hover. + * + * @param {Point2D} point The update point. + */ + showTooltip(point: Point2D): void; + /** + * Remove the tooltip html div. + */ + removeTooltipDiv(): void; + /** + * Can the input position be set on one of the view layers. + * + * @param {Point} position The input position. + * @returns {boolean} True if one view layer accepts the input position. + */ + isPositionInBounds(position: Point): boolean; + /** + * Can one of the view layers be scrolled. + * + * @returns {boolean} True if one view layer can be scrolled. + */ + canScroll(): boolean; + /** + * Does one of the view layer have more than one slice in the + * given dimension. + * + * @param {number} dim The input dimension. + * @returns {boolean} True if one view layer has more than one slice. + */ + moreThanOne(dim: number): boolean; /** * Update layers (but not the active view layer) to a position change. * @@ -1899,23 +3235,24 @@ export declare class LayerGroup { */ updateLayersToPositionChange: (event: object) => void; /** - * Calculate the fit scale: the scale that fits the largest data. + * Calculate the div to world size ratio needed to fit + * the largest data. * - * @returns {number|undefined} The fit scale. + * @returns {number|undefined} The ratio. */ - calculateFitScale(): number | undefined; + getDivToWorldSizeRatio(): number | undefined; /** - * Set the layer group fit scale. + * Fit to container: set the layers div to world size ratio. * - * @param {number} scaleIn The fit scale. + * @param {number} divToWorldSizeRatio The ratio. */ - setFitScale(scaleIn: number): void; + fitToContainer(divToWorldSizeRatio: number): void; /** - * Get the largest data size. + * Get the largest data world (mm) size. * - * @returns {object|undefined} The largest size as {x,y}. + * @returns {Scalar2D|undefined} The largest size as {x,y}. */ - getMaxSize(): object | undefined; + getMaxWorldSize(): Scalar2D | undefined; /** * Flip all layers along the Z axis without offset compensation. */ @@ -1930,24 +3267,24 @@ export declare class LayerGroup { /** * Set the layers' scale. * - * @param {object} newScale The scale to apply as {x,y,z}. + * @param {Scalar3D} newScale The scale to apply as {x,y,z}. * @param {Point3D} [center] The scale center Point3D. * @fires LayerGroup#zoomchange */ - setScale(newScale: object, center?: Point3D): void; + setScale(newScale: Scalar3D, center?: Point3D): void; /** * Add translation to the layers. * - * @param {object} translation The translation as {x,y,z}. + * @param {Scalar3D} translation The translation as {x,y,z}. */ - addTranslation(translation: object): void; + addTranslation(translation: Scalar3D): void; /** * Set the layers' offset. * - * @param {object} newOffset The offset as {x,y,z}. + * @param {Scalar3D} newOffset The offset as {x,y,z}. * @fires LayerGroup#offsetchange */ - setOffset(newOffset: object): void; + setOffset(newOffset: Scalar3D): void; /** * Reset the stage to its initial scale and no offset. */ @@ -1983,13 +3320,13 @@ export declare class LayerGroup { export declare namespace logger { export namespace levels { - const TRACE: number; - const DEBUG: number; - const INFO: number; - const WARN: number; - const ERROR: number; + let TRACE: number; + let DEBUG: number; + let INFO: number; + let WARN: number; + let ERROR: number; } - const level: number; + let level: number; export function trace(msg: string): void; export function debug(msg: string): void; export function info(msg: string): void; @@ -2006,22 +3343,244 @@ export declare const luts: { [x: string]: ColourMap; }; +/** + * Mask {@link Image} factory. + */ +export declare class MaskFactory { + /** + * Get a warning string if elements are not as expected. + * Created by checkElements. + * + * @returns {string|undefined} The warning. + */ + getWarning(): string | undefined; + /** + * Check dicom elements. Throws an error if not suitable. + * + * @param {Object} _dicomElements The DICOM tags. + * @returns {string|undefined} A possible warning. + */ + checkElements(_dicomElements: { + [x: string]: DataElement; + }): string | undefined; + /** + * Get an {@link Image} object from the read DICOM file. + * + * @param {Object} dataElements The DICOM tags. + * @param {Uint8Array | Int8Array | + * Uint16Array | Int16Array | + * Uint32Array | Int32Array} pixelBuffer The pixel buffer. + * @returns {Image} A new Image. + */ + create(dataElements: { + [x: string]: DataElement; + }, pixelBuffer: Uint8Array | Int8Array | Uint16Array | Int16Array | Uint32Array | Int32Array): Image_2; + /** + * Convert a mask image into a DICOM segmentation object. + * + * @param {Image} image The mask image. + * @param {MaskSegment[]} segments The mask segments. + * @param {Image} sourceImage The source image. + * @param {Object} [extraTags] Optional list of extra tags. + * @returns {Object} A list of dicom elements. + */ + toDicom(image: Image_2, segments: MaskSegment[], sourceImage: Image_2, extraTags?: { + [x: string]: any; + }): { + [x: string]: DataElement; + }; + #private; +} + +/** + * DICOM (mask) segment: item of a SegmentSequence (0062,0002). + * + * Ref: {@link https://dicom.nema.org/medical/dicom/2022a/output/chtml/part03/sect_C.8.20.4.html}. + */ +export declare class MaskSegment { + /** + * @param {number} number The segment number. + * @param {string} label The segment label. + * @param {string} algorithmType The segment number. + */ + constructor(number: number, label: string, algorithmType: string); + /** + * Segment number (0062,0004). + * + * @type {number} + */ + number: number; + /** + * Segment label (0062,0005). + * + * @type {string} + */ + label: string; + /** + * Segment algorithm type (0062,0008). + * + * @type {string} + */ + algorithmType: string; + /** + * Segment algorithm name (0062,0009). + * + * @type {string|undefined} + */ + algorithmName: string | undefined; + /** + * Segment display value as simple value. + * + * @type {number|undefined} + */ + displayValue: number | undefined; + /** + * Segment display value as RGB colour ({r,g,b}). + * + * @type {RGB|undefined} + */ + displayRGBValue: RGB | undefined; + /** + * Segment property code: specific property + * the segment represents (0062,000F). + * + * @type {DicomCode|undefined} + */ + propertyTypeCode: DicomCode | undefined; + /** + * Segment property category code: general category + * of the property the segment represents (0062,0003). + * + * @type {DicomCode|undefined} + */ + propertyCategoryCode: DicomCode | undefined; + /** + * Segment tracking UID (0062,0021). + * + * @type {string|undefined} + */ + trackingUid: string | undefined; + /** + * Segment tracking id: text label for the UID (0062,0020). + * + * @type {string|undefined} + */ + trackingId: string | undefined; +} + +/** + * Mask segment helper: helps handling the segments list, + * but does *NOT* update the associated mask (use special commands + * for that such as DeleteSegmentCommand, ChangeSegmentColourCommand...). + */ +export declare class MaskSegmentHelper { + /** + * @param {Image} mask The associated mask image. + */ + constructor(mask: Image_2); + /** + * Check if a segment is part of the segments list. + * + * @param {number} segmentNumber The segment number. + * @returns {boolean} True if the segment is included. + */ + hasSegment(segmentNumber: number): boolean; + /** + * Get the number of segments of the segmentation. + * + * @returns {number} The number of segments. + */ + getNumberOfSegments(): number; + /** + * Check if a segment is present in a mask image. + * + * @param {number[]} numbers Array of segment numbers. + * @returns {boolean[]} Array of boolean set to true + * if the segment is present in the mask. + */ + maskHasSegments(numbers: number[]): boolean[]; + /** + * Get a segment from the inner segment list. + * + * @param {number} segmentNumber The segment number. + * @returns {MaskSegment|undefined} The segment or undefined if not found. + */ + getSegment(segmentNumber: number): MaskSegment | undefined; + /** + * Add a segment to the segments list. + * + * @param {MaskSegment} segment The segment to add. + */ + addSegment(segment: MaskSegment): void; + /** + * Remove a segment from the segments list. + * + * @param {number} segmentNumber The segment number. + */ + removeSegment(segmentNumber: number): void; + /** + * Update a segment of the segments list. + * + * @param {MaskSegment} segment The segment to update. + */ + updateSegment(segment: MaskSegment): void; + #private; +} + +/** + * Mask segment view helper: handles hidden segments. + */ +export declare class MaskSegmentViewHelper { + /** + * Check if a segment is in the hidden list. + * + * @param {number} segmentNumber The segment number. + * @returns {boolean} True if the segment is in the list. + */ + isHidden(segmentNumber: number): boolean; + /** + * Add a segment to the hidden list. + * + * @param {MaskSegment} segment The segment to add. + */ + addToHidden(segment: MaskSegment): void; + /** + * Remove a segment from the hidden list. + * + * @param {number} segmentNumber The segment number. + */ + removeFromHidden(segmentNumber: number): void; + /** + * @callback alphaFn@callback alphaFn + * @param {number[]|number} value The pixel value. + * @param {number} index The values' index. + * @returns {number} The opacity of the input value. + */ + /** + * Get the alpha function to apply hidden colors. + * + * @returns {alphaFn} The corresponding alpha function. + */ + getAlphaFunc(): (value: number[] | number, index: number) => number; + #private; +} + /** * Immutable 3x3 Matrix. */ export declare class Matrix33 { /** - * @param {Array} values row-major ordered 9 values. + * @param {number[]} values Row-major ordered 9 values. */ - constructor(values: any[]); + constructor(values: number[]); /** * Get a value of the matrix. * * @param {number} row The row at wich to get the value. * @param {number} col The column at wich to get the value. - * @returns {number} The value at the position. + * @returns {number|undefined} The value at the position. */ - get(row: number, col: number): number; + get(row: number, col: number): number | undefined; /** * Get the inverse of this matrix. * @@ -2060,64 +3619,290 @@ export declare class Matrix33 { /** * Multiply this matrix by a 3D array. * - * @param {Array} array3D The input 3D array. - * @returns {Array} The result 3D array. + * @param {number[]} array3D The input 3D array. + * @returns {number[]} The result 3D array. + */ + multiplyArray3D(array3D: number[]): number[]; + /** + * Multiply this matrix by a 3D vector. + * + * @param {Vector3D} vector3D The input 3D vector. + * @returns {Vector3D} The result 3D vector. + */ + multiplyVector3D(vector3D: Vector3D): Vector3D; + /** + * Multiply this matrix by a 3D point. + * + * @param {Point3D} point3D The input 3D point. + * @returns {Point3D} The result 3D point. + */ + multiplyPoint3D(point3D: Point3D): Point3D; + /** + * Multiply this matrix by a 3D index. + * + * @param {Index} index3D The input 3D index. + * @returns {Index} The result 3D index. + */ + multiplyIndex3D(index3D: Index): Index; + /** + * Get the index of the maximum in absolute value of a row. + * + * @param {number} row The row to get the maximum from. + * @returns {object} The {value,index} of the maximum. + */ + getRowAbsMax(row: number): object; + /** + * Get the index of the maximum in absolute value of a column. + * + * @param {number} col The column to get the maximum from. + * @returns {object} The {value,index} of the maximum. + */ + getColAbsMax(col: number): object; + /** + * Get this matrix with only zero and +/- ones instead of the maximum. + * + * @returns {Matrix33} The simplified matrix. + */ + asOneAndZeros(): Matrix33; + /** + * Get the third column direction index of an orientation matrix. + * + * @returns {number} The index of the absolute maximum of the last column. + */ + getThirdColMajorDirection(): number; + #private; +} + +/** + * Number range. + */ +export declare class NumberRange { + /** + * @param {number} min The minimum. + * @param {number} max The maximum. + */ + constructor(min: number, max: number); + /** + * @type {number} + */ + min: number; + /** + * @type {number} + */ + max: number; +} + +export declare namespace Orientation { + let Axial: string; + let Coronal: string; + let Sagittal: string; +} + +/** + * DICOM Header overlay info. + */ +export declare class OverlayData { + /** + * @param {App} app The associated application. + * @param {string} dataId The associated data id. + * @param {object} configs The overlay config. + */ + constructor(app: App, dataId: string, configs: object); + /** + * Reset the data. + */ + reset(): void; + /** + * Handle a new loaded item event. + * + * @param {object} data The item meta data. + */ + addItemMeta(data: object): void; + /** + * Is this class listening to app events. + * + * @returns {boolean} True is listening to app events. + */ + isListening(): boolean; + /** + * Toggle info listeners. + */ + addAppListeners(): void; + /** + * Toggle info listeners. + */ + removeAppListeners(): void; + /** + * Add an event listener to this class. + * + * @param {string} type The event type. + * @param {object} callback The method associated with the provided + * event type, will be called with the fired event. + */ + addEventListener(type: string, callback: object): void; + /** + * Remove an event listener from this class. + * + * @param {string} type The event type. + * @param {object} callback The method associated with the provided + * event type. + */ + removeEventListener(type: string, callback: object): void; + #private; +} + +/** + * Plane geometry helper. + */ +export declare class PlaneHelper { + /** + * @param {Geometry} imageGeometry The image geometry. + * @param {Matrix33} viewOrientation The view orientation. + */ + constructor(imageGeometry: Geometry, viewOrientation: Matrix33); + /** + * Get the view orientation. + * + * @returns {Matrix33} The orientation matrix. + */ + getViewOrientation(): Matrix33; + /** + * Get the target orientation. + * + * @returns {Matrix33} The orientation matrix. + */ + getTargetOrientation(): Matrix33; + /** + * Get a 3D offset from a plane one. + * + * @param {Scalar2D} offset2D The plane offset as {x,y}. + * @returns {Vector3D} The 3D world offset. + */ + getOffset3DFromPlaneOffset(offset2D: Scalar2D): Vector3D; + /** + * Get a plane offset from a 3D one. + * + * @param {Scalar3D} offset3D The 3D offset as {x,y,z}. + * @returns {Scalar2D} The plane offset as {x,y}. + */ + getPlaneOffsetFromOffset3D(offset3D: Scalar3D): Scalar2D; + /** + * Orient an input vector from real to target space. + * + * @param {Vector3D} vector The input vector. + * @returns {Vector3D} The oriented vector. + */ + getTargetOrientedVector3D(vector: Vector3D): Vector3D; + /** + * De-orient an input vector from target to real space. + * + * @param {Vector3D} planeVector The input vector. + * @returns {Vector3D} The de-orienteded vector. + */ + getTargetDeOrientedVector3D(planeVector: Vector3D): Vector3D; + /** + * De-orient an input point from target to real space. + * + * @param {Point3D} planePoint The input point. + * @returns {Point3D} The de-orienteded point. + */ + getTargetDeOrientedPoint3D(planePoint: Point3D): Point3D; + /** + * Orient an input vector from target to image space. + * + * @param {Vector3D} planeVector The input vector. + * @returns {Vector3D} The orienteded vector. + */ + getImageOrientedVector3D(planeVector: Vector3D): Vector3D; + /** + * Orient an input point from target to image space. + * + * @param {Point3D} planePoint The input vector. + * @returns {Point3D} The orienteded vector. + */ + getImageOrientedPoint3D(planePoint: Point3D): Point3D; + /** + * De-orient an input vector from image to target space. + * + * @param {Vector3D} vector The input vector. + * @returns {Vector3D} The de-orienteded vector. + */ + getImageDeOrientedVector3D(vector: Vector3D): Vector3D; + /** + * De-orient an input point from image to target space. + * + * @param {Point3D} point The input point. + * @returns {Point3D} The de-orienteded point. + */ + getImageDeOrientedPoint3D(point: Point3D): Point3D; + /** + * Get a world position from a 2D plane position. + * + * @param {Point2D} point2D The plane point. + * @param {number} k The slice index. + * @returns {Point3D} The world position. + */ + getPositionFromPlanePoint(point2D: Point2D, k: number): Point3D; + /** + * Get a 2D plane position from a world position. + * + * @param {Point} point The world position. + * @returns {Point3D} The plane point. */ - multiplyArray3D(array3D: any[]): any[]; + getPlanePointFromPosition(point: Point): Point3D; /** - * Multiply this matrix by a 3D vector. + * Get the cosines of this plane. * - * @param {Vector3D} vector3D The input 3D vector. - * @returns {Vector3D} The result 3D vector. + * @returns {number[]} The 2 cosines vectors (3D). */ - multiplyVector3D(vector3D: Vector3D): Vector3D; + getCosines(): number[]; /** - * Multiply this matrix by a 3D point. + * Get a list of points that define the plane at input position, + * given this classes orientation. * - * @param {Point3D} point3D The input 3D point. - * @returns {Point3D} The result 3D point. + * @param {Point} position The position. + * @returns {Point3D[]} An origin and 2 cosines vectors. */ - multiplyPoint3D(point3D: Point3D): Point3D; + getPlanePoints(position: Point): Point3D[]; /** - * Multiply this matrix by a 3D index. + * Image world to index. * - * @param {Index} index3D The input 3D index. - * @returns {Index} The result 3D index. + * @param {Point} point The input point. + * @returns {Index} The corresponding index. */ - multiplyIndex3D(index3D: Index): Index; + worldToIndex(point: Point): Index; /** - * Get the index of the maximum in absolute value of a row. + * Is this view in the same orientation as the image aquisition. * - * @param {number} row The row to get the maximum from. - * @returns {object} The {value,index} of the maximum. + * @returns {boolean} True if in aquisition plane. */ - getRowAbsMax(row: number): object; + isAquisitionOrientation(): boolean; /** - * Get the index of the maximum in absolute value of a column. + * Reorder values to follow target orientation. * - * @param {number} col The column to get the maximum from. - * @returns {object} The {value,index} of the maximum. + * @param {Scalar3D} values Values as {x,y,z}. + * @returns {Scalar3D} Reoriented values as {x,y,z}. */ - getColAbsMax(col: number): object; + getTargetOrientedPositiveXYZ(values: Scalar3D): Scalar3D; /** - * Get this matrix with only zero and +/- ones instead of the maximum, + * Get the (view) scroll dimension index. * - * @returns {Matrix33} The simplified matrix. + * @returns {number} The index. */ - asOneAndZeros(): Matrix33; + getScrollIndex(): number; /** - * Get the third column direction index of an orientation matrix. + * Get the native (image) scroll dimension index. * - * @returns {number} The index of the absolute maximum of the last column. + * @returns {number} The index. */ - getThirdColMajorDirection(): number; + getNativeScrollIndex(): number; #private; } /** * Immutable point. * Warning: the input array is NOT cloned, modifying it will - * modify the index values. + * modify the point values. */ export declare class Point { /** @@ -2125,26 +3910,26 @@ export declare class Point { */ constructor(values: number[]); /** - * Get the index value at the given array index. + * Get the point value at the given array index. * * @param {number} i The index to get. * @returns {number} The value. */ get(i: number): number; /** - * Get the length of the index. + * Get the length of the point. * * @returns {number} The length. */ length(): number; /** - * Get a string representation of the Index. + * Get a string representation of the point. * - * @returns {string} The Index as a string. + * @returns {string} The point as a string. */ toString(): string; /** - * Get the values of this index. + * Get the values of this point. * * @returns {number[]} The array of values. */ @@ -2214,6 +3999,18 @@ export declare class Point2D { * @returns {number} The Y position of the point. */ getY(): number; + /** + * Get the values of this point. + * + * @returns {number[]} The array of values. + */ + getValues(): number[]; + /** + * Get the centroid of the point, ie itself. + * + * @returns {Point2D} The centroid point. + */ + getCentroid(): Point2D; /** * Check for Point2D equality. * @@ -2231,15 +4028,9 @@ export declare class Point2D { * Get the distance to another Point2D. * * @param {Point2D} point2D The input point. - * @returns {number} The distance to the input point. + * @returns {number} Ths distance to the input point. */ getDistance(point2D: Point2D): number; - /** - * Round a Point2D. - * - * @returns {Point2D} The rounded point. - */ - getRound(): Point2D; #private; } @@ -2271,6 +4062,12 @@ export declare class Point3D { * @returns {number} The Z position of the point. */ getZ(): number; + /** + * Get the values of this point. + * + * @returns {number[]} The array of values. + */ + getValues(): number[]; /** * Check for Point3D equality. * @@ -2300,6 +4097,13 @@ export declare class Point3D { * @returns {number} Ths distance to the input point. */ getDistance(point3D: Point3D): number; + /** + * Get the closest point to this in a Point3D list. + * + * @param {Point3D[]} pointList The list to check. + * @returns {number} The index of the closest point in the input list. + */ + getClosest(pointList: Point3D[]): number; /** * Get the difference to another Point3D. * @@ -2312,9 +4116,11 @@ export declare class Point3D { /** * Round a float number to a given precision. - * Inspired from https://stackoverflow.com/a/49729715/3639892. + * + * Inspired from {@link https://stackoverflow.com/a/49729715/3639892}. + * * Can be a solution to not have trailing zero as when - * using toFixed or toPrecision. + * using toFixed or toPrecision. * '+number.toFixed(precision)' does not pass all the tests... * * @param {number} number The number to round. @@ -2324,50 +4130,138 @@ export declare class Point3D { export declare function precisionRound(number: number, precision: number): number; /** - * Rescale LUT class. - * Typically converts from integer to float. + * Protractor shape: 3 points from which to calculate an angle. */ -export declare class RescaleLut { +export declare class Protractor { /** - * @param {RescaleSlopeAndIntercept} rsi The rescale slope and intercept. - * @param {number} bitsStored The number of bits used to store the data. + * @param {Point2D[]} points The list of Point2D that make + * the protractor. */ - constructor(rsi: RescaleSlopeAndIntercept, bitsStored: number); + constructor(points: Point2D[]); /** - * Get the Rescale Slope and Intercept (RSI). + * Get a point of the list. * - * @returns {RescaleSlopeAndIntercept} The rescale slope and intercept object. + * @param {number} index The index of the point + * to get (beware, no size check). + * @returns {Point2D|undefined} The Point2D at the given index. */ - getRSI(): RescaleSlopeAndIntercept; + getPoint(index: number): Point2D | undefined; /** - * Is the lut ready to use or not? If not, the user must - * call 'initialise'. + * Get the length of the path (should be 3). * - * @returns {boolean} True if the lut is ready to use. + * @returns {number} The length of the path. */ - isReady(): boolean; + getLength(): number; /** - * Initialise the LUT. + * Get the centroid of the protractor. + * + * @returns {Point2D} THe centroid point. */ - initialise(): void; + getCentroid(): Point2D; /** - * Get the length of the LUT array. + * Quantify a path according to view information. * - * @returns {number} The length of the LUT array. + * @param {ViewController} _viewController The associated view controller. + * @param {string[]} _flags A list of stat values to calculate. + * @returns {object} A quantification object. */ - getLength(): number; + quantify(_viewController: ViewController, _flags: string[]): object; + #private; +} + +/** + * Rectangle shape. + */ +export declare class Rectangle { + /** + * @param {Point2D} begin A Point2D representing the beginning + * of the rectangle. + * @param {Point2D} end A Point2D representing the end + * of the rectangle. + */ + constructor(begin: Point2D, end: Point2D); + /** + * Get the begin point of the rectangle. + * + * @returns {Point2D} The begin point of the rectangle. + */ + getBegin(): Point2D; + /** + * Get the end point of the rectangle. + * + * @returns {Point2D} The end point of the rectangle. + */ + getEnd(): Point2D; + /** + * Check for equality. + * + * @param {Rectangle} rhs The object to compare to. + * @returns {boolean} True if both objects are equal. + */ + equals(rhs: Rectangle): boolean; + /** + * Get the surface of the rectangle. + * + * @returns {number} The surface of the rectangle. + */ + getSurface(): number; + /** + * Get the surface of the rectangle according to a spacing. + * + * @param {Scalar2D} spacing2D The 2D spacing. + * @returns {number} The surface of the rectangle multiplied by the given + * spacing or null for null spacings. + */ + getWorldSurface(spacing2D: Scalar2D): number; + /** + * Get the real width of the rectangle. + * + * @returns {number} The real width of the rectangle. + */ + getRealWidth(): number; + /** + * Get the real height of the rectangle. + * + * @returns {number} The real height of the rectangle. + */ + getRealHeight(): number; + /** + * Get the width of the rectangle. + * + * @returns {number} The width of the rectangle. + */ + getWidth(): number; + /** + * Get the height of the rectangle. + * + * @returns {number} The height of the rectangle. + */ + getHeight(): number; + /** + * Get the rounded limits of the rectangle. + * + * @returns {object} The rounded limits as {min, max} (Point2D). + */ + getRound(): object; /** - * Get the value of the LUT at the given offset. + * Get the centroid of the rectangle. * - * @param {number} offset The input offset in [0,2^bitsStored] range. - * @returns {number} The float32 value of the LUT at the given offset. + * @returns {Point2D} The centroid point. */ - getValue(offset: number): number; + getCentroid(): Point2D; + /** + * Quantify a rectangle according to view information. + * + * @param {ViewController} viewController The associated view controller. + * @param {string[]} flags A list of stat values to calculate. + * @returns {object} A quantification object. + */ + quantify(viewController: ViewController, flags: string[]): object; #private; } /** - * Rescale Slope and Intercept + * Rescale Slope and Intercept. */ export declare class RescaleSlopeAndIntercept { /** @@ -2401,12 +4295,6 @@ export declare class RescaleSlopeAndIntercept { * @returns {boolean} True if both RSI are equal. */ equals(rhs: RescaleSlopeAndIntercept): boolean; - /** - * Get a string representation of the RSI. - * - * @returns {string} The RSI as a string. - */ - toString(): string; /** * Is this RSI an ID RSI. * @@ -2416,6 +4304,148 @@ export declare class RescaleSlopeAndIntercept { #private; } +/** + * RGB colour class. + */ +export declare class RGB { + /** + * @param {number} r Red component. + * @param {number} g Green component. + * @param {number} b Blue component. + */ + constructor(r: number, g: number, b: number); + /** + * Red component. + * + * @type {number} + */ + r: number; + /** + * Green component. + * + * @type {number} + */ + g: number; + /** + * Blue component. + * + * @type {number} + */ + b: number; +} + +/** + * Region Of Interest shape. + * Note: should be a closed path. + */ +export declare class ROI { + /** + * @param {Point2D[]} [points] Optional initial point list. + */ + constructor(points?: Point2D[]); + /** + * Get a point of the list at a given index. + * + * @param {number} index The index of the point to get + * (beware, no size check). + * @returns {Point2D|undefined} The Point2D at the given index. + */ + getPoint(index: number): Point2D | undefined; + /** + * Get the point list. + * + * @returns {Point2D[]} The list. + */ + getPoints(): Point2D[]; + /** + * Get the length of the point list. + * + * @returns {number} The length of the point list. + */ + getLength(): number; + /** + * Add a point to the ROI. + * + * @param {Point2D} point The Point2D to add. + */ + addPoint(point: Point2D): void; + /** + * Add points to the ROI. + * + * @param {Point2D[]} rhs The array of POints2D to add. + */ + addPoints(rhs: Point2D[]): void; + /** + * Get the centroid of the roi. Only valid for + * a non-self-intersecting closed polygon. + * Ref: {@link https://en.wikipedia.org/wiki/Centroid#Of_a_polygon}. + * + * @returns {Point2D} The centroid point. + */ + getCentroid(): Point2D; + #private; +} + +/** + * Mutable 2D scalar ({x,y}). + */ +export declare class Scalar2D { + /** + * X value. + * + * @type {number} + */ + x: number; + /** + * Y value. + * + * @type {number} + */ + y: number; +} + +/** + * Mutable 3D scalar ({x,y,z}). + */ +export declare class Scalar3D { + /** + * X value. + * + * @type {number} + */ + x: number; + /** + * Y value. + * + * @type {number} + */ + y: number; + /** + * Z value. + * + * @type {number} + */ + z: number; +} + +/** + * Scroll wheel class: provides a wheel event handler + * that scroll the corresponding data. + */ +export declare class ScrollWheel { + /** + * @param {App} app The associated application. + */ + constructor(app: App); + /** + * Handle mouse wheel event. + * + * @param {WheelEvent} event The mouse wheel event. + */ + wheel(event: WheelEvent): void; + #private; +} + /** * Immutable Size class. * Warning: the input array is NOT cloned, modifying it will @@ -2423,9 +4453,9 @@ export declare class RescaleSlopeAndIntercept { */ export declare class Size { /** - * @param {Array} values The size values. + * @param {number[]} values The size values. */ - constructor(values: any[]); + constructor(values: number[]); /** * Get the size value at the given array index. * @@ -2448,9 +4478,9 @@ export declare class Size { /** * Get the values of this index. * - * @returns {Array} The array of values. + * @returns {number[]} The array of values. */ - getValues(): any[]; + getValues(): number[]; /** * Check if a dimension exists and has more than one element. * @@ -2499,10 +4529,10 @@ export declare class Size { * Check that an index is within bounds. * * @param {Index} index The index to check. - * @param {Array} dirs Optional list of directions to check. + * @param {number[]} dirs Optional list of directions to check. * @returns {boolean} True if the given coordinates are within bounds. */ - isInBounds(index: Index, dirs: any[]): boolean; + isInBounds(index: Index, dirs: number[]): boolean; /** * Convert an index to an offset in memory. * @@ -2521,9 +4551,9 @@ export declare class Size { /** * Get the 2D base of this size. * - * @returns {object} The 2D base [0,1] as {x,y}. + * @returns {Scalar2D} The 2D base [0,1] as {x,y}. */ - get2D(): object; + get2D(): Scalar2D; #private; } @@ -2534,9 +4564,9 @@ export declare class Size { */ export declare class Spacing { /** - * @param {Array} values The spacing values. + * @param {number[]} values The spacing values. */ - constructor(values: any[]); + constructor(values: number[]); /** * Get the spacing value at the given array index. * @@ -2559,9 +4589,9 @@ export declare class Spacing { /** * Get the values of this spacing. * - * @returns {Array} The array of values. + * @returns {number[]} The array of values. */ - getValues(): any[]; + getValues(): number[]; /** * Check for equality. * @@ -2572,12 +4602,20 @@ export declare class Spacing { /** * Get the 2D base of this size. * - * @returns {object} The 2D base [col,row] as {x,y}. + * @returns {Scalar2D} The 2D base [col,row] as {x,y}. */ - get2D(): object; + get2D(): Scalar2D; #private; } +/** + * Convert sRGB to CIE LAB (standard illuminant D65). + * + * @param {RGB} triplet 'sRGB' triplet as {r,g,b}. + * @returns {object} CIE LAB triplet as {l,a,b}. + */ +export declare function srgbToCielab(triplet: RGB): object; + /** * Immutable tag. */ @@ -2634,18 +4672,13 @@ export declare class Tag { isWithVR(): boolean; /** * Is the tag group a private tag group ? - * see: http://dicom.nema.org/medical/dicom/2015a/output/html/part05.html#sect_7.8 + * + * See: {@link http://dicom.nema.org/medical/dicom/2022a/output/html/part05.html#sect_7.8}. * * @returns {boolean} True if the tag group is private, * ie if its group is an odd number. */ isPrivate(): boolean; - /** - * Get the tag info from the dicom dictionary. - * - * @returns {Array|undefined} The info as [vr, multiplicity, name]. - */ - getInfoFromDictionary(): any[] | undefined; /** * Get the tag Value Representation (VR) from the dicom dictionary. * @@ -2690,6 +4723,13 @@ export declare class ToolboxController { * Initialise. */ init(): void; + /** + * Enable or disable shortcuts. The 'init' methods enables shortcuts + * by default. Call this method after init to disable shortcuts. + * + * @param {boolean} flag True to enable shortcuts. + */ + enableShortcuts(flag: boolean): void; /** * Get the tool list. * @@ -2732,30 +4772,137 @@ export declare class ToolboxController { /** * Listen to layer interaction events. * - * @param {object} layer The layer to listen to. - * @param {string} layerGroupDivId The associated layer group div id. + * @param {LayerGroup} layerGroup The associated layer group. + * @param {ViewLayer|DrawLayer} layer The layer to listen to. */ - bindLayer(layer: object, layerGroupDivId: string): void; + bindLayerGroup(layerGroup: LayerGroup, layer: ViewLayer | DrawLayer): void; #private; } /** * Tool configuration. */ -export declare class ToolConfig { - /** - * @param {string[]} [options] Optional tool options. - */ - constructor(options?: string[]); - /** - * Optional tool options. - * For Draw: list of shape names. - * For Filter: list of filter names. - * - * @type {string[]|undefined} - */ - options: string[] | undefined; -} +export declare class ToolConfig { + /** + * @param {string[]} [options] Optional tool options. + */ + constructor(options?: string[]); + /** + * Optional tool options. + * For Draw: list of shape names. + * For Filter: list of filter names. + * + * @type {string[]|undefined} + */ + options: string[] | undefined; +} + +/** + * List of client provided tools to be added to + * the default ones. + * + * @example + * // custom tool + * class AlertTool { + * mousedown() {alert('AlertTool mousedown');} + * init() {} + * activate() {} + * } + * // pass it to dwv tool list + * dwv.toolList['Alert'] = AlertTool; + * // create the dwv app + * const app = new dwv.App(); + * // initialise + * const viewConfig0 = new dwv.ViewConfig('layerGroup0'); + * const viewConfigs = {'*': [viewConfig0]}; + * const options = new dwv.AppOptions(viewConfigs); + * options.tools = {Alert: {}}; + * app.init(options); + * // activate tool + * app.addEventListener('load', function () { + * app.setTool('Alert'); + * }); + * // load dicom data + * app.loadURLs([ + * 'https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm' + * ]); + * + * @type {Object} + */ +export declare const toolList: { + [x: string]: any; +}; + +/** + * List of client provided tool options to be added to + * the default ones. + * + * @example + * // custom factory + * class LoveFactory { + * getName() {return 'love';} + * static supports(mathShape) {return mathShape instanceof ROI;} + * getNPoints() {return 1;} + * getTimeout() {return 0;} + * setAnnotationMathShape(annotation, points) { + * const px = points[0].getX(); + * const py = points[0].getY(); + * annotation.mathShape = new dwv.ROI([ + * new dwv.Point2D(px+15,py), new dwv.Point2D(px+10,py-10), + * new dwv.Point2D(px,py), new dwv.Point2D(px-10,py-10), + * new dwv.Point2D(px-15,py), new dwv.Point2D(px,py+20) + * ]); + * annotation.getFactory = function () {return new LoveFactory();} + * } + * createShapeGroup(annotation, style) { + * const roi = annotation.mathShape; + * // konva line + * const arr = []; + * for (let i = 0; i < roi.getLength(); ++i) { + * arr.push(roi.getPoint(i).getX()); + * arr.push(roi.getPoint(i).getY()); + * } + * const shape = new Konva.Line({ + * name: 'shape', points: arr, + * stroke: 'red', strokeWidth: 2, + * closed: true + * }); + * // konva group + * const group = new Konva.Group(); + * group.name('love-group'); + * group.visible(true); + * group.id(annotation.id); + * group.add(shape); + * return group; + * } + * } + * // pass it to dwv option list + * dwv.toolOptions['draw'] = {LoveFactory}; + * // create the dwv app + * const app = new dwv.App(); + * // initialise + * const viewConfig0 = new dwv.ViewConfig('layerGroup0'); + * const viewConfigs = {'*': [viewConfig0]}; + * const options = new dwv.AppOptions(viewConfigs); + * options.tools = {Draw: {options: ['Love']}}; + * app.init(options); + * // activate tool + * app.addEventListener('load', function () { + * app.setTool('Draw'); + * app.setToolFeatures({shapeName: 'Love'}); + * }); + * // load dicom data + * app.loadURLs([ + * 'https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm' + * ]); + * + * @type {Object>} + */ +export declare const toolOptions: { + [x: string]: { + [x: string]: any; + }; +}; /** * Immutable 3D vector. @@ -2809,7 +4956,8 @@ export declare class Vector3D { * vector that is perpendicular to both a and b. * If both vectors are parallel, the cross product is a zero vector. * - * @see https://en.wikipedia.org/wiki/Cross_product + * Ref: {@link https://en.wikipedia.org/wiki/Cross_product}. + * * @param {Vector3D} vector3D The input vector. * @returns {Vector3D} The result vector. */ @@ -2817,11 +4965,19 @@ export declare class Vector3D { /** * Get the dot product with another Vector3D. * - * @see https://en.wikipedia.org/wiki/Dot_product + * Ref: {@link https://en.wikipedia.org/wiki/Dot_product}. + * * @param {Vector3D} vector3D The input vector. * @returns {number} The dot product. */ dotProduct(vector3D: Vector3D): number; + /** + * Is this vector codirectional to an input one. + * + * @param {Vector3D} vector3D The vector to test. + * @returns {boolean} True if codirectional, false is opposite. + */ + isCodirectional(vector3D: Vector3D): boolean; #private; } @@ -2896,7 +5052,7 @@ export declare class View { */ init(): void; /** - * Set the initial index to 0. + * Set the initial index to the middle position. */ setInitialIndex(): void; /** @@ -2908,39 +5064,23 @@ export declare class View { getPlaybackMilliseconds(recommendedDisplayFrameRate: number): number; /** * @callback alphaFn@callback alphaFn - * @param {object} value The pixel value. - * @param {object} index The values' index. - * @returns {number} The value to display. + * @param {number[]|number} value The pixel value. + * @param {number} index The values' index. + * @returns {number} The opacity of the input value. */ /** * Get the alpha function. * * @returns {alphaFn} The function. */ - getAlphaFunction(): (value: object, index: object) => number; + getAlphaFunction(): (value: number[] | number, index: number) => number; /** * Set alpha function. * * @param {alphaFn} func The function. * @fires View#alphafuncchange */ - setAlphaFunction(func: (value: object, index: object) => number): void; - /** - * Get the window LUT of the image. - * Warning: can be undefined in no window/level was set. - * - * @param {object} [rsi] Optional image rsi, will take the one of the - * current slice otherwise. - * @returns {WindowLut} The window LUT of the image. - * @fires View#wlchange - */ - getCurrentWindowLut(rsi?: object): WindowLut; - /** - * Add the window LUT to the list. - * - * @param {WindowLut} wlut The window LUT of the image. - */ - addWindowLut(wlut: WindowLut): void; + setAlphaFunction(func: (value: number[] | number, index: number) => number): void; /** * Get the window presets. * @@ -2950,40 +5090,40 @@ export declare class View { /** * Get the window presets names. * - * @returns {object} The list of window presets names. + * @returns {string[]} The list of window presets names. */ - getWindowPresetsNames(): object; + getWindowPresetsNames(): string[]; /** * Set the window presets. * * @param {object} presets The window presets. */ setWindowPresets(presets: object): void; - /** - * Set the default colour map. - * - * @param {ColourMap} map The colour map. - */ - setDefaultColourMap(map: ColourMap): void; /** * Add window presets to the existing ones. * * @param {object} presets The window presets. */ addWindowPresets(presets: object): void; + /** + * Get the current window level preset name. + * + * @returns {string} The preset name. + */ + getCurrentWindowPresetName(): string; /** * Get the colour map of the image. * - * @returns {ColourMap} The colour map of the image. + * @returns {string} The colour map name. */ - getColourMap(): ColourMap; + getColourMap(): string; /** * Set the colour map of the image. * - * @param {ColourMap} map The colour map of the image. - * @fires View#colourchange + * @param {string} name The colour map name. + * @fires View#colourmapchange */ - setColourMap(map: ColourMap): void; + setColourMap(name: string): void; /** * Get the current position. * @@ -2997,28 +5137,49 @@ export declare class View { */ getCurrentIndex(): Index; /** - * Check is the provided position can be set. + * Get the SOP image UID of the current image. * - * @param {Point} position The position. + * @returns {string} The UID. + */ + getCurrentImageUid(): string; + /** + * Get the image origin for a image UID. + * + * @param {string} uid The UID. + * @returns {Point3D|undefined} The origin. + */ + getOriginForImageUid(uid: string): Point3D | undefined; + /** + * Check if the image includes an UID. + * + * @param {string} uid The UID. + * @returns {boolean} True if present. + */ + includesImageUid(uid: string): boolean; + /** + * Check if the current position (default) or + * the provided position is in bounds. + * + * @param {Point} [position] Optional position. * @returns {boolean} True is the position is in bounds. */ - canSetPosition(position: Point): boolean; + isPositionInBounds(position?: Point): boolean; /** - * Get the origin at a given position. + * Get the first origin or at a given position. * - * @param {Point} position The position. - * @returns {Point} The origin. + * @param {Point} [position] Optional position. + * @returns {Point3D} The origin. */ - getOrigin(position: Point): Point; + getOrigin(position?: Point): Point3D; /** * Set the current position. * * @param {Point} position The new position. - * @param {boolean} silent Flag to fire event or not. - * @returns {boolean} False if not in bounds + * @param {boolean} [silent] Flag to fire event or not. + * @returns {boolean} False if not in bounds. * @fires View#positionchange */ - setCurrentPosition(position: Point, silent: boolean): boolean; + setCurrentPosition(position: Point, silent?: boolean): boolean; /** * Set the current index. * @@ -3031,14 +5192,19 @@ export declare class View { /** * Set the view window/level. * - * @param {number} center The window center. - * @param {number} width The window width. + * @param {WindowLevel} wl The window and level. * @param {string} [name] Associated preset name, defaults to 'manual'. * Warning: uses the latest set rescale LUT or the default linear one. * @param {boolean} [silent] Flag to launch events with skipGenerate. * @fires View#wlchange */ - setWindowLevel(center: number, width: number, name?: string, silent?: boolean): void; + setWindowLevel(wl: WindowLevel, name?: string, silent?: boolean): void; + /** + * Get the window/level. + * + * @returns {WindowLevel} The window and level. + */ + getWindowLevel(): WindowLevel; /** * Set the window level to the preset with the input name. * @@ -3073,9 +5239,9 @@ export declare class View { * Get the image window/level that covers the full data range. * Warning: uses the latest set rescale LUT or the default linear one. * - * @returns {WindowCenterAndWidth} A min/max window level. + * @returns {WindowLevel} A min/max window level. */ - getWindowLevelMinMax(): WindowCenterAndWidth; + getWindowLevelMinMax(): WindowLevel; /** * Set the image window/level to cover the full data range. * Warning: uses the latest set rescale LUT or the default linear one. @@ -3089,22 +5255,6 @@ export declare class View { * otherwise generates at current index. */ generateImageData(data: ImageData, index: Index): void; - /** - * Increment the provided dimension. - * - * @param {number} dim The dimension to increment. - * @param {boolean} silent Do not send event. - * @returns {boolean} False if not in bounds. - */ - incrementIndex(dim: number, silent: boolean): boolean; - /** - * Decrement the provided dimension. - * - * @param {number} dim The dimension to increment. - * @param {boolean} silent Do not send event. - * @returns {boolean} False if not in bounds. - */ - decrementIndex(dim: number, silent: boolean): boolean; /** * Get the scroll dimension index. * @@ -3112,19 +5262,11 @@ export declare class View { */ getScrollIndex(): number; /** - * Decrement the scroll dimension index. - * - * @param {boolean} silent Do not send event. - * @returns {boolean} False if not in bounds. - */ - decrementScrollIndex(silent: boolean): boolean; - /** - * Increment the scroll dimension index. + * Is this view in the same orientation as the image aquisition. * - * @param {boolean} silent Do not send event. - * @returns {boolean} False if not in bounds. + * @returns {boolean} True if in aquisition plane. */ - incrementScrollIndex(silent: boolean): boolean; + isAquisitionOrientation(): boolean; #private; } @@ -3151,17 +5293,37 @@ export declare class ViewConfig { */ orientation: string | undefined; /** - * Optional view colour map. + * Optional view colour map name. * - * @type {ColourMap|undefined} + * @type {string|undefined} */ - colourMap: ColourMap | undefined; + colourMap: string | undefined; /** * Optional layer opacity; in [0, 1] range. * * @type {number|undefined} */ opacity: number | undefined; + /** + * Optional layer window level preset name. + * If present, the preset name will be used and + * the window centre and width ignored. + * + * @type {string|undefined} + */ + wlPresetName: string | undefined; + /** + * Optional layer window center. + * + * @type {number|undefined} + */ + windowCenter: number | undefined; + /** + * Optional layer window width. + * + * @type {number|undefined} + */ + windowWidth: number | undefined; } /** @@ -3170,15 +5332,14 @@ export declare class ViewConfig { export declare class ViewController { /** * @param {View} view The associated view. - * @param {number} index The associated data index. */ - constructor(view: View, index: number); + constructor(view: View); /** * Get the plane helper. * - * @returns {object} The helper. + * @returns {PlaneHelper} The helper. */ - getPlaneHelper(): object; + getPlaneHelper(): PlaneHelper; /** * Check is the associated image is a mask. * @@ -3186,33 +5347,21 @@ export declare class ViewController { */ isMask(): boolean; /** - * Get the mask segment helper. - * - * @returns {object} The helper. - */ - getMaskSegmentHelper(): object; - /** - * Apply the hidden segments list by setting - * the corresponding alpha function. + * Initialise the controller. */ - applyHiddenSegments(): void; + initialise(): void; /** - * Delete a segment. + * Get the image modality. * - * @param {number} segmentNumber The segment number. - * @param {Function} exeCallback The post execution callback. - */ - deleteSegment(segmentNumber: number, exeCallback: Function): void; - /** - * Initialise the controller. + * @returns {string} The modality. */ - initialise(): void; + getModality(): string; /** * Get the window/level presets names. * - * @returns {Array} The presets names. + * @returns {string[]} The presets names. */ - getWindowLevelPresetsNames(): any[]; + getWindowLevelPresetsNames(): string[]; /** * Add window/level presets to the view. * @@ -3250,6 +5399,26 @@ export declare class ViewController { * @returns {Index} The current index. */ getCurrentIndex(): Index; + /** + * Get the SOP image UID of the current image. + * + * @returns {string} The UID. + */ + getCurrentImageUid(): string; + /** + * Get the image origin for a image UID. + * + * @param {string} uid The UID. + * @returns {Point3D|undefined} The origin. + */ + getOriginForImageUid(uid: string): Point3D | undefined; + /** + * Check if the image includes an UID. + * + * @param {string} uid The UID. + * @returns {boolean} True if present. + */ + includesImageUid(uid: string): boolean; /** * Get the current oriented index. * @@ -3269,43 +5438,56 @@ export declare class ViewController { */ getCurrentScrollIndexValue(): object; /** - * Get the origin at a given posittion. + * Get the first origin or at a given position. * - * @param {Point} position The input position. - * @returns {Point} The origin. + * @param {Point} [position] Optional position. + * @returns {Point3D} The origin. + */ + getOrigin(position?: Point): Point3D; + /** + * Is this view in the same orientation as the image aquisition. + * + * @returns {boolean} True if in aquisition plane. + */ + isAquisitionOrientation(): boolean; + /** + * Get a list of points that define the plane at input position, + * given this classes orientation. + * + * @param {Point} position The position. + * @returns {Point3D[]} An origin and 2 cosines vectors. */ - getOrigin(position: Point): Point; + getPlanePoints(position: Point): Point3D[]; /** * Get the current scroll position value. * - * @returns {object} The value. + * @returns {number} The value. */ - getCurrentScrollPosition(): object; + getCurrentScrollPosition(): number; /** * Generate display image data to be given to a canvas. * * @param {ImageData} array The array to fill in. - * @param {Index} index Optional index at which to generate, + * @param {Index} [index] Optional index at which to generate, * otherwise generates at current index. */ - generateImageData(array: ImageData, index: Index): void; + generateImageData(array: ImageData, index?: Index): void; /** * Set the associated image. * * @param {Image} img The associated image. - * @param {number} index The data index of the image. */ - setImage(img: Image_2, index: number): void; + setImage(img: Image_2): void; /** - * Get the current spacing. + * Get the current view (2D) spacing. * - * @returns {Array} The 2D spacing. + * @returns {Scalar2D} The spacing as a 2D array. */ - get2DSpacing(): any[]; + get2DSpacing(): Scalar2D; /** * Get the image rescaled value at the input position. * - * @param {Point} position the input position. + * @param {Point} position The input position. * @returns {number|undefined} The image value or undefined if out of bounds * or no quantifiable (for ex RGB). */ @@ -3313,7 +5495,7 @@ export declare class ViewController { /** * Get the image pixel unit. * - * @returns {string} The unit + * @returns {string} The unit. */ getPixelUnit(): string; /** @@ -3327,10 +5509,10 @@ export declare class ViewController { /** * Get some values from the associated image in variable regions. * - * @param {Array} regions A list of regions. + * @param {number[][][]} regions A list of [x, y] pairs (min, max). * @returns {Array} A list of values. */ - getImageVariableRegionValues(regions: any[]): any[]; + getImageVariableRegionValues(regions: number[][][]): any[]; /** * Can the image values be quantified? * @@ -3341,8 +5523,15 @@ export declare class ViewController { * Can window and level be applied to the data? * * @returns {boolean} True if possible. + * @deprecated Since v0.33, please use isMonochrome instead. */ canWindowLevel(): boolean; + /** + * Is the data monochrome. + * + * @returns {boolean} True if the data is monochrome. + */ + isMonochrome(): boolean; /** * Can the data be scrolled? * @@ -3351,17 +5540,25 @@ export declare class ViewController { */ canScroll(): boolean; /** - * Get the image size. + * Get the oriented image size. * * @returns {Size} The size. */ getImageSize(): Size; + /** + * Is the data size larger than one in the given dimension? + * + * @param {number} dim The dimension. + * @returns {boolean} True if the image size is larger than one + * in the given dimension. + */ + moreThanOne(dim: number): boolean; /** * Get the image world (mm) 2D size. * - * @returns {object} The 2D size as {x,y}. + * @returns {Scalar2D} The 2D size as {x,y}. */ - getImageWorldSize(): object; + getImageWorldSize(): Scalar2D; /** * Get the image rescaled data range. * @@ -3376,12 +5573,13 @@ export declare class ViewController { */ equalImageMeta(meta: object): boolean; /** - * Check is the provided position can be set. + * Check if the current position (default) or + * the provided position is in bounds. * - * @param {Point} position The position. + * @param {Point} [position] Optional position. * @returns {boolean} True is the position is in bounds. */ - canSetPosition(position: Point): boolean; + isPositionInBounds(position?: Point): boolean; /** * Set the current position. * @@ -3392,20 +5590,28 @@ export declare class ViewController { */ setCurrentPosition(pos: Point, silent?: boolean): boolean; /** - * Get a position from a 2D (x,y) position. + * Get a world position from a 2D plane position. * - * @param {number} x The column position. - * @param {number} y The row position. + * @param {Point2D} point2D The input point. + * @param {number} [k] Optional slice index, + * if undefined, uses the current one. * @returns {Point} The associated position. */ - getPositionFromPlanePoint(x: number, y: number): Point; + getPositionFromPlanePoint(point2D: Point2D, k?: number): Point; + /** + * Get a 2D plane position from a world position. + * + * @param {Point} point The 3D position. + * @returns {Point2D} The 2D position. + */ + getPlanePositionFromPosition(point: Point): Point2D; /** - * Get a 2D (x,y) position from a position. + * Get the index of a world position. * * @param {Point} point The 3D position. - * @returns {object} The 2D position. + * @returns {Index} The index. */ - getPlanePositionFromPosition(point: Point): object; + getIndexFromPosition(point: Point): Index; /** * Set the current index. * @@ -3418,17 +5624,43 @@ export declare class ViewController { * Get a plane 3D position from a plane 2D position: does not compensate * for the image origin. Needed for setting the scale center... * - * @param {object} point2D The 2D position as {x,y}. + * @param {Point2D} point2D The 2D position. * @returns {Point3D} The 3D point. */ - getPlanePositionFromPlanePoint(point2D: object): Point3D; + getPlanePositionFromPlanePoint(point2D: Point2D): Point3D; /** * Get a 3D offset from a plane one. * - * @param {object} offset2D The plane offset as {x,y}. + * @param {Scalar2D} offset2D The plane offset as {x,y}. * @returns {Vector3D} The 3D world offset. */ - getOffset3DFromPlaneOffset(offset2D: object): Vector3D; + getOffset3DFromPlaneOffset(offset2D: Scalar2D): Vector3D; + /** + * Get the current position incremented in the input direction. + * + * @param {number} dim The direction in which to increment. + * @returns {Point} The resulting point. + */ + getIncrementPosition(dim: number): Point; + /** + * Get the current position decremented in the input direction. + * + * @param {number} dim The direction in which to decrement. + * @returns {Point} The resulting point. + */ + getDecrementPosition(dim: number): Point; + /** + * Get the current position decremented in the scroll direction. + * + * @returns {Point} The resulting point. + */ + getIncrementScrollPosition(): Point; + /** + * Get the current position decremented in the scroll direction. + * + * @returns {Point} The resulting point. + */ + getDecrementScrollPosition(): Point; /** * Increment the provided dimension. * @@ -3470,62 +5702,57 @@ export declare class ViewController { /** * Get the window/level. * - * @returns {object} The window center and width. + * @returns {WindowLevel} The window and level. + */ + getWindowLevel(): WindowLevel; + /** + * Get the current window level preset name. + * + * @returns {string} The preset name. */ - getWindowLevel(): object; + getCurrentWindowPresetName(): string; /** - * Set the window/level. + * Set the window and level. * - * @param {number} wc The window center. - * @param {number} ww The window width. + * @param {WindowLevel} wl The window and level. */ - setWindowLevel(wc: number, ww: number): void; + setWindowLevel(wl: WindowLevel): void; /** * Get the colour map. * - * @returns {ColourMap} The colour map. + * @returns {string} The colour map name. */ - getColourMap(): ColourMap; + getColourMap(): string; /** * Set the colour map. * - * @param {ColourMap} colourMap The colour map. + * @param {string} name The colour map name. */ - setColourMap(colourMap: ColourMap): void; + setColourMap(name: string): void; /** * @callback alphaFn@callback alphaFn - * @param {object} value The pixel value. - * @param {object} index The values' index. - * @returns {number} The value to display. + * @param {number[]|number} value The pixel value. + * @param {number} index The values' index. + * @returns {number} The opacity of the input value. */ /** * Set the view per value alpha function. * * @param {alphaFn} func The function. */ - setViewAlphaFunction(func: (value: object, index: object) => number): void; + setViewAlphaFunction(func: (value: number[] | number, index: number) => number): void; /** - * Set the colour map from a name. - * - * @param {string} name The name of the colour map to set. - */ - setColourMapFromName(name: string): void; - /** - * Add an event listener to this class. + * Bind the view image to the provided layer. * - * @param {string} type The event type. - * @param {Function} callback The function associated with the provided - * event type, will be called with the fired event. + * @param {ViewLayer} viewLayer The layer to bind. */ - addEventListener(type: string, callback: Function): void; + bindImageAndLayer(viewLayer: ViewLayer): void; /** - * Remove an event listener from this class. + * Unbind the view image to the provided layer. * - * @param {string} type The event type. - * @param {Function} callback The function associated with the provided - * event type. + * @param {ViewLayer} viewLayer The layer to bind. */ - removeEventListener(type: string, callback: Function): void; + unbindImageAndLayer(viewLayer: ViewLayer): void; #private; } @@ -3539,24 +5766,36 @@ export declare class ViewLayer { */ constructor(containerDiv: HTMLElement); /** - * Get the associated data index. + * Get the associated data id. * - * @returns {number} The index. + * @returns {string} The data id. + */ + getDataId(): string; + /** + * Get the layer scale. + * + * @returns {Scalar2D} The scale as {x,y}. + */ + getScale(): Scalar2D; + /** + * Get the layer zoom offset without the fit scale. + * + * @returns {Scalar2D} The offset as {x,y}. */ - getDataIndex(): number; + getAbsoluteZoomOffset(): Scalar2D; /** - * Set the imageSmoothingEnabled flag value. + * Set the imageSmoothing flag value. * * @param {boolean} flag True to enable smoothing. */ - enableImageSmoothing(flag: boolean): void; + setImageSmoothing(flag: boolean): void; /** * Set the associated view. * * @param {object} view The view. - * @param {number} index The associated data index. + * @param {string} dataId The associated data id. */ - setView(view: object, index: number): void; + setView(view: object, dataId: string): void; /** * Get the view controller. * @@ -3576,31 +5815,50 @@ export declare class ViewLayer { * @function */ onimageset: (event: object) => void; + /** + * Bind this layer to the view image. + */ + bindImage(): void; + /** + * Unbind this layer to the view image. + */ + unbindImage(): void; + /** + * Handle an image content change event. + * + * @param {object} event The event. + * @function + */ + onimagecontentchange: (event: object) => void; /** * Handle an image change event. * * @param {object} event The event. * @function */ - onimagechange: (event: object) => void; + onimagegeometrychange: (event: object) => void; /** * Get the id of the layer. * * @returns {string} The string id. */ getId(): string; + /** + * Remove the HTML element from the DOM. + */ + removeFromDOM(): void; /** * Get the layer base size (without scale). * - * @returns {object} The size as {x,y}. + * @returns {Scalar2D} The size as {x,y}. */ - getBaseSize(): object; + getBaseSize(): Scalar2D; /** * Get the image world (mm) 2D size. * - * @returns {object} The 2D size as {x,y}. + * @returns {Scalar2D} The 2D size as {x,y}. */ - getImageWorldSize(): object; + getImageWorldSize(): Scalar2D; /** * Get the layer opacity. * @@ -3621,67 +5879,85 @@ export declare class ViewLayer { * Add a flip offset along the layer Y axis. */ addFlipOffsetY(): void; + /** + * Flip the scale along the layer X axis. + */ + flipScaleX(): void; + /** + * Flip the scale along the layer Y axis. + */ + flipScaleY(): void; + /** + * Flip the scale along the layer Z axis. + */ + flipScaleZ(): void; /** * Set the layer scale. * - * @param {object} newScale The scale as {x,y}. + * @param {Scalar3D} newScale The scale as {x,y,z}. * @param {Point3D} [center] The scale center. */ - setScale(newScale: object, center?: Point3D): void; + setScale(newScale: Scalar3D, center?: Point3D): void; + /** + * Initialise the layer scale. + * + * @param {Scalar3D} newScale The scale as {x,y,z}. + * @param {Scalar2D} absoluteZoomOffset The zoom offset as {x,y} + * without the fit scale (as provided by getAbsoluteZoomOffset). + */ + initScale(newScale: Scalar3D, absoluteZoomOffset: Scalar2D): void; /** * Set the base layer offset. Updates the layer offset. * * @param {Vector3D} scrollOffset The scroll offset vector. * @param {Vector3D} planeOffset The plane offset vector. + * @param {Point3D} [layerGroupOrigin] The layer group origin. + * @param {Point3D} [layerGroupOrigin0] The layer group first origin. * @returns {boolean} True if the offset was updated. */ - setBaseOffset(scrollOffset: Vector3D, planeOffset: Vector3D): boolean; + setBaseOffset(scrollOffset: Vector3D, planeOffset: Vector3D, layerGroupOrigin?: Point3D, layerGroupOrigin0?: Point3D): boolean; /** * Set the layer offset. * - * @param {object} newOffset The offset as {x,y}. + * @param {Scalar3D} newOffset The offset as {x,y,z}. */ - setOffset(newOffset: object): void; + setOffset(newOffset: Scalar3D): void; /** - * Transform a display position to an index. + * Transform a display position to a 2D index. * - * @param {number} x The X position. - * @param {number} y The Y position. - * @returns {Index} The equivalent index. + * @param {Point2D} point2D The input point. + * @returns {Index} The equivalent 2D index. */ - displayToPlaneIndex(x: number, y: number): Index; + displayToPlaneIndex(point2D: Point2D): Index; /** * Remove scale from a display position. * - * @param {number} x The X position. - * @param {number} y The Y position. - * @returns {object} The de-scaled position as {x,y}. + * @param {Point2D} point2D The input point. + * @returns {Point2D} The de-scaled point. */ - displayToPlaneScale(x: number, y: number): object; + displayToPlaneScale(point2D: Point2D): Point2D; /** * Get a plane position from a display position. * - * @param {number} x The X position. - * @param {number} y The Y position. - * @returns {object} The plane position as {x,y}. + * @param {Point2D} point2D The input point. + * @returns {Point2D} The plane position. */ - displayToPlanePos(x: number, y: number): object; + displayToPlanePos(point2D: Point2D): Point2D; /** * Get a display position from a plane position. * - * @param {number} x The X position. - * @param {number} y The Y position. - * @returns {object} The display position as {x,y}. + * @param {Point2D} point2D The input point. + * @returns {Point2D} The display position, can be individually + * undefined if out of bounds. */ - planePosToDisplay(x: number, y: number): object; + planePosToDisplay(point2D: Point2D): Point2D; /** * Get a main plane position from a display position. * - * @param {number} x The X position. - * @param {number} y The Y position. - * @returns {object} The main plane position as {x,y}. + * @param {Point2D} point2D The input point. + * @returns {Point2D} The main plane position. */ - displayToMainPlanePos(x: number, y: number): object; + displayToMainPlanePos(point2D: Point2D): Point2D; /** * Display the layer. * @@ -3696,28 +5972,28 @@ export declare class ViewLayer { isVisible(): boolean; /** * Draw the content (imageData) of the layer. - * The imageData variable needs to be set + * The imageData variable needs to be set. * * @fires App#renderstart * @fires App#renderend */ draw(): void; /** - * Initialise the layer: set the canvas and context + * Initialise the layer: set the canvas and context. * - * @param {object} size The image size as {x,y}. - * @param {object} spacing The image spacing as {x,y}. + * @param {Scalar2D} size The image size as {x,y}. + * @param {Scalar2D} spacing The image spacing as {x,y}. * @param {number} alpha The initial data opacity. */ - initialise(size: object, spacing: object, alpha: number): void; + initialise(size: Scalar2D, spacing: Scalar2D, alpha: number): void; /** * Fit the layer to its parent container. * - * @param {number} fitScale1D The 1D fit scale. - * @param {object} fitSize The fit size as {x,y}. - * @param {object} fitOffset The fit offset as {x,y}. + * @param {Scalar2D} containerSize The fit size as {x,y}. + * @param {number} divToWorldSizeRatio The div to world size ratio. + * @param {Scalar2D} fitOffset The fit offset as {x,y}. */ - fitToContainer(fitScale1D: number, fitSize: object, fitOffset: object): void; + fitToContainer(containerSize: Scalar2D, divToWorldSizeRatio: number, fitOffset: Scalar2D): void; /** * Enable and listen to container interaction events. */ @@ -3758,132 +6034,33 @@ export declare class ViewLayer { } /** - * WindowCenterAndWidth class. - *
Pseudo-code: - *
- *  if (x <= c - 0.5 - (w-1)/2), then y = ymin
- *  else if (x > c - 0.5 + (w-1)/2), then y = ymax,
- *  else y = ((x - (c - 0.5)) / (w-1) + 0.5) * (ymax - ymin) + ymin
- * 
- * - * @see DICOM doc for [Window Center and Window Width]{@link http://dicom.nema.org/dicom/2013/output/chtml/part03/sect_C.11.html#sect_C.11.2.1.2} + * Window and Level also known as window width and center. */ -export declare class WindowCenterAndWidth { +export declare class WindowLevel { /** * @param {number} center The window center. * @param {number} width The window width. */ constructor(center: number, width: number); /** - * Get the window center. - * - * @returns {number} The window center. - */ - getCenter(): number; - /** - * Get the window width. - * - * @returns {number} The window width. - */ - getWidth(): number; - /** - * Set the output value range. - * - * @param {string} min The output value minimum. - * @param {string} max The output value maximum. - */ - setRange(min: string, max: string): void; - /** - * Set the signed offset. - * - * @param {number} offset The signed data offset, - * typically: slope * ( size / 2). - */ - setSignedOffset(offset: number): void; - /** - * Apply the window level on an input value. - * - * @param {number} value The value to rescale as an integer. - * @returns {number} The leveled value, in the - * [ymin, ymax] range (default [0,255]). - */ - apply(value: number): number; - /** - * Check for window level equality. - * - * @param {WindowCenterAndWidth} rhs The other window level to compare to. - * @returns {boolean} True if both window level are equal. - */ - equals(rhs: WindowCenterAndWidth): boolean; - /** - * Get a string representation of the window level. - * - * @returns {string} The window level as a string. - */ - toString(): string; - #private; -} - -/** - * Window LUT class. - * Typically converts from float to integer. - */ -export declare class WindowLut { - /** - * @param {RescaleLut} rescaleLut The associated rescale LUT. - * @param {boolean} isSigned Flag to know if the data is signed or not. - */ - constructor(rescaleLut: RescaleLut, isSigned: boolean); - /** - * Get the window / level. - * - * @returns {WindowCenterAndWidth} The window / level. - */ - getWindowLevel(): WindowCenterAndWidth; - /** - * Get the signed flag. - * - * @returns {boolean} The signed flag. - */ - isSigned(): boolean; - /** - * Get the rescale lut. - * - * @returns {RescaleLut} The rescale lut. - */ - getRescaleLut(): RescaleLut; - /** - * Is the lut ready to use or not? If not, the user must - * call 'update'. - * - * @returns {boolean} True if the lut is ready to use. - */ - isReady(): boolean; - /** - * Set the window center and width. + * The window center. * - * @param {WindowCenterAndWidth} wl The window level. - */ - setWindowLevel(wl: WindowCenterAndWidth): void; - /** - * Update the lut if needed.. + * @type {number} */ - update(): void; + center: number; /** - * Get the length of the LUT array. + * The window width. * - * @returns {number} The length of the LUT array. + * @type {number} */ - getLength(): number; + width: number; /** - * Get the value of the LUT at the given offset. + * Check for equality. * - * @param {number} offset The input offset in [0,2^bitsStored] range. - * @returns {number} The integer value (default [0,255]) of the LUT - * at the given offset. + * @param {WindowLevel} rhs The other object to compare to. + * @returns {boolean} True if both objects are equal. */ - getValue(offset: number): number; - #private; + equals(rhs: WindowLevel): boolean; } /** diff --git a/demo/stable/node_modules/dwv/dist/dwv.min.js b/demo/stable/node_modules/dwv/dist/dwv.min.js index 4d7e2ecd..3a1bdbd2 100644 --- a/demo/stable/node_modules/dwv/dist/dwv.min.js +++ b/demo/stable/node_modules/dwv/dist/dwv.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("konva"),require("jszip"),require("magic-wand-tool")):"function"==typeof define&&define.amd?define(["konva","jszip","konmagic-wand-tool"],t):"object"==typeof exports?exports.dwv=t(require("konva"),require("jszip"),require("magic-wand-tool")):e.dwv=t(e.Konva,e.JSZip,e.MagicWand)}(this,(function(e,t,n){return function(){"use strict";var i={626:function(e){e.exports=t},436:function(t){t.exports=e},812:function(e){e.exports=n}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var n=r[e]={exports:{}};return i[e](n,n.exports,o),n.exports}o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,{a:t}),t},o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return function(){o.r(a),o.d(a,{App:function(){return Vn},AppOptions:function(){return Nn},ColourMap:function(){return S},DataElement:function(){return oe},DicomParser:function(){return Ce},DicomWriter:function(){return _n},DrawLayer:function(){return Tt},Geometry:function(){return xe},Image:function(){return Ye},Index:function(){return e},LayerGroup:function(){return Pt},Matrix33:function(){return v},Point:function(){return w},Point2D:function(){return P},Point3D:function(){return O},RescaleLut:function(){return n},RescaleSlopeAndIntercept:function(){return Oe},Size:function(){return we},Spacing:function(){return Ae},Tag:function(){return Q},TagValueExtractor:function(){return qe},ToolConfig:function(){return Bn},ToolboxController:function(){return Qt},Vector3D:function(){return D},View:function(){return Ze},ViewConfig:function(){return Mn},ViewController:function(){return et},ViewLayer:function(){return at},WindowCenterAndWidth:function(){return r},WindowLut:function(){return s},WriterRule:function(){return Hn},addTagsToDictionary:function(){return x},buildMultipart:function(){return re},createImage:function(){return We},createMaskImage:function(){return ze},createView:function(){return _e},customUI:function(){return nt},decoderScripts:function(){return zt},defaultPresets:function(){return i},getDwvVersion:function(){return ae},getElementsFromJSONTags:function(){return Jn},getOrientationName:function(){return de},getPixelDataTag:function(){return G},getReverseOrientation:function(){return ue},getTagFromKey:function(){return M},getTypedArray:function(){return De},getUID:function(){return Wn},hasDicomPrefix:function(){return se},i18n:function(){return ln},logger:function(){return g},luts:function(){return h},precisionRound:function(){return J}});class e{#e;constructor(e){if(!e||void 0===e)throw new Error("Cannot create index with no values.");if(0===e.length)throw new Error("Cannot create index with empty values.");if(!e.every((function(e){return!isNaN(e)})))throw new Error("Cannot create index with non number values.");this.#e=e}get(e){return this.#e[e]}length(){return this.#e.length}toString(){return"("+this.#e.toString()+")"}getValues(){return this.#e.slice()}canCompare(e){return!!e&&this.length()===e.length()}equals(e){if(!this.canCompare(e))return!1;for(let t=0,n=this.length();t=this.length())throw new Error("Non valid dimension for toStringId.");let t="";for(let n=0;nr&&(r=i);if(0===r)throw new Error("No dimension found in point stringId");const o=new Array(r);o.fill(0);for(let e=0;ethis.#S?this.#u:e*this.#h+this.#g}equals(e){return null!==e&&this.getCenter()===e.getCenter()&&this.getWidth()===e.getWidth()}toString(){return this.getCenter()+", "+this.getWidth()}}class s{#m;#p;#n=null;#f=null;#i=!1;#D=0;constructor(e,t){this.#m=e,this.#p=t}getWindowLevel(){return this.#f}isSigned(){return this.#p}getRescaleLut(){return this.#m}isReady(){return this.#i}setWindowLevel(e){if(this.#f=e,this.#D=0,this.#f.setSignedOffset(0),this.#p){const e=this.#m.getLength();this.#D=e/2,this.#f.setSignedOffset(this.#m.getRSI().getSlope()*this.#D)}this.#i=!1}update(){if(this.#i)return;this.#m.isReady()||this.#m.initialise();const e=this.#m.getLength();this.#n||(this.#n=new Uint8ClampedArray(e));for(let t=0;t255?255:t})),green:c((function(e){const t=l/3;let n=0;return e>=t&&(n=3*(e-t),n>255)?255:n})),blue:c((function(e){const t=l/3;let n=0;return e>=2*t&&(n=3*(e-2*t),n>255)?255:n}))},hot_iron:{red:[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,182,184,186,188,190,192,194,196,198,200,202,204,206,208,210,212,214,216,218,220,222,224,226,228,230,232,234,236,238,240,242,244,246,248,250,252,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255],green:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,182,184,186,188,190,192,194,196,198,200,202,204,206,208,210,212,214,216,218,220,222,224,226,228,230,232,234,236,238,240,242,244,246,248,250,252,255],blue:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,252,255]},pet:{red:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,171,173,175,177,179,181,183,185,187,189,191,193,195,197,199,201,203,205,207,209,211,213,215,217,219,221,223,225,227,229,231,233,235,237,239,241,243,245,247,249,251,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255],green:[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,128,126,124,122,120,118,116,114,112,110,108,106,104,102,100,98,96,94,92,90,88,86,84,82,80,78,76,74,72,70,68,66,64,63,61,59,57,55,53,51,49,47,45,43,41,39,37,35,33,31,29,27,25,23,21,19,17,15,13,11,9,7,5,3,1,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,182,184,186,188,190,192,194,196,198,200,202,204,206,208,210,212,214,216,218,220,222,224,226,228,230,232,234,236,238,240,242,244,246,248,250,252,255],blue:[0,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,169,171,173,175,177,179,181,183,185,187,189,191,193,195,197,199,201,203,205,207,209,211,213,215,217,219,221,223,225,227,229,231,233,235,237,239,241,243,245,247,249,251,253,255,252,248,244,240,236,232,228,224,220,216,212,208,204,200,196,192,188,184,180,176,172,168,164,160,156,152,148,144,140,136,132,128,124,120,116,112,108,104,100,96,92,88,84,80,76,72,68,64,60,56,52,48,44,40,36,32,28,24,20,16,12,8,4,0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,85,89,93,97,101,105,109,113,117,121,125,129,133,137,141,145,149,153,157,161,165,170,174,178,182,186,190,194,198,202,206,210,214,218,222,226,230,234,238,242,246,250,255]},hot_metal_blue:{red:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,6,9,12,15,18,21,24,26,29,32,35,38,41,44,47,50,52,55,57,59,62,64,66,69,71,74,76,78,81,83,85,88,90,93,96,99,102,105,108,111,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,166,169,172,175,178,181,184,187,190,194,198,201,205,209,213,217,221,224,228,232,236,240,244,247,251,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255],green:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,4,6,8,9,11,13,15,17,19,21,23,24,26,28,30,32,34,36,38,40,41,43,45,47,49,51,53,55,56,58,60,62,64,66,68,70,72,73,75,77,79,81,83,85,87,88,90,92,94,96,98,100,102,104,105,107,109,111,113,115,117,119,120,122,124,126,128,130,132,134,136,137,139,141,143,145,147,149,151,152,154,156,158,160,162,164,166,168,169,171,173,175,177,179,181,183,184,186,188,190,192,194,196,198,200,201,203,205,207,209,211,213,215,216,218,220,222,224,226,228,229,231,233,235,237,239,240,242,244,246,248,250,251,253,255],blue:[0,2,4,6,8,10,12,14,16,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,169,171,173,175,177,179,181,183,184,186,188,190,192,194,196,198,200,197,194,191,188,185,182,179,176,174,171,168,165,162,159,156,153,150,144,138,132,126,121,115,109,103,97,91,85,79,74,68,62,56,50,47,44,41,38,35,32,29,26,24,21,18,15,12,9,6,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,6,9,12,15,18,21,24,26,29,32,35,38,41,44,47,50,53,56,59,62,65,68,71,74,76,79,82,85,88,91,94,97,100,103,106,109,112,115,118,121,124,126,129,132,135,138,141,144,147,150,153,156,159,162,165,168,171,174,176,179,182,185,188,191,194,197,200,203,206,210,213,216,219,223,226,229,232,236,239,242,245,249,252,255]},pet_20step:{red:[0,0,0,0,0,0,0,0,0,0,0,0,0,96,96,96,96,96,96,96,96,96,96,96,96,96,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,80,80,80,80,80,80,80,80,80,80,80,80,80,96,96,96,96,96,96,96,96,96,96,96,96,96,112,112,112,112,112,112,112,112,112,112,112,112,112,128,128,128,128,128,128,128,128,128,128,128,128,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,80,80,80,80,80,80,80,80,80,80,80,80,80,64,64,64,64,64,64,64,64,64,64,64,64,224,224,224,224,224,224,224,224,224,224,224,224,224,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,192,192,192,192,192,192,192,192,192,192,192,192,192,176,176,176,176,176,176,176,176,176,176,176,176,176,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255],green:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,80,80,80,80,80,80,80,80,80,80,80,80,80,96,96,96,96,96,96,96,96,96,96,96,96,96,112,112,112,112,112,112,112,112,112,112,112,112,112,128,128,128,128,128,128,128,128,128,128,128,128,96,96,96,96,96,96,96,96,96,96,96,96,96,144,144,144,144,144,144,144,144,144,144,144,144,144,192,192,192,192,192,192,192,192,192,192,192,192,192,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,208,208,208,208,208,208,208,208,208,208,208,208,208,176,176,176,176,176,176,176,176,176,176,176,176,176,144,144,144,144,144,144,144,144,144,144,144,144,96,96,96,96,96,96,96,96,96,96,96,96,96,48,48,48,48,48,48,48,48,48,48,48,48,48,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255],blue:[0,0,0,0,0,0,0,0,0,0,0,0,0,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,112,112,112,112,112,112,112,112,112,112,112,112,128,128,128,128,128,128,128,128,128,128,128,128,128,176,176,176,176,176,176,176,176,176,176,176,176,176,192,192,192,192,192,192,192,192,192,192,192,192,192,224,224,224,224,224,224,224,224,224,224,224,224,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,80,80,80,80,80,80,80,80,80,80,80,80,80,64,64,64,64,64,64,64,64,64,64,64,64,80,80,80,80,80,80,80,80,80,80,80,80,80,96,96,96,96,96,96,96,96,96,96,96,96,96,64,64,64,64,64,64,64,64,64,64,64,64,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255]}},g={levels:{TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4},level:3,trace:function(e){this.level<=this.levels.TRACE&&console.trace(e)},debug:function(e){this.level<=this.levels.DEBUG&&console.debug(e)},info:function(e){this.level<=this.levels.INFO&&console.info(e)},warn:function(e){this.level<=this.levels.WARN&&console.warn(e)},error:function(e){this.level<=this.levels.ERROR&&console.error(e)}};function m(e){return function(e){return n=e,.001172549*(t={r:parseInt(n.substring(1,3),16),g:parseInt(n.substring(3,5),16),b:parseInt(n.substring(5,7),16)}).r+.002301961*t.g+447059e-9*t.b<.5;var t,n}(e)?"#fff":"#000"}const p={x:95.0489,y:100,z:108.884};function f(e){const t={Yellow:"#ffff00",Red:"#ff0000",White:"#ffffff",Green:"#008000",Blue:"#0000ff",Lime:"#00ff00",Fuchsia:"#ff00ff",Black:"#000000"};let n="#ffff00";return void 0!==t[e]&&(n=t[e]),n}class D{#y;#C;#v;constructor(e,t,n){this.#y=e,this.#C=t,this.#v=n}getX(){return this.#y}getY(){return this.#C}getZ(){return this.#v}equals(e){return null!==e&&this.getX()===e.getX()&&this.getY()===e.getY()&&this.getZ()===e.getZ()}toString(){return"("+this.getX()+", "+this.getY()+", "+this.getZ()+")"}norm(){return Math.sqrt(this.getX()*this.getX()+this.getY()*this.getY()+this.getZ()*this.getZ())}crossProduct(e){return new D(this.getY()*e.getZ()-e.getY()*this.getZ(),this.getZ()*e.getX()-e.getZ()*this.getX(),this.getX()*e.getY()-e.getX()*this.getY())}dotProduct(e){return this.getX()*e.getX()+this.getY()*e.getY()+this.getZ()*e.getZ()}}const y=1e4*Number.EPSILON;function C(e,t,n){return void 0===n&&(n=Number.EPSILON),Math.abs(e-t)0?1:-1;for(let t=0;t<3;++t)t===n.index?e.push(1*i):e.push(0)}return new v(e)}getThirdColMajorDirection(){return this.getColAbsMax(2).index}}function T(){return new v([1,0,0,0,1,0,0,0,1])}function I(){return new v([1,0,0,0,0,1,0,-1,0])}function L(e){let t=null;return"axial"===e?t=T():"coronal"===e?t=I():"sagittal"===e&&(t=new v([0,0,-1,1,0,0,0,-1,0])),t}class P{#y;#C;constructor(e,t){this.#y=e,this.#C=t}getX(){return this.#y}getY(){return this.#C}equals(e){return null!==e&&this.getX()===e.getX()&&this.getY()===e.getY()}toString(){return"("+this.getX()+", "+this.getY()+")"}getDistance(e){return Math.sqrt((this.getX()-e.getX())*(this.getX()-e.getX())+(this.getY()-e.getY())*(this.getY()-e.getY()))}getRound(){return new P(Math.round(this.getX()),Math.round(this.getY()))}}class O{#y;#C;#v;constructor(e,t,n){this.#y=e,this.#C=t,this.#v=n}getX(){return this.#y}getY(){return this.#C}getZ(){return this.#v}equals(e){return null!==e&&this.getX()===e.getX()&&this.getY()===e.getY()&&this.getZ()===e.getZ()}isSimilar(e,t){return null!==e&&C(this.getX(),e.getX(),t)&&C(this.getY(),e.getY(),t)&&C(this.getZ(),e.getZ(),t)}toString(){return"("+this.getX()+", "+this.getY()+", "+this.getZ()+")"}getDistance(e){return Math.sqrt((this.getX()-e.getX())*(this.getX()-e.getX())+(this.getY()-e.getY())*(this.getY()-e.getY())+(this.getZ()-e.getZ())*(this.getZ()-e.getZ()))}minus(e){return new D(this.getX()-e.getX(),this.getY()-e.getY(),this.getZ()-e.getZ())}}class w{#e;constructor(e){if(!e||void 0===e)throw new Error("Cannot create point with no values.");if(0===e.length)throw new Error("Cannot create point with empty values.");if(!e.every((function(e){return!isNaN(e)})))throw new Error("Cannot create point with non number values.");this.#e=e}get(e){return this.#e[e]}length(){return this.#e.length}toString(){return"("+this.#e.toString()+")"}getValues(){return this.#e.slice()}canCompare(e){return!!e&&this.length()===e.length()}equals(e){if(!this.canCompare(e))return!1;for(let t=0,n=this.length();to;t--,o++)r=n[o],n[o]=n[t],n[t]=r}class z{#P;#O=!0;#w=function(){return new Int8Array(new Int16Array([1]).buffer)[0]>0}();#A;#x;constructor(e,t){this.#P=e,void 0!==t&&(this.#O=t),this.#A=this.#O!==this.#w,this.#x=new DataView(e)}readUint16(e){return this.#x.getUint16(e,this.#O)}readInt16(e){return this.#x.getInt16(e,this.#O)}readUint32(e){return this.#x.getUint32(e,this.#O)}readBigUint64(e){return this.#x.getBigUint64(e,this.#O)}readInt32(e){return this.#x.getInt32(e,this.#O)}readBigInt64(e){return this.#x.getBigInt64(e,this.#O)}readFloat32(e){return this.#x.getFloat32(e,this.#O)}readFloat64(e){return this.#x.getFloat64(e,this.#O)}readBinaryArray(e,t){const n=new Uint8Array(this.#P,e,t),i=8*n.length,r=new Uint8Array(i);let o=0,a=0;for(let e=0;e0?0|n:0;return e.substring(i,i+t.length)===t}function X(e,t){return null!=e&&null!=t&&e.substring(e.length-t.length)===t}function j(e){const t=[];if(null==e)return t;const n=/{(\w+)}/g;let i=n.exec(e);for(;i;)t.push(i[1]),i=n.exec(e);return t}function _(e,t){let n="";if(null==e)return n;if(n=e,null==t)return n;const i=j(e);for(let e=0;e=e.length)&&(n=0),(void 0===i||i<=n||i>e.length)&&(i=e.length);for(let r=n;r2^"+e+").")}}return i}function ye(e,t){return t?8:R(e)?12:8}class Ce{#b={};#F;#R=new ce;#E=this.#R;#q(e){return this.#R.decode(e)}#U(e){return this.#E.decode(e)}getDefaultCharacterSet(){return this.#F}setDefaultCharacterSet(e){this.#F=e}setDecoderCharacterSet(e){this.#E=new TextDecoder(e)}getDicomElements(){return this.#b}#Q(e,t){const n=e.readHex(t);t+=Uint16Array.BYTES_PER_ELEMENT;const i=e.readHex(t);return t+=Uint16Array.BYTES_PER_ELEMENT,{tag:new Q(n,i),endOffset:t}}#M(e,t,n){const i={};let r=this.#B(e,t,n);if(t=r.endOffset,V(r.tag))return{data:i,endOffset:r.endOffset,isSeqDelim:!0};if(i[r.tag.getKey()]={tag:r.tag,vr:"NONE",vl:r.vl,undefinedLength:r.undefinedLength},r.undefinedLength){let o=!1;for(;!o;)r=this.#B(e,t,n),t=r.endOffset,o="FFFEE00D"===r.tag.getKey(),o||(i[r.tag.getKey()]=r)}else{const o=t;for(t-=r.vl;t8&&"OB"===a&&g.warn("Reading DICOM pixel data with bitsAllocated>8 and OB VR."),l=[],1===i)l.push(t.readBinaryArray(s,o));else if(8===i)0===n?l.push(t.readUint8Array(s,o)):l.push(t.readInt8Array(s,o));else{if(16!==i)throw new Error("Unsupported bits allocated: "+i);0===n?l.push(t.readUint16Array(s,o)):l.push(t.readInt16Array(s,o))}else if(void 0!==c)if("Uint8"===c)l=t.readUint8Array(s,o);else if("Uint16"===c)l=t.readUint16Array(s,o),"O"!==a[0]&&(l=Array.from(l));else if("Uint32"===c)l=t.readUint32Array(s,o),"O"!==a[0]&&(l=Array.from(l));else if("Uint64"===c)l=t.readUint64Array(s,o);else if("Int16"===c)l=Array.from(t.readInt16Array(s,o));else if("Int32"===c)l=Array.from(t.readInt32Array(s,o));else if("Int64"===c)l=t.readInt64Array(s,o);else if("Float32"===c)l=Array.from(t.readFloat32Array(s,o));else if("Float64"===c)l=Array.from(t.readFloat64Array(s,o));else{if("string"!==c)throw Error("Unknown VR type: "+c);{const e=t.readUint8Array(s,o);l=q(a)?this.#U(e):this.#q(e),l=function(e){let t=e;const n=e.length-1;return e[n]===le&&(t=e.substring(0,n)),t=t.trim(),t}(l).split("\\")}}else if("xx"===a)l=Array.from(t.readUint16Array(s,o));else if("ox"===a)l=8===i?Array.from(t.readUint8Array(s,o)):Array.from(t.readUint16Array(s,o));else if("xs"===a)l=0===n?Array.from(t.readUint16Array(s,o)):Array.from(t.readInt16Array(s,o));else if("AT"===a){const e=t.readUint16Array(s,o);l=[];for(let t=0,n=e.length;t=65&&r<=90&&o>=65&&o<=90);let s=null;if(n===t)s=a?"1.2.840.10008.1.2":"1.2.840.10008.1.2.1";else{if(a)throw new Error("Not a valid DICOM file (no magic DICM word foundand implicit VR big endian detected)");s="1.2.840.10008.1.2.2"}const l=new oe("UI");return l.tag=new Q("0002","0010"),l.value=[s+" "],l.vl=l.value[0].length,l.startOffset=e.startOffset,l.endOffset=l.startOffset+l.vl,l}(i);this.#b[e.tag.getKey()]=e,n=e.value[0],t=0}if(!function(e){return"1.2.840.10008.1.2"===e||"1.2.840.10008.1.2.1"===e||"1.2.840.10008.1.2.2"===e||ge(e)||me(e)||pe(e)||fe(e)}(n))throw new Error("Unsupported DICOM transfer syntax: '"+n+"' ("+function(e){let t="Unknown";return"1.2.840.10008.1.2"===e?t="Little Endian Implicit":"1.2.840.10008.1.2.1"===e?t="Little Endian Explicit":"1.2.840.10008.1.2.1.99"===e?t="Little Endian Deflated Explicit":"1.2.840.10008.1.2.2"===e?t="Big Endian Explicit":ge(e)?t="1.2.840.10008.1.2.4.50"===e?"JPEG Baseline":"JPEG Extended, Process 2+4":me(e)?t="1.2.840.10008.1.2.4.57"===e?"JPEG Lossless, Nonhierarchical (Processes 14)":"JPEG Lossless, Non-hierarchical, 1st Order Prediction":function(e){return null!==e.match(/1.2.840.10008.1.2.4.5/)&&!ge(e)&&!me(e)||null!==e.match(/1.2.840.10008.1.2.4.6/)}(e)?t="Retired JPEG":function(e){return null!==e.match(/1.2.840.10008.1.2.4.8/)}(e)?t="JPEG-LS":pe(e)?t="1.2.840.10008.1.2.4.91"===e?"JPEG 2000 (Lossless or Lossy)":"JPEG 2000 (Lossless only)":"1.2.840.10008.1.2.4.100"===e?t="MPEG2":fe(e)&&(t="RLE"),t}(n)+")");let s=!1;for(Se(n)&&(s=!0),he(n)&&(o=new z(e,!1));t1&&t.length>e){const n=t.length/e,r=[];let o=0;for(let i=0;i{if(void 0===this.#k[e.type])return;const t=this.#k[e.type].slice();for(let n=0;n2?e:0})));let c=o.indexToOffset(l);void 0===i&&(i=!1);let u=null;u=i?function(e){return t.getRescaledValueAtOffset(e)}:function(e){return t.getValueAtOffset(e)};const d=o.get(0),S=o.get(1),h=o.get(2);let g=o.getDimSize(2);const m=t.getNumberOfComponents(),p=1===t.getPlanarConfiguration(),f=function(e,t,n,i,r,o,a,s){return 1===m?Te(e,t,n,i,r,o,a,s):3===m?function(e,t,n,i,r,o,a,s,l){const c=[];return l?(c.push(Te(e,t,n,i,r,o,a,s)),c.push(Te(e,t+n*i,n,i,r,o,a,s)),c.push(Te(e,t+2*n*i,n,i,r,o,a,s))):(i*=3,o*=3,c.push(Te(e,t,n,i,r,o,a,s)),c.push(Te(e,t+1,n,i,r,o,a,s)),c.push(Te(e,t+2,n,i,r,o,a,s))),{next:function(){const e=c[0].next(),t=c[1].next(),n=c[2].next();return e.done?{done:!0,index:n.index}:{value:[e.value,t.value,n.value],done:!1,index:[e.index,t.index,n.index]}}}}(e,3*t,n,i,r,o,a,s,p):void 0};let D=null;if(r&&void 0!==r){const e=r.getColAbsMax(0),t=r.getColAbsMax(2),n=!1,i=!1;let o=null;if(2===t.index)o=d*S,D=0===e.index?f(u,c,o,1,d,d,n,i):f(u,c,o,d,S,1,n,i);else if(0===t.index)o=h*S,D=1===e.index?f(u,c,o,d,S,g,n,i):f(u,c,o,g,h,d,n,i);else{if(1!==t.index)throw new Error("Unknown direction: "+t.index);o=h*d,D=0===e.index?f(u,c,o,1,d,g,n,i):f(u,c,o,g,h,1,n,i)}}else if(1===t.getNumberOfComponents())D=function(e,t,n,i){void 0===i&&(i=1);let r=t;return{next:function(){if(r=e[i+1].index&&++i;const t={value:e[i].colour,done:!1,index:n};return++n,t}return{done:!0,index:t}}}}class Oe{#h;#H;constructor(e,t){this.#h=e,this.#H=t}getSlope(){return this.#h}getIntercept(){return this.#H}apply(e){return e*this.#h+this.#H}equals(e){return null!==e&&this.getSlope()===e.getSlope()&&this.getIntercept()===e.getIntercept()}toString(){return this.getSlope()+", "+this.getIntercept()}isID(){return 1===this.getSlope()&&0===this.getIntercept()}}class we{#e;constructor(e){if(!e||void 0===e)throw new Error("Cannot create size with no values.");if(0===e.length)throw new Error("Cannot create size with empty values.");if(!e.every((function(e){return!isNaN(e)&&0!==e})))throw new Error("Cannot create size with non number or zero values.");this.#e=e}get(e){return this.#e[e]}length(){return this.#e.length}toString(){return"("+this.#e.toString()+")"}getValues(){return this.#e.slice()}moreThanOne(e){return this.length()>=e+1&&1!==this.get(e)}canScroll3D(e){let t=2;return void 0!==e&&(t=e.getThirdColMajorDirection()),this.moreThanOne(t)}canScroll(e){let t=this.canScroll3D(e);for(let e=3;ethis.length())return null;if(void 0===t)t=0;else if(t<0||t>e)throw new Error("Invalid start value for getDimSize");let n=1;for(let i=t;in-1)throw new Error("Wrong input dir value: "+t[e]);for(let n=0;n=0&&ithis.length()-1)throw new Error("Invalid start value for indexToOffset");let n=0;for(let i=t;i0;--e)r=this.getDimSize(e),n[e]=Math.floor(i/r),i-=n[e]*r;return n[0]=i,new e(n)}get2D(){return{x:this.get(0),y:this.get(1)}}}class Ae{#e;constructor(e){if(!e||void 0===e)throw new Error("Cannot create spacing with no values.");if(0===e.length)throw new Error("Cannot create spacing with empty values.");if(!e.every((function(e){return!isNaN(e)&&0!==e})))throw new Error("Cannot create spacing with non number or zero values.");this.#e=e}get(e){return this.#e[e]}length(){return this.#e.length}toString(){return"("+this.#e.toString()+")"}getValues(){return this.#e.slice()}equals(e){if(!e)return!1;const t=this.length();if(t!==e.length())return!1;for(let n=0;n0?i+1:i}appendOrigin(e,t,n){if(void 0!==n&&this.#X[n].splice(t,0,e),void 0===n||n===this.#j){this.#Z=!0,this.#W.splice(t,0,e);const n=this.#z.getValues();n[2]+=1,this.#z=new we(n)}}appendFrame(e,t){this.#X[t]=[e];const n=this.#z.getValues(),i=this.#Y.getValues();4===n.length?n[3]+=1:(n.push(2),i.push(1)),this.#z=new we(n),this.#Y=new Ae(i)}toString(){return"Origin: "+this.getOrigin()+", Size: "+this.getSize()+", Spacing: "+this.getSpacing()+", Orientation: "+this.getOrientation()}equals(e){return null!==e&&this.getOrigin().equals(e.getOrigin())&&this.getSize().equals(e.getSize())&&this.getSpacing().equals(e.getSpacing())}isInBounds(e){return this.isIndexInBounds(this.worldToIndex(e))}isIndexInBounds(e,t){return this.getSize().isInBounds(e,t)}indexToWorld(e){const t=this.getSpacing(),n=new O(e.get(0)*t.get(0),e.get(1)*t.get(1),e.get(2)*t.get(2)),i=this.getOrientation().multiplyPoint3D(n),r=e.getValues(),o=this.getOrigin();return r[0]=o.getX()+i.getX(),r[1]=o.getY()+i.getY(),r[2]=o.getZ()+i.getZ(),new w(r)}pointToWorld(e){const t=this.getSpacing(),n=new O(e.getX()*t.get(0),e.getY()*t.get(1),e.getZ()*t.get(2)),i=this.getOrientation().multiplyPoint3D(n),r=this.getOrigin();return new O(r.getX()+i.getX(),r.getY()+i.getY(),r.getZ()+i.getZ())}worldToIndex(t){const n=this.getOrigin(),i=new O(t.get(0)-n.getX(),t.get(1)-n.getY(),t.get(2)-n.getZ()),r=this.getOrientation().getInverse().multiplyPoint3D(i),o=t.getValues(),a=this.getSpacing();return o[0]=Math.round(r.getX()/a.get(0)),o[1]=Math.round(r.getY()/a.get(1)),o[2]=Math.round(r.getZ()/a.get(2)),new e(o)}worldToPoint(e){const t=this.getOrigin(),n=new O(e.get(0)-t.getX(),e.get(1)-t.getY(),e.get(2)-t.getZ()),i=this.getOrientation().getInverse().multiplyPoint3D(n),r=e.getValues(),o=this.getSpacing();return r[0]=i.getX()/o.get(0),r[1]=i.getY()/o.get(1),r[2]=i.getZ()/o.get(2),new O(r[0],r[1],r[2])}}function be(e,t){return t.getInverse().multiplyArray3D(e)}function Fe(e,t){return t.multiplyArray3D(e)}function Re(e,t,n){if(void 0===n&&(n=!0),e.length<=1)return;const i=t.getInverse();let r=i.multiplyVector3D(e[0]),o=i.multiplyVector3D(e[1]),a=Math.abs(r.getZ()-o.getZ());const s=[];for(let t=0;t1e-4&&g.warn("Varying slice spacing, mean delta: "+t.toFixed(3)+" ("+s.length+" case(s))")}return a}function Ee(e){const t=e["00280010"];if(void 0===t)throw new Error("Missing DICOM image number of rows");if(0===t.value.length)throw new Error("Empty DICOM image number of rows");const n=e["00280011"];if(void 0===n)throw new Error("Missing DICOM image number of columns");if(0===n.value.length)throw new Error("Empty DICOM image number of columns");return[n.value[0],t.value[0]]}class qe{getTime(e){}}class Ue{checkElements(e){Ee(e)}create(e,t,n){const i=Ee(e),o=[i[0],i[1],1],a=e["00280008"];a&&o.push(a.value[0]);const s=new we(o),l=function(e){let t=1,n=1;const i=["00280030","00181164","00182010","00280034"];for(let r=0;r>8};r=t.value.map(e),o=n.value.map(e),a=i.value.map(e)}}else if(8===s.value[2]){g.info("Scaling 16bits color lut since the lut descriptor is 8.");let e=t.value.slice(0);r=new Uint8Array(e.buffer),e=n.value.slice(0),o=new Uint8Array(e.buffer),e=i.value.slice(0),a=new Uint8Array(e.buffer)}M.paletteLut={red:r,green:o,blue:a}}const Z=e["00082144"];return void 0!==Z&&(M.RecommendedDisplayFrameRate=parseInt(Z.value[0],10)),x.setMeta(M),x}}function Qe(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Me(e,t){const n=e[t.tag];if(1===t.type||2===t.type){if(void 0===n)throw new Error("Missing or empty "+t.name)}else if(void 0===n)return;let i,r=!1;if(i=1===n.value.length?n.value[0]:n.value,Array.isArray(i))for(let e=0;e.206896552?Math.pow(e,3):.128418549*e-.017712903,t}const n=p,i=(e.l+16)/116;return{x:n.x*t(i+e.a/500),y:n.y*t(i),z:n.z*t(i-e.b/200)}}(e))}({l:.001525902*(n={l:i[0],a:i[1],b:i[2]}).l,a:.003891051*n.a-128,b:.003891051*n.b-128});t.displayValue=r}var n;if(void 0===e["00620003"])throw Error("Missing Segmented Property Category Code Sequence.");if(t.propertyCategoryCode=Ne(e["00620003"].value[0]),void 0===e["0062000F"])throw Error("Missing Segmented Property Type Code Sequence.");return t.propertyTypeCode=Ne(e["0062000F"].value[0]),void 0!==e["00620020"]&&(t.trackingId=e["00620020"].value[0],t.trackingUid=e["00620021"].value[0]),t}function Ge(e){if(void 0===e["00280030"])return null;const t=e["00280030"],n=[parseFloat(t.value[0]),parseFloat(t.value[1])];return void 0!==e["00180050"]?n.push(parseFloat(e["00180050"].value[0])):void 0!==e["00180088"]&&n.push(parseFloat(e["00180088"].value[0])),new Ae(n)}function ke(e){const t=[];if(void 0!==e["00089124"]){const n=e["00089124"].value;for(let e=0;e1e-4;return t&&(t=e>.001,t?(t=e>.01,t||g.warn("Using larger+ real world epsilon in SEG pos pat adding")):g.warn("Using larger real world epsilon in SEG pos pat adding")),t},U=[];U.push(T[0]);let Q=0;for(let t=1;ta)throw new Error("Test distance is increasing when adding intermediate pos pats");U.push(T[t])}const M=U.length,B=new xe(x[0],r,b,w),N=[0];for(let e=1;e=this.#ae.numberOfFiles?g.warn("Ignoring frame at index "+t+" (size: "+this.#ae.numberOfFiles+")"):(this.#P.set(e,i*t),this.appendFrame(t,new O(0,0,0)))}appendFrame(e,t){this.#J.appendFrame(t,e),this.#ge({type:"appendframe"})}getDataRange(){return this.#se||(this.#se=this.calculateDataRange()),this.#se}getRescaledDataRange(){return this.#le||(this.#le=this.calculateRescaledDataRange()),this.#le}getHistogram(){if(!this.#ce){const e=this.calculateHistogram();this.#se=e.dataRange,this.#le=e.rescaledDataRange,this.#ce=e.histogram}return this.#ce}addEventListener(e,t){this.#ue.add(e,t)}removeEventListener(e,t){this.#ue.remove(e,t)}#ge=e=>{this.#ue.fireEvent(e)};setAtOffsets(e,t){let n;for(let i=0,r=e.length;i=3&&(r=i.getDimSize(3));for(let i=0;it&&(t=n),nn?t:n}}{let e=this.getRescaledValueAtOffset(0),t=e,n=0;const i=this.getGeometry().getSize();let r=i.getTotalSize();3===i.length()&&(r=i.getDimSize(3));for(let i=0;it&&(t=n),ni&&(i=r),ra&&(a=s),s{const t=this.getCurrentIndex();if(3===t.length()){const n=t.getValues();n.push(0),this.setCurrentIndex(new e(n))}}))}getImage(){return this.#me}setImage(e){this.#me=e}getOrientation(){return this.#_}setOrientation(e){this.#_=e}init(){this.setInitialIndex()}setInitialIndex(){const t=this.#me.getGeometry().getSize(),n=new Array(t.length());n.fill(0),n[0]=Math.floor(t.get(0)/2),n[1]=Math.floor(t.get(1)/2),n[2]=Math.floor(t.get(2)/2),this.setCurrentIndex(new e(n),!0)}getPlaybackMilliseconds(e){return e||(e=10),Math.round(1e3/e)}#Te=function(e,t){return 255};getAlphaFunction(){return this.#Te}setAlphaFunction(e){this.#Te=e,this.#ge({type:"alphafuncchange"})}getCurrentWindowLut(e){this.getCurrentIndex()||this.setInitialIndex();const t=this.getCurrentIndex();void 0===e&&(e=this.#me.getRescaleSlopeAndIntercept(t));let i=null;if(this.#De&&void 0!==this.#fe[this.#De]&&void 0!==this.#fe[this.#De].perslice&&!0===this.#fe[this.#De].perslice){const e=this.#me.getSecondaryOffset(t);i=this.#fe[this.#De].wl[e]}i||(this.#ye||this.setWindowLevelPresetById(0,!0),i=this.#ye);let r=this.#pe[e.toString()];if(void 0===r){const e=new n(this.#me.getRescaleSlopeAndIntercept(),this.#me.getMeta().BitsStored),t=new s(e,this.#me.getMeta().IsSigned);this.addWindowLut(t),r=t}const o=r.getWindowLevel();return i.equals(o)||(r.setWindowLevel(i),r.update(),o&&o.getWidth()===i.getWidth()&&o.getCenter()===i.getCenter()||this.#ge({type:"wlchange",value:[i.getCenter(),i.getWidth()],wc:i.getCenter(),ww:i.getWidth(),skipGenerate:!0})),r}addWindowLut(e){const t=e.getRescaleLut().getRSI();this.#pe[t.toString()]=e}getWindowPresets(){return this.#fe}getWindowPresetsNames(){return Object.keys(this.#fe)}setWindowPresets(e){this.#fe=e}setDefaultColourMap(e){this.#Ce=e}addWindowPresets(e){const t=Object.keys(e);let n=null;for(let i=0;i{this.#ue.fireEvent(e)};getWindowLevelMinMax(){const e=this.getImage().getRescaledDataRange(),t=e.min;let n=e.max-t;return n<1&&(g.warn("Zero or negative window width, defaulting to one."),n=1),new r(t+n/2,n)}setWindowLevelMinMax(){const e=this.getWindowLevelMinMax();this.setWindowLevel(e.getCenter(),e.getWidth(),"minmax")}generateImageData(e,t){void 0===t&&(this.getCurrentIndex()||this.setInitialIndex(),t=this.getCurrentIndex());const n=this.getImage(),i=Le(n,t,!1,this.getOrientation()),r=n.getPhotometricInterpretation();switch(r){case"MONOCHROME1":case"MONOCHROME2":!function(e,t,n,i,r){let o=0,a=0,s=t.next();for(;!s.done;)a=i.getValue(s.value),e.data[o]=r.red[a],e.data[o+1]=r.green[a],e.data[o+2]=r.blue[a],e.data[o+3]=n(s.value,s.index),o+=4,s=t.next()}(e,i,this.getAlphaFunction(),this.getCurrentWindowLut(),this.getColourMap());break;case"PALETTE COLOR":!function(e,t,n,i,r){const o=function(e){return e>>8};r&&g.info("Scaling 16bits data to 8bits.");let a=0,s=0,l=t.next();for(;!l.done;)s=l.value,r?(e.data[a]=o(i.red[s]),e.data[a+1]=o(i.green[s]),e.data[a+2]=o(i.blue[s])):(e.data[a]=i.red[s],e.data[a+1]=i.green[s],e.data[a+2]=i.blue[s]),e.data[a+3]=n(s,l.index),a+=4,l=t.next()}(e,i,this.getAlphaFunction(),this.getColourMap(),16===n.getMeta().BitsStored);break;case"RGB":!function(e,t,n){let i=0,r=t.next();for(;!r.done;)e.data[i]=r.value[0],e.data[i+1]=r.value[1],e.data[i+2]=r.value[2],e.data[i+3]=n(r.value,r.index),i+=4,r=t.next()}(e,i,this.getAlphaFunction());break;case"YBR_FULL":!function(e,t,n){let i=0,r=null,o=t.next();for(;!o.done;)a=o.value[0],s=o.value[1],r={r:a+1.402*((l=o.value[2])-128),g:a-.34414*(s-128)-.71414*(l-128),b:a+1.772*(s-128)},e.data[i]=r.r,e.data[i+1]=r.g,e.data[i+2]=r.b,e.data[i+3]=n(o.value,o.index),i+=4,o=t.next();var a,s,l}(e,i,this.getAlphaFunction());break;default:throw new Error("Unsupported photometric interpretation: "+r)}}incrementIndex(t,n){const i=this.getCurrentIndex(),r=new Array(i.length());r.fill(0),t