diff --git a/bun.lock b/bun.lock index cbef80b75..17db6fe1d 100644 --- a/bun.lock +++ b/bun.lock @@ -138,7 +138,7 @@ }, "packages/adapters": { "name": "@cornerstonejs/adapters", - "version": "2.19.10", + "version": "2.19.11", "dependencies": { "@babel/runtime-corejs2": "^7.17.8", "buffer": "^6.0.3", @@ -147,13 +147,13 @@ "ndarray": "^1.0.19", }, "peerDependencies": { - "@cornerstonejs/core": "^2.19.10", - "@cornerstonejs/tools": "^2.19.10", + "@cornerstonejs/core": "^2.19.11", + "@cornerstonejs/tools": "^2.19.11", }, }, "packages/ai": { "name": "@cornerstonejs/ai", - "version": "2.19.10", + "version": "2.19.11", "dependencies": { "@babel/runtime-corejs2": "^7.17.8", "buffer": "^6.0.3", @@ -171,7 +171,7 @@ }, "packages/core": { "name": "@cornerstonejs/core", - "version": "2.19.10", + "version": "2.19.11", "dependencies": { "@kitware/vtk.js": "32.9.0", "comlink": "^4.4.1", @@ -180,7 +180,7 @@ }, "packages/dicomImageLoader": { "name": "@cornerstonejs/dicom-image-loader", - "version": "2.19.10", + "version": "2.19.11", "dependencies": { "@cornerstonejs/codec-charls": "^1.2.3", "@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2", @@ -192,7 +192,7 @@ "uuid": "^9.0.0", }, "peerDependencies": { - "@cornerstonejs/core": "^2.19.10", + "@cornerstonejs/core": "^2.19.11", "dicom-parser": "^1.8.9", }, }, @@ -200,11 +200,11 @@ "name": "docs", "version": "2.1.10", "dependencies": { - "@cornerstonejs/adapters": "^2.19.10", - "@cornerstonejs/core": "^2.19.10", - "@cornerstonejs/dicom-image-loader": "^2.19.10", - "@cornerstonejs/nifti-volume-loader": "^2.19.10", - "@cornerstonejs/tools": "^2.19.10", + "@cornerstonejs/adapters": "^2.19.11", + "@cornerstonejs/core": "^2.19.11", + "@cornerstonejs/dicom-image-loader": "^2.19.11", + "@cornerstonejs/nifti-volume-loader": "^2.19.11", + "@cornerstonejs/tools": "^2.19.11", "@docusaurus/core": "3.6.3", "@docusaurus/faster": "3.6.3", "@docusaurus/module-type-aliases": "3.6.3", @@ -240,19 +240,32 @@ "typedoc": "0.26.10", }, }, + "packages/labelmap-interpolation": { + "name": "@cornerstonejs/labelmap-interpolation", + "version": "2.19.11", + "dependencies": { + "@itk-wasm/morphological-contour-interpolation": "1.1.0", + "itk-wasm": "1.0.0-b.165", + }, + "peerDependencies": { + "@cornerstonejs/core": "^2.19.11", + "@cornerstonejs/tools": "^2.19.11", + "@kitware/vtk.js": "^32.9.0", + }, + }, "packages/nifti-volume-loader": { "name": "@cornerstonejs/nifti-volume-loader", - "version": "2.19.10", + "version": "2.19.11", "dependencies": { "nifti-reader-js": "^0.6.8", }, "peerDependencies": { - "@cornerstonejs/core": "^2.19.10", + "@cornerstonejs/core": "^2.19.11", }, }, "packages/tools": { "name": "@cornerstonejs/tools", - "version": "2.19.10", + "version": "2.19.11", "dependencies": { "@types/offscreencanvas": "2019.7.3", "comlink": "^4.4.1", @@ -262,7 +275,7 @@ "canvas": "^2.11.2", }, "peerDependencies": { - "@cornerstonejs/core": "^2.19.10", + "@cornerstonejs/core": "^2.19.11", "@kitware/vtk.js": "32.9.0", "@types/d3-array": "^3.0.4", "@types/d3-interpolate": "^3.0.1", @@ -601,6 +614,8 @@ "@cornerstonejs/dicom-image-loader": ["@cornerstonejs/dicom-image-loader@workspace:packages/dicomImageLoader"], + "@cornerstonejs/labelmap-interpolation": ["@cornerstonejs/labelmap-interpolation@workspace:packages/labelmap-interpolation"], + "@cornerstonejs/nifti-volume-loader": ["@cornerstonejs/nifti-volume-loader@workspace:packages/nifti-volume-loader"], "@cornerstonejs/tools": ["@cornerstonejs/tools@workspace:packages/tools"], @@ -869,7 +884,7 @@ "@itk-wasm/dam": ["@itk-wasm/dam@1.1.1", "", { "dependencies": { "axios": "^1.4.0", "commander": "^10.0.1", "decompress": "^4.2.1", "files-from-path": "^1.0.0", "ipfs-car": "^1.0.0", "tar": "^6.1.13" }, "bin": { "dam": "cli.js" } }, "sha512-7+9L3lrLMKF4y6B6qjs8GqfbpxT0waOJUM14NdMNEA6M+BoBS8fdHREhQHo2s7QMA5O7I+Jv7m+dyqlisGnbdQ=="], - "@itk-wasm/morphological-contour-interpolation": ["@itk-wasm/morphological-contour-interpolation@1.0.1", "", { "dependencies": { "itk-wasm": "1.0.0-b.165" } }, "sha512-wxLB4nX6CiWpNQyTWC7oeFXogiZbtmSuLhyAtY66sM0SEnMoOcAuSX2+osPcOo13rfYnHLA02uQiICp8hvUGwA=="], + "@itk-wasm/morphological-contour-interpolation": ["@itk-wasm/morphological-contour-interpolation@1.1.0", "", { "dependencies": { "itk-wasm": "1.0.0-b.173" } }, "sha512-n6JIyDcSCCjlpfCW8mnTTzwPTE8U1QT87hNmyAknxdpGR4dfAzIutuKNrwgvr9UiKEBcit0X3HNx9dkzDwcIcw=="], "@jest/console": ["@jest/console@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "jest-message-util": "^29.7.0", "jest-util": "^29.7.0", "slash": "^3.0.0" } }, "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg=="], @@ -4843,7 +4858,7 @@ "strip-bom-string": ["strip-bom-string@1.0.0", "", {}, "sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g=="], - "strip-dirs": ["strip-dirs@3.0.0", "", { "dependencies": { "inspect-with-kind": "^1.0.5", "is-plain-obj": "^1.1.0" } }, "sha512-I0sdgcFTfKQlUPZyAqPJmSG3HLO9rWDFnxonnIbskYNM3DwFOeTNB5KzVq3dA1GdRAc/25b5Y7UO2TQfKWw4aQ=="], + "strip-dirs": ["strip-dirs@2.1.0", "", { "dependencies": { "is-natural-number": "^4.0.1" } }, "sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g=="], "strip-final-newline": ["strip-final-newline@3.0.0", "", {}, "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw=="], @@ -5523,6 +5538,8 @@ "@eslint/eslintrc/minimatch": ["minimatch@3.1.2", "", { "dependencies": { "brace-expansion": "^1.1.7" } }, "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw=="], + "@externals/polyseg-wasm/@itk-wasm/morphological-contour-interpolation": ["@itk-wasm/morphological-contour-interpolation@1.0.1", "", { "dependencies": { "itk-wasm": "1.0.0-b.165" } }, "sha512-wxLB4nX6CiWpNQyTWC7oeFXogiZbtmSuLhyAtY66sM0SEnMoOcAuSX2+osPcOo13rfYnHLA02uQiICp8hvUGwA=="], + "@fastify/ajv-compiler/ajv-formats": ["ajv-formats@2.1.1", "", { "dependencies": { "ajv": "^8.0.0" } }, "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA=="], "@fastify/ajv-compiler/fast-uri": ["fast-uri@2.4.0", "", {}, "sha512-ypuAmmMKInk5q7XcepxlnUWDLWv4GFtaJqAzWKqn62IpQ3pejtr5dTVbt3vwqVaMKmkNR55sTT+CqUKIaT21BA=="], @@ -5539,6 +5556,8 @@ "@istanbuljs/load-nyc-config/find-up": ["find-up@4.1.0", "", { "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" } }, "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw=="], + "@itk-wasm/morphological-contour-interpolation/itk-wasm": ["itk-wasm@1.0.0-b.173", "", { "dependencies": { "@itk-wasm/dam": "^1.1.1", "@thewtex/zstddec": "^0.2.0", "@types/emscripten": "^1.39.10", "axios": "^1.6.2", "chalk": "^5.3.0", "comlink": "^4.4.1", "commander": "^11.1.0", "fs-extra": "^11.2.0", "glob": "^8.1.0", "markdown-table": "^3.0.3", "mime-types": "^2.1.35", "wasm-feature-detect": "^1.6.1" }, "bin": { "itk-wasm": "src/itk-wasm-cli.js" } }, "sha512-SV2lfZ1mClWuSK/noaZgGj9jhroY4MZu19ci9pIucuyhoGdXrVSmWlPH/JYMDi9RP3BogmQwe9wfFc3X1dcEPg=="], + "@jest/core/ansi-escapes": ["ansi-escapes@4.3.2", "", { "dependencies": { "type-fest": "^0.21.3" } }, "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ=="], "@jest/core/ci-info": ["ci-info@3.9.0", "", {}, "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ=="], @@ -5825,6 +5844,8 @@ "@web3-storage/car-block-validator/multiformats": ["multiformats@9.9.0", "", {}, "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg=="], + "@xhmikosr/decompress/strip-dirs": ["strip-dirs@3.0.0", "", { "dependencies": { "inspect-with-kind": "^1.0.5", "is-plain-obj": "^1.1.0" } }, "sha512-I0sdgcFTfKQlUPZyAqPJmSG3HLO9rWDFnxonnIbskYNM3DwFOeTNB5KzVq3dA1GdRAc/25b5Y7UO2TQfKWw4aQ=="], + "@xhmikosr/decompress-tar/tar-stream": ["tar-stream@3.1.7", "", { "dependencies": { "b4a": "^1.6.4", "fast-fifo": "^1.2.0", "streamx": "^2.15.0" } }, "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ=="], "@zkochan/js-yaml/argparse": ["argparse@2.0.1", "", {}, "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="], @@ -6005,8 +6026,6 @@ "decompress/pify": ["pify@2.3.0", "", {}, "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog=="], - "decompress/strip-dirs": ["strip-dirs@2.1.0", "", { "dependencies": { "is-natural-number": "^4.0.1" } }, "sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g=="], - "decompress-tar/file-type": ["file-type@5.2.0", "", {}, "sha512-Iq1nJ6D2+yIO4c8HHg4fyVb8mAJieo1Oloy1mLLaB2PvezNedhBVm+QU7g0qM42aiMbRXTxKKwGD17rjKNJYVQ=="], "decompress-tar/is-stream": ["is-stream@1.1.0", "", {}, "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ=="], @@ -6851,8 +6870,6 @@ "stringify-object/is-obj": ["is-obj@1.0.1", "", {}, "sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg=="], - "strip-dirs/is-plain-obj": ["is-plain-obj@1.1.0", "", {}, "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg=="], - "stylelint/cosmiconfig": ["cosmiconfig@8.3.6", "", { "dependencies": { "import-fresh": "^3.3.0", "js-yaml": "^4.1.0", "parse-json": "^5.2.0", "path-type": "^4.0.0" }, "peerDependencies": { "typescript": ">=4.9.5" }, "optionalPeers": ["typescript"] }, "sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA=="], "stylelint/file-entry-cache": ["file-entry-cache@7.0.2", "", { "dependencies": { "flat-cache": "^3.2.0" } }, "sha512-TfW7/1iI4Cy7Y8L6iqNdZQVvdXn0f8B4QcIXmkIbtTIe/Okm/nSlHb4IwGzRVOd3WfSieCgvf5cMzEfySAIl0g=="], @@ -7211,6 +7228,14 @@ "@istanbuljs/load-nyc-config/find-up/locate-path": ["locate-path@5.0.0", "", { "dependencies": { "p-locate": "^4.1.0" } }, "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g=="], + "@itk-wasm/morphological-contour-interpolation/itk-wasm/chalk": ["chalk@5.3.0", "", {}, "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w=="], + + "@itk-wasm/morphological-contour-interpolation/itk-wasm/commander": ["commander@11.1.0", "", {}, "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ=="], + + "@itk-wasm/morphological-contour-interpolation/itk-wasm/fs-extra": ["fs-extra@11.3.0", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew=="], + + "@itk-wasm/morphological-contour-interpolation/itk-wasm/glob": ["glob@8.1.0", "", { "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^5.0.1", "once": "^1.3.0" } }, "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ=="], + "@jest/core/ansi-escapes/type-fest": ["type-fest@0.21.3", "", {}, "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w=="], "@jest/reporters/glob/minimatch": ["minimatch@3.1.2", "", { "dependencies": { "brace-expansion": "^1.1.7" } }, "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw=="], @@ -7469,6 +7494,8 @@ "@vercel/nft/micromatch/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="], + "@xhmikosr/decompress/strip-dirs/is-plain-obj": ["is-plain-obj@1.1.0", "", {}, "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg=="], + "archiver-utils/readable-stream/string_decoder": ["string_decoder@1.3.0", "", { "dependencies": { "safe-buffer": "~5.2.0" } }, "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA=="], "archiver/readable-stream/string_decoder": ["string_decoder@1.3.0", "", { "dependencies": { "safe-buffer": "~5.2.0" } }, "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA=="], @@ -8385,6 +8412,8 @@ "@istanbuljs/load-nyc-config/find-up/locate-path/p-locate": ["p-locate@4.1.0", "", { "dependencies": { "p-limit": "^2.2.0" } }, "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A=="], + "@itk-wasm/morphological-contour-interpolation/itk-wasm/glob/minimatch": ["minimatch@5.1.6", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g=="], + "@jsdevtools/coverage-istanbul-loader/schema-utils/ajv/json-schema-traverse": ["json-schema-traverse@0.4.1", "", {}, "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="], "@lerna/create/execa/npm-run-path/path-key": ["path-key@3.1.1", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="], @@ -8909,6 +8938,8 @@ "@docusaurus/utils/webpack/schema-utils/ajv/json-schema-traverse": ["json-schema-traverse@0.4.1", "", {}, "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="], + "@itk-wasm/morphological-contour-interpolation/itk-wasm/glob/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="], + "@lerna/create/rimraf/glob/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="], "@netlify/build-info/read-pkg/normalize-package-data/hosted-git-info/lru-cache": ["lru-cache@6.0.0", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA=="], @@ -9045,6 +9076,8 @@ "@docusaurus/core/update-notifier/boxen/wrap-ansi/strip-ansi/ansi-regex": ["ansi-regex@6.1.0", "", {}, "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA=="], + "@itk-wasm/morphological-contour-interpolation/itk-wasm/glob/minimatch/brace-expansion/balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], + "@lerna/create/rimraf/glob/minimatch/brace-expansion/balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], "@netlify/functions-utils/@netlify/zip-it-and-ship-it/glob/minimatch/brace-expansion/balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], diff --git a/common/reviews/api/core.api.md b/common/reviews/api/core.api.md index 8dbfbb5ef..8902b6d92 100644 --- a/common/reviews/api/core.api.md +++ b/common/reviews/api/core.api.md @@ -1194,6 +1194,9 @@ interface FlipDirection { flipVertical?: boolean; } +// @public (undocumented) +function fnv1aHash(str: string): string; + // @public (undocumented) class FrameRange { // (undocumented) @@ -3966,6 +3969,7 @@ declare namespace utilities { scaleRGBTransferFunction as scaleRgbTransferFunction, triggerEvent, imageIdToURI, + fnv1aHash, metadataProvider as calibratedPixelSpacingMetadataProvider, clamp, uuidv4, diff --git a/common/reviews/api/labelmap-interpolation.api.md b/common/reviews/api/labelmap-interpolation.api.md new file mode 100644 index 000000000..272d39e37 --- /dev/null +++ b/common/reviews/api/labelmap-interpolation.api.md @@ -0,0 +1,18 @@ +## API Report File for "@cornerstonejs/labelmap-interpolation" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +// @public (undocumented) +export function interpolate({ segmentationId, segmentIndex, configuration, }: { + segmentationId: string; + segmentIndex: number; + configuration?: MorphologicalContourInterpolationOptions & { + preview: boolean; + }; +}): Promise; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/common/reviews/api/tools.api.md b/common/reviews/api/tools.api.md index 546181ccb..e34fc2f3a 100644 --- a/common/reviews/api/tools.api.md +++ b/common/reviews/api/tools.api.md @@ -3172,15 +3172,6 @@ type InteractionTypes = 'Mouse' | 'Touch'; // @public (undocumented) function internalAddRepresentationData({ segmentationId, type, data, }: AddRepresentationData): void; -// @public (undocumented) -function interpolateLabelmap({ segmentationId, segmentIndex, configuration, }: { - segmentationId: string; - segmentIndex: number; - configuration?: MorphologicalContourInterpolationOptions & { - preview: boolean; - }; -}): Promise; - // @public (undocumented) type InterpolationROIAnnotation = ContourAnnotation & ContourSegmentationAnnotationData & { metadata: { @@ -5309,7 +5300,6 @@ declare namespace segmentation_2 { growCut, LabelmapMemo, IslandRemoval, - interpolateLabelmap, getOrCreateSegmentationVolume, getStatistics } diff --git a/packages/ai/src/ONNXSegmentationController.ts b/packages/ai/src/ONNXSegmentationController.ts index 8865993b2..3f45d324c 100644 --- a/packages/ai/src/ONNXSegmentationController.ts +++ b/packages/ai/src/ONNXSegmentationController.ts @@ -332,7 +332,7 @@ export default class ONNXSegmentationController { this.currentImage = null; this.viewport = viewport; - this.tool = new LabelmapBaseTool( + const brushInstance = new LabelmapBaseTool( {}, { configuration: { @@ -352,6 +352,8 @@ export default class ONNXSegmentationController { } ); + this.tool = brushInstance; + desiredImage.imageId = viewport.getCurrentImageId?.() || viewport.getViewReferenceId(); if (desiredImage.imageId.startsWith('volumeId:')) { diff --git a/packages/core/src/cache/cache.ts b/packages/core/src/cache/cache.ts index d20a42e3e..21576891c 100644 --- a/packages/core/src/cache/cache.ts +++ b/packages/core/src/cache/cache.ts @@ -16,6 +16,7 @@ import imageIdToURI from '../utilities/imageIdToURI'; import eventTarget from '../eventTarget'; import Events from '../enums/Events'; import { ImageQualityStatus } from '../enums'; +import fnv1aHash from '../utilities/fnv1aHash'; const ONE_GB = 1073741824; @@ -52,7 +53,7 @@ class Cache { let combinedHash = 0x811c9dc5; for (const id of imageURIs) { - const idHash = this._fnv1aHash(id); + const idHash = fnv1aHash(id); for (let i = 0; i < idHash.length; i++) { combinedHash ^= idHash.charCodeAt(i); combinedHash += @@ -1311,21 +1312,6 @@ class Cache { return cachedGeometry.geometryLoadObject; }; - - /** - * Helper function to generate a hash for a string using FNV-1a algorithm - * @param str - string to hash - * @returns the hashed string - */ - private _fnv1aHash(str: string): string { - let hash = 0x811c9dc5; - for (let i = 0; i < str.length; i++) { - hash ^= str.charCodeAt(i); - hash += - (hash << 1) + (hash << 4) + (hash << 7) + (hash << 8) + (hash << 24); - } - return (hash >>> 0).toString(36); - } } /** diff --git a/packages/core/src/utilities/fnv1aHash.ts b/packages/core/src/utilities/fnv1aHash.ts new file mode 100644 index 000000000..713787a14 --- /dev/null +++ b/packages/core/src/utilities/fnv1aHash.ts @@ -0,0 +1,14 @@ +/** + * Generates a hash for a string using FNV-1a algorithm + * @param str - string to hash + * @returns the hashed string in base 36 + */ +export default function fnv1aHash(str: string): string { + let hash = 0x811c9dc5; + for (let i = 0; i < str.length; i++) { + hash ^= str.charCodeAt(i); + hash += + (hash << 1) + (hash << 4) + (hash << 7) + (hash << 8) + (hash << 24); + } + return (hash >>> 0).toString(36); +} diff --git a/packages/core/src/utilities/index.ts b/packages/core/src/utilities/index.ts index 54304dffe..86db4f8cd 100644 --- a/packages/core/src/utilities/index.ts +++ b/packages/core/src/utilities/index.ts @@ -80,6 +80,7 @@ import * as color from './color'; import { deepEqual } from './deepEqual'; import type { IViewport } from '../types/IViewport'; import FrameRange from './FrameRange'; +import fnv1aHash from './fnv1aHash'; // solving the circular dependency issue import { _getViewportModality } from './getViewportModality'; @@ -108,6 +109,7 @@ export { scaleRgbTransferFunction, triggerEvent, imageIdToURI, + fnv1aHash, calibratedPixelSpacingMetadataProvider, clamp, uuidv4, diff --git a/packages/labelmap-interpolation/src/workers/interpolationWorker.js b/packages/labelmap-interpolation/src/workers/interpolationWorker.js index 8079197ff..7203472a2 100644 --- a/packages/labelmap-interpolation/src/workers/interpolationWorker.js +++ b/packages/labelmap-interpolation/src/workers/interpolationWorker.js @@ -5,33 +5,34 @@ import vtkDataArray from '@kitware/vtk.js/Common/Core/DataArray'; /** * Dynamically imports ITK WASM modules needed for labelmap interpolation * @param moduleId - The module ID to import ('itk-wasm' or '@itk-wasm/morphological-contour-interpolation') - * @param enableLabelmapInterpolation - Flag indicating if labelmap interpolation is enabled * @returns Promise that resolves to the imported module */ async function peerImport(moduleId) { - switch (moduleId) { - case 'itk-wasm': - return import('itk-wasm'); - case '@itk-wasm/morphological-contour-interpolation': - return import('@itk-wasm/morphological-contour-interpolation'); - default: - throw new Error(`Unknown module ID: ${moduleId}`); + try { + switch (moduleId) { + case 'itk-wasm': + return import('itk-wasm'); + case '@itk-wasm/morphological-contour-interpolation': + return import('@itk-wasm/morphological-contour-interpolation'); + default: + throw new Error(`Unknown module ID: ${moduleId}`); + } + } catch (error) { + console.warn(`Error importing ${moduleId}:`, error); + return null; } } const computeWorker = { getITKImage: async (args) => { - const { imageData, options, enableLabelmapInterpolation } = args; + const { imageData, options } = args; const { imageName, scalarData } = options; let Image, ImageType, IntTypes, FloatTypes, PixelTypes; try { - const itkModule = await peerImport( - 'itk-wasm', - enableLabelmapInterpolation - ); + const itkModule = await peerImport('itk-wasm'); if (!itkModule) { throw new Error('Module not found'); } @@ -87,16 +88,14 @@ const computeWorker = { return image; }, interpolateLabelmap: async (args) => { - const { segmentationInfo, configuration, enableLabelmapInterpolation } = - args; + const { segmentationInfo, configuration } = args; const { scalarData, dimensions, spacing, origin, direction } = segmentationInfo; let itkModule; try { itkModule = await peerImport( - '@itk-wasm/morphological-contour-interpolation', - enableLabelmapInterpolation + '@itk-wasm/morphological-contour-interpolation' ); if (!itkModule) { throw new Error('Module not found'); @@ -130,7 +129,6 @@ const computeWorker = { imageName: 'interpolation', scalarData: scalarData, }, - enableLabelmapInterpolation, }); if (!inputImage) { diff --git a/packages/tools/src/config.ts b/packages/tools/src/config.ts deleted file mode 100644 index 0291b0b25..000000000 --- a/packages/tools/src/config.ts +++ /dev/null @@ -1,17 +0,0 @@ -interface Configuration { - enablePolySeg: boolean; - enableLabelmapInterpolation: boolean; -} - -let config: Configuration = { - enablePolySeg: false, - enableLabelmapInterpolation: false, -}; - -export function getConfig(): Configuration { - return config; -} - -export function setConfig(newConfig: Configuration) { - config = newConfig; -} diff --git a/packages/tools/src/init.ts b/packages/tools/src/init.ts index a5b66e708..ecd942684 100644 --- a/packages/tools/src/init.ts +++ b/packages/tools/src/init.ts @@ -16,7 +16,7 @@ import { annotationInterpolationEventDispatcher } from './eventDispatchers'; import * as ToolGroupManager from './store/ToolGroupManager'; import { defaultSegmentationStateManager } from './stateManagement/segmentation/SegmentationStateManager'; import segmentationRepresentationModifiedListener from './eventListeners/segmentation/segmentationRepresentationModifiedListener'; -import { setConfig } from './config'; + let csToolsInitialized = false; /** @@ -25,13 +25,11 @@ let csToolsInitialized = false; * @param defaultConfiguration - A configuration object that will be used to * initialize the tool. */ -export function init(defaultConfiguration): void { +export function init(defaultConfiguration = {}): void { if (csToolsInitialized) { return; } - setConfig(defaultConfiguration); - _addCornerstoneEventListeners(); _addCornerstoneToolsEventListeners(); diff --git a/packages/tools/src/stateManagement/segmentation/polySeg/registerPolySegWorker.ts b/packages/tools/src/stateManagement/segmentation/polySeg/registerPolySegWorker.ts index 5bfaf0d94..531871e44 100644 --- a/packages/tools/src/stateManagement/segmentation/polySeg/registerPolySegWorker.ts +++ b/packages/tools/src/stateManagement/segmentation/polySeg/registerPolySegWorker.ts @@ -1,5 +1,4 @@ import { getWebWorkerManager } from '@cornerstonejs/core'; -import { getConfig } from '../../../config'; let registered = false; @@ -30,7 +29,6 @@ export function registerPolySegWorker() { enabled: true, idleTimeThreshold: 2000, }, - enablePolySeg: getConfig().enablePolySeg, }; workerManager.registerWorker('polySeg', workerFn, options); diff --git a/packages/tools/src/tools/segmentation/strategies/compositions/preview.ts b/packages/tools/src/tools/segmentation/strategies/compositions/preview.ts index 97acf7c06..8c36fd84e 100644 --- a/packages/tools/src/tools/segmentation/strategies/compositions/preview.ts +++ b/packages/tools/src/tools/segmentation/strategies/compositions/preview.ts @@ -122,11 +122,9 @@ export default { segmentationId, preview, } = operationData || {}; - if (previewSegmentIndex === undefined) { return; } - const segmentIndex = preview?.segmentIndex ?? operationData.segmentIndex; if (!previewVoxelManager || previewVoxelManager.modifiedSlices.size === 0) { return; diff --git a/packages/tools/src/utilities/registerComputeWorker.ts b/packages/tools/src/utilities/registerComputeWorker.ts index ab36fa97c..fa3f447ee 100644 --- a/packages/tools/src/utilities/registerComputeWorker.ts +++ b/packages/tools/src/utilities/registerComputeWorker.ts @@ -1,5 +1,4 @@ import { getWebWorkerManager } from '@cornerstonejs/core'; -import { getConfig } from '../config'; let registered = false; export function registerComputeWorker() { @@ -29,7 +28,6 @@ export function registerComputeWorker() { enabled: true, idleTimeThreshold: 2000, }, - enableLabelmapInterpolation: getConfig().enableLabelmapInterpolation, }; workerManager.registerWorker('compute', workerFn, options); diff --git a/packages/tools/src/workers/polySegConverters.js b/packages/tools/src/workers/polySegConverters.js index 361f2e4a0..cabadf3e9 100644 --- a/packages/tools/src/workers/polySegConverters.js +++ b/packages/tools/src/workers/polySegConverters.js @@ -16,27 +16,19 @@ import { import { isPlaneIntersectingAABB } from '../utilities/planar'; import { checkStandardBasis, rotatePoints } from '../geometricSurfaceUtils'; -async function peerImport(moduleId, enablePolySeg = false) { - if (moduleId === '@icr/polyseg-wasm') { - try { - if (enablePolySeg) { - if (typeof __EXAMPLE_RUNNING__ !== 'undefined' && __EXAMPLE_RUNNING__) { - return import('@icr/polyseg-wasm'); - } else { - return import(/* webpackIgnore: true */ '@icr/polyseg-wasm'); - } - } else { - const moduleName = '@icr/polyseg-wasm'; - return import( - /* webpackChunkName: "icr-polyseg-wasm" */ - /* webpackIgnore: true */ - `${moduleName}` - ); +async function peerImport(moduleId) { + try { + if (moduleId === '@icr/polyseg-wasm') { + try { + return import('@icr/polyseg-wasm'); + } catch (error) { + console.warn('Error importing @icr/polyseg-wasm:', error); + return null; } - } catch (error) { - console.warn('Error importing @icr/polyseg-wasm:', error); - return null; } + } catch (error) { + console.warn('Error in peerImport:', error); + return null; } } @@ -64,11 +56,10 @@ const polySegConverters = { /** * This method initializes the polySeg instance and sets it to this.polySeg */ - async initializePolySeg(progressCallback, enablePolySeg = false) { + async initializePolySeg(progressCallback) { let ICRPolySeg; try { - ICRPolySeg = (await peerImport('@icr/polyseg-wasm', enablePolySeg)) - .default; + ICRPolySeg = (await peerImport('@icr/polyseg-wasm')).default; } catch (error) { console.error(error); console.debug( @@ -110,9 +101,9 @@ const polySegConverters = { * @returns {Promise} - A promise that resolves to the converted surface. */ async convertContourToSurface(args, ...callbacks) { - const { polylines, numPointsArray, enablePolySeg } = args; + const { polylines, numPointsArray } = args; const [progressCallback] = callbacks; - await this.initializePolySeg(progressCallback, enablePolySeg); + await this.initializePolySeg(progressCallback); const results = await this.polySeg.instance.convertContourRoiToSurface( polylines, numPointsArray @@ -134,7 +125,7 @@ const polySegConverters = { */ async convertLabelmapToSurface(args, ...callbacks) { const [progressCallback] = callbacks; - await this.initializePolySeg(progressCallback, args.enablePolySeg); + await this.initializePolySeg(progressCallback); const results = this.polySeg.instance.convertLabelmapToSurface( args.scalarData, @@ -171,7 +162,7 @@ const polySegConverters = { */ async convertContourToVolumeLabelmap(args, ...callbacks) { const [progressCallback] = callbacks; - await this.initializePolySeg(progressCallback, args.enablePolySeg); + await this.initializePolySeg(progressCallback); const { segmentIndices, @@ -280,7 +271,7 @@ const polySegConverters = { */ async convertContourToStackLabelmap(args, ...callbacks) { const [progressCallback] = callbacks; - await this.initializePolySeg(progressCallback, args.enablePolySeg); + await this.initializePolySeg(progressCallback); const { segmentationsInfo, annotationUIDsInSegmentMap, segmentIndices } = args; @@ -405,7 +396,7 @@ const polySegConverters = { */ async convertSurfaceToVolumeLabelmap(args, ...callbacks) { const [progressCallback] = callbacks; - await this.initializePolySeg(progressCallback, args.enablePolySeg); + await this.initializePolySeg(progressCallback); const results = this.polySeg.instance.convertSurfaceToLabelmap( args.points, @@ -427,7 +418,7 @@ const polySegConverters = { */ async convertSurfacesToVolumeLabelmap(args, ...callbacks) { const [progressCallback] = callbacks; - await this.initializePolySeg(progressCallback, args.enablePolySeg); + await this.initializePolySeg(progressCallback); const { segmentsInfo } = args; diff --git a/utils/ExampleRunner/template-config.js b/utils/ExampleRunner/template-config.js index 4a211e5ae..d39a38299 100644 --- a/utils/ExampleRunner/template-config.js +++ b/utils/ExampleRunner/template-config.js @@ -31,7 +31,6 @@ module.exports = { }), new rspack.DefinePlugin({ __BASE_PATH__: "''", - __EXAMPLE_RUNNING__: true, }), new rspack.CopyRspackPlugin({ patterns: [ diff --git a/utils/demo/helpers/initDemo.js b/utils/demo/helpers/initDemo.js index 882fdeb0b..73c4ad707 100644 --- a/utils/demo/helpers/initDemo.js +++ b/utils/demo/helpers/initDemo.js @@ -27,10 +27,7 @@ export default async function initDemo(config) { peerImport, ...(config?.core ? config.core : {}), }); - await csToolsInit({ - enablePolySeg: true, - enableLabelmapInterpolation: true, - }); + await csToolsInit(); // for testings, you don't need any of these volumeLoader.registerVolumeLoader('fakeVolumeLoader', fakeVolumeLoader);