From e1918c91b81a08d10a415962f6cf9d5724b30363 Mon Sep 17 00:00:00 2001 From: ohif-bot Date: Tue, 28 May 2024 15:41:24 +0000 Subject: [PATCH 01/14] chore(version): version.json [skip ci] --- commit.txt | 2 +- packages/adapters/package.json | 6 +++--- packages/dicomImageLoader/package.json | 2 +- packages/docs/package.json | 12 ++++++------ packages/nifti-volume-loader/package.json | 2 +- packages/streaming-image-volume-loader/package.json | 2 +- packages/tools/package.json | 2 +- version.json | 4 ++-- version.txt | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/commit.txt b/commit.txt index 1885f6ec08..2eac861cc2 100644 --- a/commit.txt +++ b/commit.txt @@ -1 +1 @@ -8f4ff3e3b836ca4d5817f90ac7349232635cdac1 \ No newline at end of file +03a233525a67ac9bc6bc9a6d144334e67756f11f \ No newline at end of file diff --git a/packages/adapters/package.json b/packages/adapters/package.json index 0dce35dd34..d0217b48e1 100644 --- a/packages/adapters/package.json +++ b/packages/adapters/package.json @@ -42,7 +42,7 @@ "homepage": "https://github.com/cornerstonejs/cornerstone3D/blob/main/packages/adapters/README.md", "dependencies": { "@babel/runtime-corejs2": "^7.17.8", - "@cornerstonejs/tools": "^1.74.8", + "@cornerstonejs/tools": "^1.75.0", "buffer": "^6.0.3", "dcmjs": "^0.29.8", "gl-matrix": "^3.4.3", @@ -50,7 +50,7 @@ "ndarray": "^1.0.19" }, "devDependencies": { - "@cornerstonejs/core": "^1.74.8", - "@cornerstonejs/streaming-image-volume-loader": "^1.74.8" + "@cornerstonejs/core": "^1.75.0", + "@cornerstonejs/streaming-image-volume-loader": "^1.75.0" } } diff --git a/packages/dicomImageLoader/package.json b/packages/dicomImageLoader/package.json index a1c92686b5..3ed3c1cb51 100644 --- a/packages/dicomImageLoader/package.json +++ b/packages/dicomImageLoader/package.json @@ -66,7 +66,7 @@ "@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2", "@cornerstonejs/codec-openjpeg": "^1.2.2", "@cornerstonejs/codec-openjph": "^2.4.5", - "@cornerstonejs/core": "^1.74.8", + "@cornerstonejs/core": "^1.75.0", "dicom-parser": "^1.8.9", "pako": "^2.0.4", "uuid": "^9.0.0" diff --git a/packages/docs/package.json b/packages/docs/package.json index 53b4110e75..19e40b8753 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -29,12 +29,12 @@ "write-heading-ids": "docusaurus write-heading-ids" }, "dependencies": { - "@cornerstonejs/adapters": "^1.74.8", - "@cornerstonejs/core": "^1.74.8", - "@cornerstonejs/dicom-image-loader": "^1.74.8", - "@cornerstonejs/nifti-volume-loader": "^1.74.8", - "@cornerstonejs/streaming-image-volume-loader": "^1.74.8", - "@cornerstonejs/tools": "^1.74.8", + "@cornerstonejs/adapters": "^1.75.0", + "@cornerstonejs/core": "^1.75.0", + "@cornerstonejs/dicom-image-loader": "^1.75.0", + "@cornerstonejs/nifti-volume-loader": "^1.75.0", + "@cornerstonejs/streaming-image-volume-loader": "^1.75.0", + "@cornerstonejs/tools": "^1.75.0", "@docusaurus/core": "2.3.1", "@docusaurus/module-type-aliases": "2.3.1", "@docusaurus/plugin-google-gtag": "2.3.1", diff --git a/packages/nifti-volume-loader/package.json b/packages/nifti-volume-loader/package.json index 044183fb69..d08d4701e2 100644 --- a/packages/nifti-volume-loader/package.json +++ b/packages/nifti-volume-loader/package.json @@ -29,7 +29,7 @@ "webpack:watch": "webpack --mode development --progress --watch --config ./.webpack/webpack.dev.js" }, "dependencies": { - "@cornerstonejs/core": "^1.74.8", + "@cornerstonejs/core": "^1.75.0", "nifti-reader-js": "^0.6.6" }, "contributors": [ diff --git a/packages/streaming-image-volume-loader/package.json b/packages/streaming-image-volume-loader/package.json index 78a712a0cc..b8297e1e08 100644 --- a/packages/streaming-image-volume-loader/package.json +++ b/packages/streaming-image-volume-loader/package.json @@ -29,7 +29,7 @@ "webpack:watch": "webpack --mode development --progress --watch --config ./.webpack/webpack.dev.js" }, "dependencies": { - "@cornerstonejs/core": "^1.74.8", + "@cornerstonejs/core": "^1.75.0", "comlink": "^4.4.1" }, "contributors": [ diff --git a/packages/tools/package.json b/packages/tools/package.json index dbc336bdc6..b15937fa00 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -29,7 +29,7 @@ "webpack:watch": "webpack --mode development --progress --watch --config ./.webpack/webpack.dev.js" }, "dependencies": { - "@cornerstonejs/core": "^1.74.8", + "@cornerstonejs/core": "^1.75.0", "@icr/polyseg-wasm": "0.4.0", "@types/offscreencanvas": "2019.7.3", "comlink": "^4.4.1", diff --git a/version.json b/version.json index 3ba44a1557..877af922d2 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "version": "1.74.8", - "commit": "8f4ff3e3b836ca4d5817f90ac7349232635cdac1" + "version": "1.75.0", + "commit": "03a233525a67ac9bc6bc9a6d144334e67756f11f" } \ No newline at end of file diff --git a/version.txt b/version.txt index 56014ff577..5c8c298b55 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.74.8 \ No newline at end of file +1.75.0 \ No newline at end of file From 76cc2c23137bd1aceb0d2e5939f42a8c8e9dbf00 Mon Sep 17 00:00:00 2001 From: ohif-bot Date: Tue, 28 May 2024 15:41:41 +0000 Subject: [PATCH 02/14] chore(version): Update package versions [skip ci] --- CHANGELOG.md | 6 ++++++ lerna.json | 2 +- packages/adapters/CHANGELOG.md | 4 ++++ packages/adapters/package.json | 2 +- packages/core/CHANGELOG.md | 6 ++++++ packages/core/package.json | 2 +- packages/dicomImageLoader/CHANGELOG.md | 4 ++++ packages/dicomImageLoader/package.json | 2 +- packages/docs/CHANGELOG.md | 4 ++++ packages/docs/package.json | 2 +- packages/nifti-volume-loader/CHANGELOG.md | 6 ++++++ packages/nifti-volume-loader/package.json | 2 +- packages/streaming-image-volume-loader/CHANGELOG.md | 4 ++++ packages/streaming-image-volume-loader/package.json | 2 +- packages/tools/CHANGELOG.md | 4 ++++ packages/tools/package.json | 2 +- 16 files changed, 46 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e3c86bb81..9bf3ce7ffb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.75.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.74.8...v1.75.0) (2024-05-28) + +### Features + +- **nifti:** NIFTI data type enhancement ([#1219](https://github.com/cornerstonejs/cornerstone3D/issues/1219)) ([03a2335](https://github.com/cornerstonejs/cornerstone3D/commit/03a233525a67ac9bc6bc9a6d144334e67756f11f)) + ## [1.74.8](https://github.com/cornerstonejs/cornerstone3D/compare/v1.74.7...v1.74.8) (2024-05-24) ### Bug Fixes diff --git a/lerna.json b/lerna.json index c1bda37dd3..069fac835e 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.74.8", + "version": "1.75.0", "packages": [ "packages/adapters", "packages/core", diff --git a/packages/adapters/CHANGELOG.md b/packages/adapters/CHANGELOG.md index 969117e73c..008e262ee3 100644 --- a/packages/adapters/CHANGELOG.md +++ b/packages/adapters/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.75.0](https://github.com/dcmjs-org/dcmjs/compare/v1.74.8...v1.75.0) (2024-05-28) + +**Note:** Version bump only for package @cornerstonejs/adapters + ## [1.74.8](https://github.com/dcmjs-org/dcmjs/compare/v1.74.7...v1.74.8) (2024-05-24) **Note:** Version bump only for package @cornerstonejs/adapters diff --git a/packages/adapters/package.json b/packages/adapters/package.json index d0217b48e1..25ee1ee29f 100644 --- a/packages/adapters/package.json +++ b/packages/adapters/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/adapters", - "version": "1.74.8", + "version": "1.75.0", "description": "Adapters for Cornerstone3D to/from formats including DICOM SR and others", "src": "src/index.ts", "main": "./dist/@cornerstonejs/adapters.es.js", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 154ded8c56..88f83bc03b 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.75.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.74.8...v1.75.0) (2024-05-28) + +### Features + +- **nifti:** NIFTI data type enhancement ([#1219](https://github.com/cornerstonejs/cornerstone3D/issues/1219)) ([03a2335](https://github.com/cornerstonejs/cornerstone3D/commit/03a233525a67ac9bc6bc9a6d144334e67756f11f)) + ## [1.74.8](https://github.com/cornerstonejs/cornerstone3D/compare/v1.74.7...v1.74.8) (2024-05-24) **Note:** Version bump only for package @cornerstonejs/core diff --git a/packages/core/package.json b/packages/core/package.json index 802c4ebaf7..42babc17c6 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/core", - "version": "1.74.8", + "version": "1.75.0", "description": "", "main": "src/index.ts", "types": "dist/types/index.d.ts", diff --git a/packages/dicomImageLoader/CHANGELOG.md b/packages/dicomImageLoader/CHANGELOG.md index f2d629cc14..65e0363bbf 100644 --- a/packages/dicomImageLoader/CHANGELOG.md +++ b/packages/dicomImageLoader/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.75.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.74.8...v1.75.0) (2024-05-28) + +**Note:** Version bump only for package @cornerstonejs/dicom-image-loader + ## [1.74.8](https://github.com/cornerstonejs/cornerstone3D/compare/v1.74.7...v1.74.8) (2024-05-24) **Note:** Version bump only for package @cornerstonejs/dicom-image-loader diff --git a/packages/dicomImageLoader/package.json b/packages/dicomImageLoader/package.json index 3ed3c1cb51..44fb740ffa 100644 --- a/packages/dicomImageLoader/package.json +++ b/packages/dicomImageLoader/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/dicom-image-loader", - "version": "1.74.8", + "version": "1.75.0", "description": "Cornerstone Image Loader for DICOM WADO-URI and WADO-RS and Local file", "keywords": [ "DICOM", diff --git a/packages/docs/CHANGELOG.md b/packages/docs/CHANGELOG.md index 112e9582d8..964600bf66 100644 --- a/packages/docs/CHANGELOG.md +++ b/packages/docs/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.75.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.74.8...v1.75.0) (2024-05-28) + +**Note:** Version bump only for package docs + ## [1.74.8](https://github.com/cornerstonejs/cornerstone3D/compare/v1.74.7...v1.74.8) (2024-05-24) **Note:** Version bump only for package docs diff --git a/packages/docs/package.json b/packages/docs/package.json index 19e40b8753..f3ecdfb65d 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -1,6 +1,6 @@ { "name": "docs", - "version": "1.74.8", + "version": "1.75.0", "private": true, "repository": "https://github.com/cornerstonejs/cornerstone3D", "scripts": { diff --git a/packages/nifti-volume-loader/CHANGELOG.md b/packages/nifti-volume-loader/CHANGELOG.md index 4b4bf0f7d7..830c7147f1 100644 --- a/packages/nifti-volume-loader/CHANGELOG.md +++ b/packages/nifti-volume-loader/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.75.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.74.8...v1.75.0) (2024-05-28) + +### Features + +- **nifti:** NIFTI data type enhancement ([#1219](https://github.com/cornerstonejs/cornerstone3D/issues/1219)) ([03a2335](https://github.com/cornerstonejs/cornerstone3D/commit/03a233525a67ac9bc6bc9a6d144334e67756f11f)) + ## [1.74.8](https://github.com/cornerstonejs/cornerstone3D/compare/v1.74.7...v1.74.8) (2024-05-24) **Note:** Version bump only for package @cornerstonejs/nifti-volume-loader diff --git a/packages/nifti-volume-loader/package.json b/packages/nifti-volume-loader/package.json index d08d4701e2..1535617586 100644 --- a/packages/nifti-volume-loader/package.json +++ b/packages/nifti-volume-loader/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/nifti-volume-loader", - "version": "1.74.8", + "version": "1.75.0", "description": "", "main": "dist/umd/index.js", "types": "dist/esm/index.d.ts", diff --git a/packages/streaming-image-volume-loader/CHANGELOG.md b/packages/streaming-image-volume-loader/CHANGELOG.md index bca2b49e49..70f7ca7786 100644 --- a/packages/streaming-image-volume-loader/CHANGELOG.md +++ b/packages/streaming-image-volume-loader/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.75.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.74.8...v1.75.0) (2024-05-28) + +**Note:** Version bump only for package @cornerstonejs/streaming-image-volume-loader + ## [1.74.8](https://github.com/cornerstonejs/cornerstone3D/compare/v1.74.7...v1.74.8) (2024-05-24) **Note:** Version bump only for package @cornerstonejs/streaming-image-volume-loader diff --git a/packages/streaming-image-volume-loader/package.json b/packages/streaming-image-volume-loader/package.json index b8297e1e08..e3dfea0019 100644 --- a/packages/streaming-image-volume-loader/package.json +++ b/packages/streaming-image-volume-loader/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/streaming-image-volume-loader", - "version": "1.74.8", + "version": "1.75.0", "description": "", "main": "src/index.ts", "types": "dist/esm/index.d.ts", diff --git a/packages/tools/CHANGELOG.md b/packages/tools/CHANGELOG.md index 61a1db264a..f0a88d2871 100644 --- a/packages/tools/CHANGELOG.md +++ b/packages/tools/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.75.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.74.8...v1.75.0) (2024-05-28) + +**Note:** Version bump only for package @cornerstonejs/tools + ## [1.74.8](https://github.com/cornerstonejs/cornerstone3D/compare/v1.74.7...v1.74.8) (2024-05-24) ### Bug Fixes diff --git a/packages/tools/package.json b/packages/tools/package.json index b15937fa00..1290ba6f81 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/tools", - "version": "1.74.8", + "version": "1.75.0", "description": "Cornerstone3D Tools", "main": "src/index.ts", "types": "dist/types/index.d.ts", From 2fc22bcd1c0cac22b88e964699d55c51bd83283e Mon Sep 17 00:00:00 2001 From: rodrigobasilio2022 <114958722+rodrigobasilio2022@users.noreply.github.com> Date: Tue, 28 May 2024 12:49:05 -0300 Subject: [PATCH 03/14] fix(color): Fix RGB inconsistencies (#829) * Fix RGB inconsistencies * Add color space conversion check * refactor(comments) : refactor comments in code * refactor(code): change requirements YBR_FULL_422 * fix(color): fix bug in color example * fix bug in image loader example * Refactoring function * fix: correct typo in color space conversion function * refactor: Refactor color space conversion functions --------- Co-authored-by: Alireza --- .../examples/dicomImageLoaderWADOURI/index.ts | 4 + .../convertPALETTECOLOR.ts | 129 +++++++++--------- .../convertRGBColorByPixel.ts | 6 +- .../convertRGBColorByPlane.ts | 6 +- .../convertYBRFull422ByPixel.ts | 6 +- .../convertYBRFullByPixel.ts | 6 +- .../convertYBRFullByPlane.ts | 6 +- .../src/imageLoader/createImage.ts | 32 ++--- .../imageLoader/isColorConversionRequired.ts | 33 +++++ 9 files changed, 136 insertions(+), 92 deletions(-) create mode 100644 packages/dicomImageLoader/src/imageLoader/isColorConversionRequired.ts diff --git a/packages/dicomImageLoader/examples/dicomImageLoaderWADOURI/index.ts b/packages/dicomImageLoader/examples/dicomImageLoaderWADOURI/index.ts index 616fab3b4e..9526482aa8 100644 --- a/packages/dicomImageLoader/examples/dicomImageLoaderWADOURI/index.ts +++ b/packages/dicomImageLoader/examples/dicomImageLoaderWADOURI/index.ts @@ -25,6 +25,8 @@ import { setTitleAndDescription, } from '../../../../utils/demo/helpers'; +import { cache } from '@cornerstonejs/core'; + // This is for debugging purposes console.warn( 'Click on index.ts to open source code for this example --------->' @@ -45,6 +47,7 @@ addToggleButtonToToolbar({ defaultToggle: false, onClick(toggle) { toggle ? setUseCPURendering(true) : setUseCPURendering(false); + cache.purgeCache(); }, }); @@ -53,6 +56,7 @@ addToggleButtonToToolbar({ defaultToggle: false, onClick(toggle) { toggle ? setPreferSizeOverAccuracy(true) : setPreferSizeOverAccuracy(false); + cache.purgeCache(); }, }); diff --git a/packages/dicomImageLoader/src/imageLoader/colorSpaceConverters/convertPALETTECOLOR.ts b/packages/dicomImageLoader/src/imageLoader/colorSpaceConverters/convertPALETTECOLOR.ts index 0b748f7fbb..845bf99018 100644 --- a/packages/dicomImageLoader/src/imageLoader/colorSpaceConverters/convertPALETTECOLOR.ts +++ b/packages/dicomImageLoader/src/imageLoader/colorSpaceConverters/convertPALETTECOLOR.ts @@ -13,6 +13,28 @@ function convertLUTto8Bit(lut: number[], shift: number) { return cleanedLUT; } +function fetchPaletteData(imageFrame, color, fallback) { + const data = imageFrame[`${color}PaletteColorLookupTableData`]; + if (data) { + return Promise.resolve(data); + } + + const result = external.cornerstone.metaData.get( + 'imagePixelModule', + imageFrame.imageId + ); + + if (result && typeof result.then === 'function') { + return result.then((module) => + module ? module[`${color}PaletteColorLookupTableData`] : fallback + ); + } else { + return Promise.resolve( + result ? result[`${color}PaletteColorLookupTableData`] : fallback + ); + } +} + /** * Convert pixel data with PALETTE COLOR Photometric Interpretation to RGBA * @@ -27,55 +49,51 @@ export default function ( ): void { const numPixels = imageFrame.columns * imageFrame.rows; const pixelData = imageFrame.pixelData; - let rData = imageFrame.redPaletteColorLookupTableData; - - if (!rData) { - // request from metadata provider since it might grab it from bulkdataURI - rData = external.cornerstone.metaData.get( - 'imagePixelModule', - imageFrame.imageId - )?.redPaletteColorLookupTableData; - } - - let gData = imageFrame.greenPaletteColorLookupTableData; - - if (!gData) { - gData = external.cornerstone.metaData.get( - 'imagePixelModule', - imageFrame.imageId - )?.greenPaletteColorLookupTableData; - } - - let bData = imageFrame.bluePaletteColorLookupTableData; - - if (!bData) { - bData = external.cornerstone.metaData.get( - 'imagePixelModule', - imageFrame.imageId - )?.bluePaletteColorLookupTableData; - } - if (!rData || !gData || !bData) { - throw new Error( - 'The image does not have a complete color palette. R, G, and B palette data are required.' - ); - } - - const len = imageFrame.redPaletteColorLookupTableData.length; - - let palIndex = 0; - - let bufferIndex = 0; + Promise.all([ + fetchPaletteData(imageFrame, 'red', null), + fetchPaletteData(imageFrame, 'green', null), + fetchPaletteData(imageFrame, 'blue', null), + ]).then(([rData, gData, bData]) => { + if (!rData || !gData || !bData) { + throw new Error( + 'The image does not have a complete color palette. R, G, and B palette data are required.' + ); + } - const start = imageFrame.redPaletteColorLookupTableDescriptor[1]; - const shift = - imageFrame.redPaletteColorLookupTableDescriptor[2] === 8 ? 0 : 8; + const len = rData.length; + let palIndex = 0; + let bufferIndex = 0; + + const start = imageFrame.redPaletteColorLookupTableDescriptor[1]; + const shift = + imageFrame.redPaletteColorLookupTableDescriptor[2] === 8 ? 0 : 8; + + const rDataCleaned = convertLUTto8Bit(rData, shift); + const gDataCleaned = convertLUTto8Bit(gData, shift); + const bDataCleaned = convertLUTto8Bit(bData, shift); + + if (useRGBA) { + for (let i = 0; i < numPixels; ++i) { + let value = pixelData[palIndex++]; + + if (value < start) { + value = 0; + } else if (value > start + len - 1) { + value = len - 1; + } else { + value -= start; + } + + colorBuffer[bufferIndex++] = rDataCleaned[value]; + colorBuffer[bufferIndex++] = gDataCleaned[value]; + colorBuffer[bufferIndex++] = bDataCleaned[value]; + colorBuffer[bufferIndex++] = 255; + } - const rDataCleaned = convertLUTto8Bit(rData, shift); - const gDataCleaned = convertLUTto8Bit(gData, shift); - const bDataCleaned = convertLUTto8Bit(bData, shift); + return; + } - if (useRGBA) { for (let i = 0; i < numPixels; ++i) { let value = pixelData[palIndex++]; @@ -90,25 +108,6 @@ export default function ( colorBuffer[bufferIndex++] = rDataCleaned[value]; colorBuffer[bufferIndex++] = gDataCleaned[value]; colorBuffer[bufferIndex++] = bDataCleaned[value]; - colorBuffer[bufferIndex++] = 255; } - - return; - } - - for (let i = 0; i < numPixels; ++i) { - let value = pixelData[palIndex++]; - - if (value < start) { - value = 0; - } else if (value > start + len - 1) { - value = len - 1; - } else { - value -= start; - } - - colorBuffer[bufferIndex++] = rDataCleaned[value]; - colorBuffer[bufferIndex++] = gDataCleaned[value]; - colorBuffer[bufferIndex++] = bDataCleaned[value]; - } + }); } diff --git a/packages/dicomImageLoader/src/imageLoader/colorSpaceConverters/convertRGBColorByPixel.ts b/packages/dicomImageLoader/src/imageLoader/colorSpaceConverters/convertRGBColorByPixel.ts index 0b149aef1a..33abef352c 100644 --- a/packages/dicomImageLoader/src/imageLoader/colorSpaceConverters/convertRGBColorByPixel.ts +++ b/packages/dicomImageLoader/src/imageLoader/colorSpaceConverters/convertRGBColorByPixel.ts @@ -6,10 +6,12 @@ export default function ( useRGBA: boolean ): void { if (imageFrame === undefined) { - throw new Error('decodeRGB: rgbBuffer must not be undefined'); + throw new Error('decodeRGB: rgbBuffer must be defined'); } if (imageFrame.length % 3 !== 0) { - throw new Error('decodeRGB: rgbBuffer length must be divisible by 3'); + throw new Error( + `decodeRGB: rgbBuffer length ${imageFrame.length} must be divisible by 3` + ); } const numPixels = imageFrame.length / 3; diff --git a/packages/dicomImageLoader/src/imageLoader/colorSpaceConverters/convertRGBColorByPlane.ts b/packages/dicomImageLoader/src/imageLoader/colorSpaceConverters/convertRGBColorByPlane.ts index 17e0cc07a4..524cec2794 100644 --- a/packages/dicomImageLoader/src/imageLoader/colorSpaceConverters/convertRGBColorByPlane.ts +++ b/packages/dicomImageLoader/src/imageLoader/colorSpaceConverters/convertRGBColorByPlane.ts @@ -6,10 +6,12 @@ export default function ( useRGBA: boolean ): void { if (imageFrame === undefined) { - throw new Error('decodeRGB: rgbBuffer must not be undefined'); + throw new Error('decodeRGB: rgbBuffer must be defined'); } if (imageFrame.length % 3 !== 0) { - throw new Error('decodeRGB: rgbBuffer length must be divisible by 3'); + throw new Error( + `decodeRGB: rgbBuffer length ${imageFrame.length} must be divisible by 3` + ); } const numPixels = imageFrame.length / 3; diff --git a/packages/dicomImageLoader/src/imageLoader/colorSpaceConverters/convertYBRFull422ByPixel.ts b/packages/dicomImageLoader/src/imageLoader/colorSpaceConverters/convertYBRFull422ByPixel.ts index 4b65468a5c..9a30627e92 100644 --- a/packages/dicomImageLoader/src/imageLoader/colorSpaceConverters/convertYBRFull422ByPixel.ts +++ b/packages/dicomImageLoader/src/imageLoader/colorSpaceConverters/convertYBRFull422ByPixel.ts @@ -6,10 +6,12 @@ export default function ( useRGBA: boolean ): void { if (imageFrame === undefined) { - throw new Error('decodeRGB: ybrBuffer must not be undefined'); + throw new Error('convertYBRFull422ByPixel: ybrBuffer must be defined'); } if (imageFrame.length % 2 !== 0) { - throw new Error('decodeRGB: ybrBuffer length must be divisble by 2'); + throw new Error( + `convertYBRFull422ByPixel: ybrBuffer length ${imageFrame.length} must be divisible by 2` + ); } const numPixels = imageFrame.length / 2; diff --git a/packages/dicomImageLoader/src/imageLoader/colorSpaceConverters/convertYBRFullByPixel.ts b/packages/dicomImageLoader/src/imageLoader/colorSpaceConverters/convertYBRFullByPixel.ts index 2ca53110c5..483714c28f 100644 --- a/packages/dicomImageLoader/src/imageLoader/colorSpaceConverters/convertYBRFullByPixel.ts +++ b/packages/dicomImageLoader/src/imageLoader/colorSpaceConverters/convertYBRFullByPixel.ts @@ -6,10 +6,12 @@ export default function ( useRGBA: boolean ): void { if (imageFrame === undefined) { - throw new Error('decodeRGB: ybrBuffer must not be undefined'); + throw new Error('convertYBRFullByPixel: ybrBuffer must be defined'); } if (imageFrame.length % 3 !== 0) { - throw new Error('decodeRGB: ybrBuffer length must be divisble by 3'); + throw new Error( + `convertYBRFullByPixel: ybrBuffer length ${imageFrame.length} must be divisible by 3` + ); } const numPixels = imageFrame.length / 3; diff --git a/packages/dicomImageLoader/src/imageLoader/colorSpaceConverters/convertYBRFullByPlane.ts b/packages/dicomImageLoader/src/imageLoader/colorSpaceConverters/convertYBRFullByPlane.ts index 389b6c73ca..c32f567dd3 100644 --- a/packages/dicomImageLoader/src/imageLoader/colorSpaceConverters/convertYBRFullByPlane.ts +++ b/packages/dicomImageLoader/src/imageLoader/colorSpaceConverters/convertYBRFullByPlane.ts @@ -6,10 +6,12 @@ export default function ( useRGBA: boolean ): void { if (imageFrame === undefined) { - throw new Error('decodeRGB: ybrBuffer must not be undefined'); + throw new Error('convertYBRFullByPlane: ybrBuffer must be defined'); } if (imageFrame.length % 3 !== 0) { - throw new Error('decodeRGB: ybrBuffer length must be divisble by 3'); + throw new Error( + `convertYBRFullByPlane: ybrBuffer length ${imageFrame.length} must be divisible by 3` + ); } const numPixels = imageFrame.length / 3; diff --git a/packages/dicomImageLoader/src/imageLoader/createImage.ts b/packages/dicomImageLoader/src/imageLoader/createImage.ts index 1c4cecd162..0895651add 100644 --- a/packages/dicomImageLoader/src/imageLoader/createImage.ts +++ b/packages/dicomImageLoader/src/imageLoader/createImage.ts @@ -11,27 +11,13 @@ import { PixelDataTypedArray, } from '../types'; import convertColorSpace from './convertColorSpace'; +import isColorConversionRequired from './isColorConversionRequired'; import decodeImageFrame from './decodeImageFrame'; import getImageFrame from './getImageFrame'; import getScalingParameters from './getScalingParameters'; import { getOptions } from './internal/options'; import isColorImageFn from '../shared/isColorImage'; -/** - * When using typical decompressors to decompress compressed color images, - * the resulting output is in RGB or RGBA format. Additionally, these images - * are in planar configuration 0, meaning they are arranged by plane rather - * than by color. Consequently, the images only require a transformation from - * RGBA to RGB without needing to use the photometric interpretation to convert - * to RGB or adjust the planar configuration. - */ -const TRANSFER_SYNTAX_USING_PHOTOMETRIC_COLOR = { - '1.2.840.10008.1.2.1': 'application/octet-stream', - '1.2.840.10008.1.2': 'application/octet-stream', - '1.2.840.10008.1.2.2': 'application/octet-stream', - '1.2.840.10008.1.2.5': 'image/dicom-rle', -}; - let lastImageIdDrawn = ''; function isModalityLUTForDisplay(sopClassUid: string): boolean { @@ -156,6 +142,18 @@ function createImage( ? true : options.useNativeDataType || decodeConfig.use16BitDataType; + // Remove any property of the `imageFrame` that cannot be transferred to the worker, + // such as promises and functions. + // This is necessary because the `imageFrame` object is passed to the worker. + Object.keys(imageFrame).forEach((key) => { + if ( + typeof imageFrame[key] === 'function' || + imageFrame[key] instanceof Promise + ) { + delete imageFrame[key]; + } + }); + const decodePromise = decodeImageFrame( imageFrame, transferSyntax, @@ -243,10 +241,10 @@ function createImage( cornerstone.metaData.get(MetadataModules.SOP_COMMON, imageId) || {}; const calibrationModule = cornerstone.metaData.get(MetadataModules.CALIBRATION, imageId) || {}; + const { rows, columns } = imageFrame; if (isColorImage) { - const { rows, columns } = imageFrame; - if (TRANSFER_SYNTAX_USING_PHOTOMETRIC_COLOR[transferSyntax]) { + if (isColorConversionRequired(imageFrame, useRGBA)) { canvas.height = imageFrame.rows; canvas.width = imageFrame.columns; const context = canvas.getContext('2d'); diff --git a/packages/dicomImageLoader/src/imageLoader/isColorConversionRequired.ts b/packages/dicomImageLoader/src/imageLoader/isColorConversionRequired.ts new file mode 100644 index 0000000000..870c15dd04 --- /dev/null +++ b/packages/dicomImageLoader/src/imageLoader/isColorConversionRequired.ts @@ -0,0 +1,33 @@ +/** + * This function checks color space conversion data requirements before + * applying them. This function was created to solve problems like the one + * discussed in here https://discourse.orthanc-server.org/t/orthanc-convert-ybr-to-rgb-but-does-not-change-metadata/3533/17 + * In this case, Orthanc server converts the pixel data from YBR to RGB, but maintain + * the photometricInterpretation dicom tag in YBR + * @param imageFrame + * @param RGBA + * @returns + */ +export default function isColorConversionRequired(imageFrame, RGBA) { + if (imageFrame === undefined) { + return false; + } + const { rows, columns, photometricInterpretation, pixelDataLength } = + imageFrame; + + if (photometricInterpretation.endsWith('420')) { + return ( + pixelDataLength !== + (3 * Math.ceil(columns / 2) + Math.floor(columns / 2)) * rows + ); + } else if (photometricInterpretation.endsWith('422')) { + return ( + pixelDataLength !== + (3 * Math.ceil(columns / 2) + Math.floor(columns / 2)) * + Math.ceil(rows / 2) + + Math.floor(rows / 2) * columns + ); + } else { + return photometricInterpretation !== 'RGB'; + } +} From 5882363b5a60f9b8d6bcb63b60f0e401c065898f Mon Sep 17 00:00:00 2001 From: ohif-bot Date: Tue, 28 May 2024 15:57:40 +0000 Subject: [PATCH 04/14] chore(version): version.json [skip ci] --- commit.txt | 2 +- packages/adapters/package.json | 6 +++--- packages/dicomImageLoader/package.json | 2 +- packages/docs/package.json | 12 ++++++------ packages/nifti-volume-loader/package.json | 2 +- packages/streaming-image-volume-loader/package.json | 2 +- packages/tools/package.json | 2 +- version.json | 4 ++-- version.txt | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/commit.txt b/commit.txt index 2eac861cc2..bcbd7c5cf7 100644 --- a/commit.txt +++ b/commit.txt @@ -1 +1 @@ -03a233525a67ac9bc6bc9a6d144334e67756f11f \ No newline at end of file +2fc22bcd1c0cac22b88e964699d55c51bd83283e \ No newline at end of file diff --git a/packages/adapters/package.json b/packages/adapters/package.json index 25ee1ee29f..550e7575ad 100644 --- a/packages/adapters/package.json +++ b/packages/adapters/package.json @@ -42,7 +42,7 @@ "homepage": "https://github.com/cornerstonejs/cornerstone3D/blob/main/packages/adapters/README.md", "dependencies": { "@babel/runtime-corejs2": "^7.17.8", - "@cornerstonejs/tools": "^1.75.0", + "@cornerstonejs/tools": "^1.75.1", "buffer": "^6.0.3", "dcmjs": "^0.29.8", "gl-matrix": "^3.4.3", @@ -50,7 +50,7 @@ "ndarray": "^1.0.19" }, "devDependencies": { - "@cornerstonejs/core": "^1.75.0", - "@cornerstonejs/streaming-image-volume-loader": "^1.75.0" + "@cornerstonejs/core": "^1.75.1", + "@cornerstonejs/streaming-image-volume-loader": "^1.75.1" } } diff --git a/packages/dicomImageLoader/package.json b/packages/dicomImageLoader/package.json index 44fb740ffa..0770475dab 100644 --- a/packages/dicomImageLoader/package.json +++ b/packages/dicomImageLoader/package.json @@ -66,7 +66,7 @@ "@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2", "@cornerstonejs/codec-openjpeg": "^1.2.2", "@cornerstonejs/codec-openjph": "^2.4.5", - "@cornerstonejs/core": "^1.75.0", + "@cornerstonejs/core": "^1.75.1", "dicom-parser": "^1.8.9", "pako": "^2.0.4", "uuid": "^9.0.0" diff --git a/packages/docs/package.json b/packages/docs/package.json index f3ecdfb65d..1359da31f5 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -29,12 +29,12 @@ "write-heading-ids": "docusaurus write-heading-ids" }, "dependencies": { - "@cornerstonejs/adapters": "^1.75.0", - "@cornerstonejs/core": "^1.75.0", - "@cornerstonejs/dicom-image-loader": "^1.75.0", - "@cornerstonejs/nifti-volume-loader": "^1.75.0", - "@cornerstonejs/streaming-image-volume-loader": "^1.75.0", - "@cornerstonejs/tools": "^1.75.0", + "@cornerstonejs/adapters": "^1.75.1", + "@cornerstonejs/core": "^1.75.1", + "@cornerstonejs/dicom-image-loader": "^1.75.1", + "@cornerstonejs/nifti-volume-loader": "^1.75.1", + "@cornerstonejs/streaming-image-volume-loader": "^1.75.1", + "@cornerstonejs/tools": "^1.75.1", "@docusaurus/core": "2.3.1", "@docusaurus/module-type-aliases": "2.3.1", "@docusaurus/plugin-google-gtag": "2.3.1", diff --git a/packages/nifti-volume-loader/package.json b/packages/nifti-volume-loader/package.json index 1535617586..321012bfa8 100644 --- a/packages/nifti-volume-loader/package.json +++ b/packages/nifti-volume-loader/package.json @@ -29,7 +29,7 @@ "webpack:watch": "webpack --mode development --progress --watch --config ./.webpack/webpack.dev.js" }, "dependencies": { - "@cornerstonejs/core": "^1.75.0", + "@cornerstonejs/core": "^1.75.1", "nifti-reader-js": "^0.6.6" }, "contributors": [ diff --git a/packages/streaming-image-volume-loader/package.json b/packages/streaming-image-volume-loader/package.json index e3dfea0019..0126dffd93 100644 --- a/packages/streaming-image-volume-loader/package.json +++ b/packages/streaming-image-volume-loader/package.json @@ -29,7 +29,7 @@ "webpack:watch": "webpack --mode development --progress --watch --config ./.webpack/webpack.dev.js" }, "dependencies": { - "@cornerstonejs/core": "^1.75.0", + "@cornerstonejs/core": "^1.75.1", "comlink": "^4.4.1" }, "contributors": [ diff --git a/packages/tools/package.json b/packages/tools/package.json index 1290ba6f81..814619d649 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -29,7 +29,7 @@ "webpack:watch": "webpack --mode development --progress --watch --config ./.webpack/webpack.dev.js" }, "dependencies": { - "@cornerstonejs/core": "^1.75.0", + "@cornerstonejs/core": "^1.75.1", "@icr/polyseg-wasm": "0.4.0", "@types/offscreencanvas": "2019.7.3", "comlink": "^4.4.1", diff --git a/version.json b/version.json index 877af922d2..9d6ba767f5 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "version": "1.75.0", - "commit": "03a233525a67ac9bc6bc9a6d144334e67756f11f" + "version": "1.75.1", + "commit": "2fc22bcd1c0cac22b88e964699d55c51bd83283e" } \ No newline at end of file diff --git a/version.txt b/version.txt index 5c8c298b55..096f327f6b 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.75.0 \ No newline at end of file +1.75.1 \ No newline at end of file From a66ba0845254eaff39d40c7f369cb79d5c77f96e Mon Sep 17 00:00:00 2001 From: ohif-bot Date: Tue, 28 May 2024 15:57:54 +0000 Subject: [PATCH 05/14] chore(version): Update package versions [skip ci] --- CHANGELOG.md | 6 ++++++ lerna.json | 2 +- packages/adapters/CHANGELOG.md | 4 ++++ packages/adapters/package.json | 2 +- packages/core/CHANGELOG.md | 4 ++++ packages/core/package.json | 2 +- packages/dicomImageLoader/CHANGELOG.md | 6 ++++++ packages/dicomImageLoader/package.json | 2 +- packages/docs/CHANGELOG.md | 4 ++++ packages/docs/package.json | 2 +- packages/nifti-volume-loader/CHANGELOG.md | 4 ++++ packages/nifti-volume-loader/package.json | 2 +- packages/streaming-image-volume-loader/CHANGELOG.md | 4 ++++ packages/streaming-image-volume-loader/package.json | 2 +- packages/tools/CHANGELOG.md | 4 ++++ packages/tools/package.json | 2 +- 16 files changed, 44 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bf3ce7ffb..17525ecbff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.75.1](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.0...v1.75.1) (2024-05-28) + +### Bug Fixes + +- **color:** Fix RGB inconsistencies ([#829](https://github.com/cornerstonejs/cornerstone3D/issues/829)) ([2fc22bc](https://github.com/cornerstonejs/cornerstone3D/commit/2fc22bcd1c0cac22b88e964699d55c51bd83283e)) + # [1.75.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.74.8...v1.75.0) (2024-05-28) ### Features diff --git a/lerna.json b/lerna.json index 069fac835e..38f57d9a19 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.75.0", + "version": "1.75.1", "packages": [ "packages/adapters", "packages/core", diff --git a/packages/adapters/CHANGELOG.md b/packages/adapters/CHANGELOG.md index 008e262ee3..26b193fbb7 100644 --- a/packages/adapters/CHANGELOG.md +++ b/packages/adapters/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.75.1](https://github.com/dcmjs-org/dcmjs/compare/v1.75.0...v1.75.1) (2024-05-28) + +**Note:** Version bump only for package @cornerstonejs/adapters + # [1.75.0](https://github.com/dcmjs-org/dcmjs/compare/v1.74.8...v1.75.0) (2024-05-28) **Note:** Version bump only for package @cornerstonejs/adapters diff --git a/packages/adapters/package.json b/packages/adapters/package.json index 550e7575ad..d962233c76 100644 --- a/packages/adapters/package.json +++ b/packages/adapters/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/adapters", - "version": "1.75.0", + "version": "1.75.1", "description": "Adapters for Cornerstone3D to/from formats including DICOM SR and others", "src": "src/index.ts", "main": "./dist/@cornerstonejs/adapters.es.js", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 88f83bc03b..655e8f4fcc 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.75.1](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.0...v1.75.1) (2024-05-28) + +**Note:** Version bump only for package @cornerstonejs/core + # [1.75.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.74.8...v1.75.0) (2024-05-28) ### Features diff --git a/packages/core/package.json b/packages/core/package.json index 42babc17c6..9702fc915f 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/core", - "version": "1.75.0", + "version": "1.75.1", "description": "", "main": "src/index.ts", "types": "dist/types/index.d.ts", diff --git a/packages/dicomImageLoader/CHANGELOG.md b/packages/dicomImageLoader/CHANGELOG.md index 65e0363bbf..5256b5df35 100644 --- a/packages/dicomImageLoader/CHANGELOG.md +++ b/packages/dicomImageLoader/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.75.1](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.0...v1.75.1) (2024-05-28) + +### Bug Fixes + +- **color:** Fix RGB inconsistencies ([#829](https://github.com/cornerstonejs/cornerstone3D/issues/829)) ([2fc22bc](https://github.com/cornerstonejs/cornerstone3D/commit/2fc22bcd1c0cac22b88e964699d55c51bd83283e)) + # [1.75.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.74.8...v1.75.0) (2024-05-28) **Note:** Version bump only for package @cornerstonejs/dicom-image-loader diff --git a/packages/dicomImageLoader/package.json b/packages/dicomImageLoader/package.json index 0770475dab..f494ae83fe 100644 --- a/packages/dicomImageLoader/package.json +++ b/packages/dicomImageLoader/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/dicom-image-loader", - "version": "1.75.0", + "version": "1.75.1", "description": "Cornerstone Image Loader for DICOM WADO-URI and WADO-RS and Local file", "keywords": [ "DICOM", diff --git a/packages/docs/CHANGELOG.md b/packages/docs/CHANGELOG.md index 964600bf66..61d2b93619 100644 --- a/packages/docs/CHANGELOG.md +++ b/packages/docs/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.75.1](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.0...v1.75.1) (2024-05-28) + +**Note:** Version bump only for package docs + # [1.75.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.74.8...v1.75.0) (2024-05-28) **Note:** Version bump only for package docs diff --git a/packages/docs/package.json b/packages/docs/package.json index 1359da31f5..2737c3a717 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -1,6 +1,6 @@ { "name": "docs", - "version": "1.75.0", + "version": "1.75.1", "private": true, "repository": "https://github.com/cornerstonejs/cornerstone3D", "scripts": { diff --git a/packages/nifti-volume-loader/CHANGELOG.md b/packages/nifti-volume-loader/CHANGELOG.md index 830c7147f1..3af674d00d 100644 --- a/packages/nifti-volume-loader/CHANGELOG.md +++ b/packages/nifti-volume-loader/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.75.1](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.0...v1.75.1) (2024-05-28) + +**Note:** Version bump only for package @cornerstonejs/nifti-volume-loader + # [1.75.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.74.8...v1.75.0) (2024-05-28) ### Features diff --git a/packages/nifti-volume-loader/package.json b/packages/nifti-volume-loader/package.json index 321012bfa8..c0cc5d1335 100644 --- a/packages/nifti-volume-loader/package.json +++ b/packages/nifti-volume-loader/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/nifti-volume-loader", - "version": "1.75.0", + "version": "1.75.1", "description": "", "main": "dist/umd/index.js", "types": "dist/esm/index.d.ts", diff --git a/packages/streaming-image-volume-loader/CHANGELOG.md b/packages/streaming-image-volume-loader/CHANGELOG.md index 70f7ca7786..e333d77b80 100644 --- a/packages/streaming-image-volume-loader/CHANGELOG.md +++ b/packages/streaming-image-volume-loader/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.75.1](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.0...v1.75.1) (2024-05-28) + +**Note:** Version bump only for package @cornerstonejs/streaming-image-volume-loader + # [1.75.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.74.8...v1.75.0) (2024-05-28) **Note:** Version bump only for package @cornerstonejs/streaming-image-volume-loader diff --git a/packages/streaming-image-volume-loader/package.json b/packages/streaming-image-volume-loader/package.json index 0126dffd93..4f7a8530dd 100644 --- a/packages/streaming-image-volume-loader/package.json +++ b/packages/streaming-image-volume-loader/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/streaming-image-volume-loader", - "version": "1.75.0", + "version": "1.75.1", "description": "", "main": "src/index.ts", "types": "dist/esm/index.d.ts", diff --git a/packages/tools/CHANGELOG.md b/packages/tools/CHANGELOG.md index f0a88d2871..eb0153ed41 100644 --- a/packages/tools/CHANGELOG.md +++ b/packages/tools/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.75.1](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.0...v1.75.1) (2024-05-28) + +**Note:** Version bump only for package @cornerstonejs/tools + # [1.75.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.74.8...v1.75.0) (2024-05-28) **Note:** Version bump only for package @cornerstonejs/tools diff --git a/packages/tools/package.json b/packages/tools/package.json index 814619d649..1cf4d1fbf5 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/tools", - "version": "1.75.0", + "version": "1.75.1", "description": "Cornerstone3D Tools", "main": "src/index.ts", "types": "dist/types/index.d.ts", From 9637dfbb64eeb39d92c979d5922604079847b1e9 Mon Sep 17 00:00:00 2001 From: Luke Zhang <45812192+deerzlg@users.noreply.github.com> Date: Wed, 29 May 2024 00:07:08 +0800 Subject: [PATCH 06/14] fix(core): correctly set the orientation of the volume (#1287) --- .../core/src/utilities/convertStackToVolumeViewport.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/core/src/utilities/convertStackToVolumeViewport.ts b/packages/core/src/utilities/convertStackToVolumeViewport.ts index a3cd44538a..0a78be7285 100644 --- a/packages/core/src/utilities/convertStackToVolumeViewport.ts +++ b/packages/core/src/utilities/convertStackToVolumeViewport.ts @@ -87,9 +87,11 @@ async function convertStackToVolumeViewport({ ); const volumeViewportNewVolumeHandler = () => { - volumeViewport.setCamera({ - ...prevCamera, - }); + if (!options.orientation) { + volumeViewport.setCamera({ + ...prevCamera, + }); + } volumeViewport.render(); element.removeEventListener( From afa16f19f4cabde34701da66fa07ad9fc4e7c798 Mon Sep 17 00:00:00 2001 From: ohif-bot Date: Tue, 28 May 2024 16:16:52 +0000 Subject: [PATCH 07/14] chore(version): version.json [skip ci] --- commit.txt | 2 +- packages/adapters/package.json | 6 +++--- packages/dicomImageLoader/package.json | 2 +- packages/docs/package.json | 12 ++++++------ packages/nifti-volume-loader/package.json | 2 +- packages/streaming-image-volume-loader/package.json | 2 +- packages/tools/package.json | 2 +- version.json | 4 ++-- version.txt | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/commit.txt b/commit.txt index bcbd7c5cf7..63eb8ec871 100644 --- a/commit.txt +++ b/commit.txt @@ -1 +1 @@ -2fc22bcd1c0cac22b88e964699d55c51bd83283e \ No newline at end of file +9637dfbb64eeb39d92c979d5922604079847b1e9 \ No newline at end of file diff --git a/packages/adapters/package.json b/packages/adapters/package.json index d962233c76..f12f9ca823 100644 --- a/packages/adapters/package.json +++ b/packages/adapters/package.json @@ -42,7 +42,7 @@ "homepage": "https://github.com/cornerstonejs/cornerstone3D/blob/main/packages/adapters/README.md", "dependencies": { "@babel/runtime-corejs2": "^7.17.8", - "@cornerstonejs/tools": "^1.75.1", + "@cornerstonejs/tools": "^1.75.2", "buffer": "^6.0.3", "dcmjs": "^0.29.8", "gl-matrix": "^3.4.3", @@ -50,7 +50,7 @@ "ndarray": "^1.0.19" }, "devDependencies": { - "@cornerstonejs/core": "^1.75.1", - "@cornerstonejs/streaming-image-volume-loader": "^1.75.1" + "@cornerstonejs/core": "^1.75.2", + "@cornerstonejs/streaming-image-volume-loader": "^1.75.2" } } diff --git a/packages/dicomImageLoader/package.json b/packages/dicomImageLoader/package.json index f494ae83fe..db9745700e 100644 --- a/packages/dicomImageLoader/package.json +++ b/packages/dicomImageLoader/package.json @@ -66,7 +66,7 @@ "@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2", "@cornerstonejs/codec-openjpeg": "^1.2.2", "@cornerstonejs/codec-openjph": "^2.4.5", - "@cornerstonejs/core": "^1.75.1", + "@cornerstonejs/core": "^1.75.2", "dicom-parser": "^1.8.9", "pako": "^2.0.4", "uuid": "^9.0.0" diff --git a/packages/docs/package.json b/packages/docs/package.json index 2737c3a717..b9622320f5 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -29,12 +29,12 @@ "write-heading-ids": "docusaurus write-heading-ids" }, "dependencies": { - "@cornerstonejs/adapters": "^1.75.1", - "@cornerstonejs/core": "^1.75.1", - "@cornerstonejs/dicom-image-loader": "^1.75.1", - "@cornerstonejs/nifti-volume-loader": "^1.75.1", - "@cornerstonejs/streaming-image-volume-loader": "^1.75.1", - "@cornerstonejs/tools": "^1.75.1", + "@cornerstonejs/adapters": "^1.75.2", + "@cornerstonejs/core": "^1.75.2", + "@cornerstonejs/dicom-image-loader": "^1.75.2", + "@cornerstonejs/nifti-volume-loader": "^1.75.2", + "@cornerstonejs/streaming-image-volume-loader": "^1.75.2", + "@cornerstonejs/tools": "^1.75.2", "@docusaurus/core": "2.3.1", "@docusaurus/module-type-aliases": "2.3.1", "@docusaurus/plugin-google-gtag": "2.3.1", diff --git a/packages/nifti-volume-loader/package.json b/packages/nifti-volume-loader/package.json index c0cc5d1335..b2bc110bfe 100644 --- a/packages/nifti-volume-loader/package.json +++ b/packages/nifti-volume-loader/package.json @@ -29,7 +29,7 @@ "webpack:watch": "webpack --mode development --progress --watch --config ./.webpack/webpack.dev.js" }, "dependencies": { - "@cornerstonejs/core": "^1.75.1", + "@cornerstonejs/core": "^1.75.2", "nifti-reader-js": "^0.6.6" }, "contributors": [ diff --git a/packages/streaming-image-volume-loader/package.json b/packages/streaming-image-volume-loader/package.json index 4f7a8530dd..6f02c1cb33 100644 --- a/packages/streaming-image-volume-loader/package.json +++ b/packages/streaming-image-volume-loader/package.json @@ -29,7 +29,7 @@ "webpack:watch": "webpack --mode development --progress --watch --config ./.webpack/webpack.dev.js" }, "dependencies": { - "@cornerstonejs/core": "^1.75.1", + "@cornerstonejs/core": "^1.75.2", "comlink": "^4.4.1" }, "contributors": [ diff --git a/packages/tools/package.json b/packages/tools/package.json index 1cf4d1fbf5..09ee1a9a90 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -29,7 +29,7 @@ "webpack:watch": "webpack --mode development --progress --watch --config ./.webpack/webpack.dev.js" }, "dependencies": { - "@cornerstonejs/core": "^1.75.1", + "@cornerstonejs/core": "^1.75.2", "@icr/polyseg-wasm": "0.4.0", "@types/offscreencanvas": "2019.7.3", "comlink": "^4.4.1", diff --git a/version.json b/version.json index 9d6ba767f5..5780a416ac 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "version": "1.75.1", - "commit": "2fc22bcd1c0cac22b88e964699d55c51bd83283e" + "version": "1.75.2", + "commit": "9637dfbb64eeb39d92c979d5922604079847b1e9" } \ No newline at end of file diff --git a/version.txt b/version.txt index 096f327f6b..de4cb2b779 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.75.1 \ No newline at end of file +1.75.2 \ No newline at end of file From f3239736baf99aec3e0744d0905b9cc1a43ae7cd Mon Sep 17 00:00:00 2001 From: ohif-bot Date: Tue, 28 May 2024 16:17:10 +0000 Subject: [PATCH 08/14] chore(version): Update package versions [skip ci] --- CHANGELOG.md | 6 ++++++ lerna.json | 2 +- packages/adapters/CHANGELOG.md | 4 ++++ packages/adapters/package.json | 2 +- packages/core/CHANGELOG.md | 6 ++++++ packages/core/package.json | 2 +- packages/dicomImageLoader/CHANGELOG.md | 4 ++++ packages/dicomImageLoader/package.json | 2 +- packages/docs/CHANGELOG.md | 4 ++++ packages/docs/package.json | 2 +- packages/nifti-volume-loader/CHANGELOG.md | 4 ++++ packages/nifti-volume-loader/package.json | 2 +- packages/streaming-image-volume-loader/CHANGELOG.md | 4 ++++ packages/streaming-image-volume-loader/package.json | 2 +- packages/tools/CHANGELOG.md | 4 ++++ packages/tools/package.json | 2 +- 16 files changed, 44 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17525ecbff..2ab752fd17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.75.2](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.1...v1.75.2) (2024-05-28) + +### Bug Fixes + +- **core:** correctly set the orientation of the volume ([#1287](https://github.com/cornerstonejs/cornerstone3D/issues/1287)) ([9637dfb](https://github.com/cornerstonejs/cornerstone3D/commit/9637dfbb64eeb39d92c979d5922604079847b1e9)) + ## [1.75.1](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.0...v1.75.1) (2024-05-28) ### Bug Fixes diff --git a/lerna.json b/lerna.json index 38f57d9a19..592406e845 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.75.1", + "version": "1.75.2", "packages": [ "packages/adapters", "packages/core", diff --git a/packages/adapters/CHANGELOG.md b/packages/adapters/CHANGELOG.md index 26b193fbb7..89f5c7545b 100644 --- a/packages/adapters/CHANGELOG.md +++ b/packages/adapters/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.75.2](https://github.com/dcmjs-org/dcmjs/compare/v1.75.1...v1.75.2) (2024-05-28) + +**Note:** Version bump only for package @cornerstonejs/adapters + ## [1.75.1](https://github.com/dcmjs-org/dcmjs/compare/v1.75.0...v1.75.1) (2024-05-28) **Note:** Version bump only for package @cornerstonejs/adapters diff --git a/packages/adapters/package.json b/packages/adapters/package.json index f12f9ca823..85c5305540 100644 --- a/packages/adapters/package.json +++ b/packages/adapters/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/adapters", - "version": "1.75.1", + "version": "1.75.2", "description": "Adapters for Cornerstone3D to/from formats including DICOM SR and others", "src": "src/index.ts", "main": "./dist/@cornerstonejs/adapters.es.js", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 655e8f4fcc..08f265ab36 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.75.2](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.1...v1.75.2) (2024-05-28) + +### Bug Fixes + +- **core:** correctly set the orientation of the volume ([#1287](https://github.com/cornerstonejs/cornerstone3D/issues/1287)) ([9637dfb](https://github.com/cornerstonejs/cornerstone3D/commit/9637dfbb64eeb39d92c979d5922604079847b1e9)) + ## [1.75.1](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.0...v1.75.1) (2024-05-28) **Note:** Version bump only for package @cornerstonejs/core diff --git a/packages/core/package.json b/packages/core/package.json index 9702fc915f..d5e17a353a 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/core", - "version": "1.75.1", + "version": "1.75.2", "description": "", "main": "src/index.ts", "types": "dist/types/index.d.ts", diff --git a/packages/dicomImageLoader/CHANGELOG.md b/packages/dicomImageLoader/CHANGELOG.md index 5256b5df35..91bc7933e7 100644 --- a/packages/dicomImageLoader/CHANGELOG.md +++ b/packages/dicomImageLoader/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.75.2](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.1...v1.75.2) (2024-05-28) + +**Note:** Version bump only for package @cornerstonejs/dicom-image-loader + ## [1.75.1](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.0...v1.75.1) (2024-05-28) ### Bug Fixes diff --git a/packages/dicomImageLoader/package.json b/packages/dicomImageLoader/package.json index db9745700e..bbf4ca33e8 100644 --- a/packages/dicomImageLoader/package.json +++ b/packages/dicomImageLoader/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/dicom-image-loader", - "version": "1.75.1", + "version": "1.75.2", "description": "Cornerstone Image Loader for DICOM WADO-URI and WADO-RS and Local file", "keywords": [ "DICOM", diff --git a/packages/docs/CHANGELOG.md b/packages/docs/CHANGELOG.md index 61d2b93619..6de7b57559 100644 --- a/packages/docs/CHANGELOG.md +++ b/packages/docs/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.75.2](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.1...v1.75.2) (2024-05-28) + +**Note:** Version bump only for package docs + ## [1.75.1](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.0...v1.75.1) (2024-05-28) **Note:** Version bump only for package docs diff --git a/packages/docs/package.json b/packages/docs/package.json index b9622320f5..f3617bc788 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -1,6 +1,6 @@ { "name": "docs", - "version": "1.75.1", + "version": "1.75.2", "private": true, "repository": "https://github.com/cornerstonejs/cornerstone3D", "scripts": { diff --git a/packages/nifti-volume-loader/CHANGELOG.md b/packages/nifti-volume-loader/CHANGELOG.md index 3af674d00d..6ad385257e 100644 --- a/packages/nifti-volume-loader/CHANGELOG.md +++ b/packages/nifti-volume-loader/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.75.2](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.1...v1.75.2) (2024-05-28) + +**Note:** Version bump only for package @cornerstonejs/nifti-volume-loader + ## [1.75.1](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.0...v1.75.1) (2024-05-28) **Note:** Version bump only for package @cornerstonejs/nifti-volume-loader diff --git a/packages/nifti-volume-loader/package.json b/packages/nifti-volume-loader/package.json index b2bc110bfe..a9120aadd4 100644 --- a/packages/nifti-volume-loader/package.json +++ b/packages/nifti-volume-loader/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/nifti-volume-loader", - "version": "1.75.1", + "version": "1.75.2", "description": "", "main": "dist/umd/index.js", "types": "dist/esm/index.d.ts", diff --git a/packages/streaming-image-volume-loader/CHANGELOG.md b/packages/streaming-image-volume-loader/CHANGELOG.md index e333d77b80..5a7ee67e14 100644 --- a/packages/streaming-image-volume-loader/CHANGELOG.md +++ b/packages/streaming-image-volume-loader/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.75.2](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.1...v1.75.2) (2024-05-28) + +**Note:** Version bump only for package @cornerstonejs/streaming-image-volume-loader + ## [1.75.1](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.0...v1.75.1) (2024-05-28) **Note:** Version bump only for package @cornerstonejs/streaming-image-volume-loader diff --git a/packages/streaming-image-volume-loader/package.json b/packages/streaming-image-volume-loader/package.json index 6f02c1cb33..64328d2c61 100644 --- a/packages/streaming-image-volume-loader/package.json +++ b/packages/streaming-image-volume-loader/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/streaming-image-volume-loader", - "version": "1.75.1", + "version": "1.75.2", "description": "", "main": "src/index.ts", "types": "dist/esm/index.d.ts", diff --git a/packages/tools/CHANGELOG.md b/packages/tools/CHANGELOG.md index eb0153ed41..1cd0ff6f81 100644 --- a/packages/tools/CHANGELOG.md +++ b/packages/tools/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.75.2](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.1...v1.75.2) (2024-05-28) + +**Note:** Version bump only for package @cornerstonejs/tools + ## [1.75.1](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.0...v1.75.1) (2024-05-28) **Note:** Version bump only for package @cornerstonejs/tools diff --git a/packages/tools/package.json b/packages/tools/package.json index 09ee1a9a90..f36aa02c74 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/tools", - "version": "1.75.1", + "version": "1.75.2", "description": "Cornerstone3D Tools", "main": "src/index.ts", "types": "dist/types/index.d.ts", From e4002774bcedeb2334d008cb3ab3e294ff1c088b Mon Sep 17 00:00:00 2001 From: Bill Wallace Date: Tue, 28 May 2024 12:26:03 -0400 Subject: [PATCH 09/14] feat: Add render to canvas for mpr/volume viewports (#1215) --- common/reviews/api/core.api.md | 101 ++-------- common/reviews/api/nifti-volume-loader.api.md | 5 +- .../api/streaming-image-volume-loader.api.md | 5 +- .../core/examples/renderToCanvas/index.ts | 183 +++++++++++++++--- .../helpers/addImageSlicesToViewports.ts | 7 +- packages/core/src/loaders/imageLoader.ts | 28 ++- packages/core/src/types/IStackViewport.ts | 180 +---------------- .../src/utilities/getScalingParameters.ts | 4 +- .../core/src/utilities/loadImageToCanvas.ts | 125 +++++++++--- .../core/src/utilities/renderToCanvasCPU.ts | 13 +- .../core/src/utilities/renderToCanvasGPU.ts | 85 +++++--- packages/core/test/renderToCanvas_gpu_test.js | 12 +- .../src/helpers/splitImageIdsBy4DTags.ts | 3 +- .../segmentation/imageChangeEventListener.ts | 48 +++-- .../Labelmap/addLabelmapToElement.ts | 8 +- utils/demo/helpers/addLabelToToolbar.ts | 2 +- 16 files changed, 400 insertions(+), 409 deletions(-) diff --git a/common/reviews/api/core.api.md b/common/reviews/api/core.api.md index a3eaba76f4..3c13d85709 100644 --- a/common/reviews/api/core.api.md +++ b/common/reviews/api/core.api.md @@ -62,7 +62,7 @@ type ActorSliceRange = { }; // @public (undocumented) -export function addImageSlicesToViewports(renderingEngine: IRenderingEngine, stackInputs: Array, viewportIds: Array, immediateRender?: boolean, suppressEvents?: boolean): Promise; +export function addImageSlicesToViewports(renderingEngine: IRenderingEngine, stackInputs: Array, viewportIds: Array): Promise; // @public (undocumented) function addProvider(provider: (type: string, ...query: string[]) => any, priority?: number): void; @@ -230,7 +230,7 @@ declare namespace cacheUtils { } // @public (undocumented) -function calculateViewportsSpatialRegistration(viewport1: IStackViewport | IVolumeViewport, viewport2: IStackViewport | IVolumeViewport): void; +function calculateViewportsSpatialRegistration(viewport1: StackViewport | IVolumeViewport, viewport2: StackViewport | IVolumeViewport): void; // @public (undocumented) enum CalibrationTypes { @@ -376,7 +376,7 @@ enum ContourType { // @public (undocumented) function convertStackToVolumeViewport({ viewport, options, }: { - viewport: IStackViewport; + viewport: StackViewport; options: { volumeId: string; viewportId?: string; @@ -991,7 +991,7 @@ function getBufferConfiguration(targetBufferType: PixelDataTypedArrayString, len function getClosestImageId(imageVolume: IImageVolume, worldPos: Point3, viewPlaneNormal: Point3): string; // @public (undocumented) -function getClosestStackImageIndexForPoint(point: Point3, viewport: IStackViewport): number | null; +function getClosestStackImageIndexForPoint(point: Point3, viewport: StackViewport): number | null; // @public (undocumented) function getColormap(name: any): any; @@ -1088,7 +1088,7 @@ function getTransferFunctionNodes(transferFunction: any): any[]; function getUnknownVolumeLoaderSchema(): string; // @public (undocumented) -function getViewportImageCornersInWorld(viewport: IStackViewport | IVolumeViewport): Point3[]; +function getViewportImageCornersInWorld(viewport: StackViewport | IVolumeViewport): Point3[]; // @public (undocumented) function getViewportImageIds(viewport: IViewport): string[]; @@ -1339,7 +1339,7 @@ interface IEnabledElement { // (undocumented) renderingEngineId: string; // (undocumented) - viewport: IStackViewport | IVolumeViewport; + viewport: StackViewport | IVolumeViewport; // (undocumented) viewportId: string; } @@ -2005,7 +2005,7 @@ interface IRenderingEngine { // (undocumented) fillCanvasWithBackgroundColor(canvas: HTMLCanvasElement, backgroundColor: [number, number, number]): void; // (undocumented) - getStackViewports(): Array; + getStackViewports(): Array; // (undocumented) getVideoViewports(): Array; // (undocumented) @@ -2079,79 +2079,6 @@ interface IStackInput { visibility?: boolean; } -// @public (undocumented) -interface IStackViewport extends IViewport { - // (undocumented) - addImages(stackInputs: Array, immediateRender: boolean, suppressEvents: boolean): any; - // (undocumented) - calibrateSpacing(imageId: string): void; - // (undocumented) - canvasToWorld: (canvasPos: Point2) => Point3; - // (undocumented) - clearDefaultProperties(imageId?: string): void; - // (undocumented) - customRenderViewportToCanvas: () => { - canvas: HTMLCanvasElement; - element: HTMLDivElement; - viewportId: string; - renderingEngineId: string; - }; - // (undocumented) - getCamera(): ICamera; - // (undocumented) - getCornerstoneImage: () => IImage; - // (undocumented) - getCurrentImageId: () => string; - // (undocumented) - getCurrentImageIdIndex: () => number; - // (undocumented) - getDefaultProperties: (imageId?: string) => StackViewportProperties; - // (undocumented) - getFrameOfReferenceUID: () => string; - // (undocumented) - getImageData(): IImageData | CPUIImageData; - // (undocumented) - getImageDataMetadata(image: IImage): any; - // (undocumented) - getImageIds: () => string[]; - // (undocumented) - getProperties: () => StackViewportProperties; - // (undocumented) - getRenderer(): any; - // (undocumented) - hasImageId: (imageId: string) => boolean; - // (undocumented) - hasImageURI: (imageURI: string) => boolean; - // (undocumented) - modality: string; - // (undocumented) - resetCamera(resetPan?: boolean, resetZoom?: boolean): boolean; - // (undocumented) - resetProperties(): void; - // (undocumented) - resetToDefaultProperties(): void; - // (undocumented) - resize: () => void; - // (undocumented) - scaling: Scaling; - // (undocumented) - setCamera(cameraInterface: ICamera): void; - // (undocumented) - setDefaultProperties(ViewportProperties: StackViewportProperties, imageId?: string): void; - // (undocumented) - setImageIdIndex(imageIdIndex: number): Promise; - // (undocumented) - setProperties({ voiRange, invert, interpolationType, rotation, colormap, }: StackViewportProperties, suppressEvents?: boolean): void; - // (undocumented) - setStack(imageIds: Array, currentImageIdIndex?: number): Promise; - // (undocumented) - stackActorReInitialized: boolean; - // (undocumented) - unsetColormap(): void; - // (undocumented) - worldToCanvas: (worldPos: Point3) => Point2; -} - // @public (undocumented) interface IStreamingImageVolume extends ImageVolume { // (undocumented) @@ -2476,7 +2403,7 @@ function loadAndCacheImages(imageIds: Array, options?: ImageLoaderOption function loadImage(imageId: string, options?: ImageLoaderOptions): Promise; // @public (undocumented) -function loadImageToCanvas(options: LoadImageOptions): Promise; +function loadImageToCanvas(options: LoadImageOptions): Promise; // @public (undocumented) function loadVolume(volumeId: string, options?: VolumeLoaderOptions): Promise; @@ -2865,7 +2792,7 @@ export class RenderingEngine implements IRenderingEngine { // (undocumented) fillCanvasWithBackgroundColor(canvas: HTMLCanvasElement, backgroundColor: [number, number, number]): void; // (undocumented) - getStackViewports(): Array; + getStackViewports(): Array; // (undocumented) getVideoViewports(): Array; // (undocumented) @@ -2897,10 +2824,12 @@ export class RenderingEngine implements IRenderingEngine { } // @public (undocumented) -function renderToCanvasCPU(canvas: HTMLCanvasElement, image: IImage, modality?: string, _renderingEngineId?: string, _viewportOptions?: ViewportInputOptions): Promise; +function renderToCanvasCPU(canvas: HTMLCanvasElement, imageOrVolume: IImage | IVolume, modality?: string, _renderingEngineId?: string, _viewportOptions?: ViewportInputOptions): Promise; // @public (undocumented) -function renderToCanvasGPU(canvas: HTMLCanvasElement, image: IImage, modality?: any, renderingEngineId?: string, viewportOptions?: ViewportInputOptions): Promise; +function renderToCanvasGPU(canvas: HTMLCanvasElement, imageOrVolume: IImage | IVolume, modality?: any, renderingEngineId?: string, viewportOptions?: ViewportInputOptions & { + viewReference?: ViewReference; +}): Promise; // @public (undocumented) enum RequestType { @@ -3114,7 +3043,7 @@ type StackNewImageEventDetail = { }; // @public (undocumented) -export class StackViewport extends Viewport implements IStackViewport, IImagesLoader { +export class StackViewport extends Viewport implements StackViewport, IImagesLoader { constructor(props: ViewportInput); // (undocumented) addActor: (actorEntry: ActorEntry) => void; @@ -3392,7 +3321,7 @@ declare namespace Types { IImagesLoader, Cornerstone3DConfig, ICamera, - IStackViewport, + StackViewport as IStackViewport, IVideoViewport, IVolumeViewport, IEnabledElement, diff --git a/common/reviews/api/nifti-volume-loader.api.md b/common/reviews/api/nifti-volume-loader.api.md index 67ab179ece..f99fb3c7c2 100644 --- a/common/reviews/api/nifti-volume-loader.api.md +++ b/common/reviews/api/nifti-volume-loader.api.md @@ -5,11 +5,14 @@ ```ts import type { GetGPUTier } from 'detect-gpu'; -import type { mat4 } from 'gl-matrix'; +import { mat4 } from 'gl-matrix'; import type { TierResult } from 'detect-gpu'; import type vtkActor from '@kitware/vtk.js/Rendering/Core/Actor'; +import type { vtkCamera } from '@kitware/vtk.js/Rendering/Core/Camera'; import vtkImageData from '@kitware/vtk.js/Common/DataModel/ImageData'; import vtkImageSlice from '@kitware/vtk.js/Rendering/Core/ImageSlice'; +import type { vtkObject } from '@kitware/vtk.js/interfaces'; +import vtkPlane from '@kitware/vtk.js/Common/DataModel/Plane'; import type vtkVolume from '@kitware/vtk.js/Rendering/Core/Volume'; // @public (undocumented) diff --git a/common/reviews/api/streaming-image-volume-loader.api.md b/common/reviews/api/streaming-image-volume-loader.api.md index 66f75838d2..ede6fceb0a 100644 --- a/common/reviews/api/streaming-image-volume-loader.api.md +++ b/common/reviews/api/streaming-image-volume-loader.api.md @@ -5,11 +5,14 @@ ```ts import type { GetGPUTier } from 'detect-gpu'; -import type { mat4 } from 'gl-matrix'; +import { mat4 } from 'gl-matrix'; import type { TierResult } from 'detect-gpu'; import type vtkActor from '@kitware/vtk.js/Rendering/Core/Actor'; +import type { vtkCamera } from '@kitware/vtk.js/Rendering/Core/Camera'; import vtkImageData from '@kitware/vtk.js/Common/DataModel/ImageData'; import vtkImageSlice from '@kitware/vtk.js/Rendering/Core/ImageSlice'; +import type { vtkObject } from '@kitware/vtk.js/interfaces'; +import vtkPlane from '@kitware/vtk.js/Common/DataModel/Plane'; import type vtkVolume from '@kitware/vtk.js/Rendering/Core/Volume'; // @public (undocumented) diff --git a/packages/core/examples/renderToCanvas/index.ts b/packages/core/examples/renderToCanvas/index.ts index 9952f1558d..b553a650b2 100644 --- a/packages/core/examples/renderToCanvas/index.ts +++ b/packages/core/examples/renderToCanvas/index.ts @@ -4,7 +4,9 @@ import { Enums, utilities, setUseCPURendering, + volumeLoader, } from '@cornerstonejs/core'; +import * as csTools from '@cornerstonejs/tools'; import { initDemo, createImageIdsAndCacheMetaData, @@ -12,6 +14,7 @@ import { addToggleButtonToToolbar, addButtonToToolbar, } from '../../../../utils/demo/helpers'; +import addDropDownToToolbar from '../../../../utils/demo/helpers/addDropdownToToolbar'; // This is for debugging purposes console.warn( @@ -26,21 +29,98 @@ setTitleAndDescription( 'This example uses both viewportAPI and also simple renderToCanvas to render an image. The left viewport is using the viewportAPI and the right viewport is using renderToCanvas.' ); -const size = '500px'; +const pixelSize = 500; +const devicePixelRatio = window.devicePixelRatio || 1; +const size = `${Math.round(pixelSize / devicePixelRatio)}px`; const content = document.getElementById('content'); const viewportGrid = document.createElement('div'); +const volumeId = 'volumeId'; +let viewport; +const viewportId = 'viewportId'; viewportGrid.style.display = 'flex'; viewportGrid.style.flexDirection = 'row'; +const viewportTypes = new Map(); + const element1 = document.createElement('div'); element1.style.width = size; element1.style.height = size; +element1.style.background = 'green'; + +const viewportInput = { + viewportId, + type: ViewportType.ORTHOGRAPHIC, + element: element1, + defaultOptions: { + background: [0.2, 0, 0.2], + }, +}; + +let viewportType = { + sliceIndex: null, + viewportInputArray: [ + { + ...viewportInput, + type: ViewportType.STACK, + }, + ], +}; + +viewportTypes.set('Stack', viewportType); +viewportTypes.set('Axial', { + viewportInputArray: [ + { + ...viewportInput, + defaultOptions: { + orientation: Enums.OrientationAxis.AXIAL, + background: [0.2, 0.2, 0], + }, + }, + ], +}); +viewportTypes.set('Sagittal', { + viewportInputArray: [ + { + ...viewportInput, + defaultOptions: { + orientation: Enums.OrientationAxis.SAGITTAL, + background: [0.2, 0, 0.2], + }, + }, + ], +}); +viewportTypes.set('Sagittal 2', { + sliceIndex: 200, + viewportInputArray: [ + { + ...viewportInput, + viewportId: 'Axial', + defaultOptions: { + orientation: Enums.OrientationAxis.SAGITTAL, + background: [0, 0, 0.2], + sliceIndex: 200, + }, + }, + ], +}); +viewportTypes.set('Coronal', { + viewportInputArray: [ + { + ...viewportInput, + viewportId: 'Axial', + defaultOptions: { + orientation: Enums.OrientationAxis.CORONAL, + background: [0, 0.2, 0], + }, + }, + ], +}); const canvas = document.createElement('canvas'); -canvas.width = 500; -canvas.height = 500; +canvas.width = pixelSize; +canvas.height = pixelSize; viewportGrid.appendChild(element1); viewportGrid.appendChild(canvas); @@ -66,6 +146,15 @@ addToggleButtonToToolbar({ }, }); +addDropDownToToolbar({ + options: { + map: viewportTypes, + }, + onSelectedValueChange: (_key, value) => { + viewportType = value; + }, +}); + addButtonToToolbar({ id: 'load', title: 'Load', @@ -93,39 +182,69 @@ async function run() { // Instantiate a rendering engine const renderingEngineId = 'myRenderingEngine'; const renderingEngine = new RenderingEngine(renderingEngineId); - - const viewportIds = ['CT_AXIAL_STACK_1']; + const volume = await volumeLoader.createAndCacheVolume(volumeId, { + imageIds, + }); // Create a stack viewport - const viewportInputArray = [ - { - viewportId: viewportIds[0], - type: ViewportType.STACK, - element: element1, - defaultOptions: { - background: [0.2, 0, 0.2], - }, - }, - ]; load = async () => { - renderingEngine.setViewports(viewportInputArray); - - // Get the stack viewport that was created - const viewport1 = ( - renderingEngine.getViewport(viewportIds[0]) - ); - - const imageId = imageIds[100]; - - utilities.loadImageToCanvas({ canvas, imageId, useCPURendering }); - - // To simulate a delay in loading the image since the loading - // mechanisms are different for the two viewports - setTimeout(() => { - viewport1.setStack([imageId]); - renderingEngine.renderViewports(viewportIds); - }, 200); + if (viewport) { + renderingEngine.disableElement(viewport.id); + viewport = null; + canvas.getContext('2d').clearRect(0, 0, canvas.width, canvas.height); + } + const { viewportInputArray, sliceIndex } = viewportType; + renderingEngine.setViewports(viewportInputArray as any); + + const [viewportInputData] = viewportInputArray; + const { viewportId, type } = viewportInputData; + const isStack = type === ViewportType.STACK; + + if (isStack) { + const imageId = imageIds[100]; + + utilities.loadImageToCanvas({ + canvas, + imageId, + useCPURendering, + renderingEngineId, + }); + + // To simulate a delay in loading the image since the loading + // mechanisms are different for the two viewports + setTimeout(async () => { + // Get the stack viewport that was created + const viewport = ( + renderingEngine.getViewport(viewportId) + ); + await viewport.setStack([imageId], 0); + viewport.resetCamera(); + viewport.render(); + }, 200); + } else { + // Get the stack viewport that was created + const viewport = ( + renderingEngine.getViewport(viewportId) + ); + await viewport.setVolumes([{ volumeId }]); + if (sliceIndex !== undefined) { + await csTools.utilities.jumpToSlice(viewport.element, { + imageIndex: sliceIndex, + }); + } + volume.load(); + viewport.render(); + setTimeout(() => { + utilities.loadImageToCanvas({ + canvas, + imageId: null, + viewReference: viewport.getViewReference(), + renderingEngineId, + viewportOptions: viewportInputData.defaultOptions, + }); + }, 2000); + } }; } diff --git a/packages/core/src/RenderingEngine/helpers/addImageSlicesToViewports.ts b/packages/core/src/RenderingEngine/helpers/addImageSlicesToViewports.ts index f00862e306..962332a8d1 100644 --- a/packages/core/src/RenderingEngine/helpers/addImageSlicesToViewports.ts +++ b/packages/core/src/RenderingEngine/helpers/addImageSlicesToViewports.ts @@ -1,4 +1,3 @@ -import { StackViewport } from '..'; import type { IStackViewport, IStackInput, @@ -20,9 +19,7 @@ import type { async function addImageSlicesToViewports( renderingEngine: IRenderingEngine, stackInputs: Array, - viewportIds: Array, - immediateRender = false, - suppressEvents = false + viewportIds: Array ): Promise { // Check if all viewports are volumeViewports for (const viewportId of viewportIds) { @@ -45,7 +42,7 @@ async function addImageSlicesToViewports( const addStackPromises = viewportIds.map(async (viewportId) => { const viewport = renderingEngine.getViewport(viewportId) as IStackViewport; - return viewport.addImages(stackInputs, immediateRender, suppressEvents); + return viewport.addImages(stackInputs); }); await Promise.all(addStackPromises); diff --git a/packages/core/src/loaders/imageLoader.ts b/packages/core/src/loaders/imageLoader.ts index d2b883b1bf..615d427782 100644 --- a/packages/core/src/loaders/imageLoader.ts +++ b/packages/core/src/loaders/imageLoader.ts @@ -283,14 +283,26 @@ export function createAndCacheDerivedImage( ); const derivedImageId = imageId; - ['imagePixelModule', 'imagePlaneModule', 'generalSeriesModule'].forEach( - (type) => { - genericMetadataProvider.add(derivedImageId, { - type, - metadata: metaData.get(type, referencedImageId), - }); - } - ); + ['imagePlaneModule', 'generalSeriesModule'].forEach((type) => { + genericMetadataProvider.add(derivedImageId, { + type, + metadata: metaData.get(type, referencedImageId), + }); + }); + + const imagePixelModule = metaData.get('imagePixelModule', referencedImageId); + // TODO - add a general way to specify this + genericMetadataProvider.add(derivedImageId, { + type: 'imagePixelModule', + metadata: { + ...imagePixelModule, + bitsAllocated: 8, + bitsStored: 8, + highBit: 7, + samplesPerPixel: 1, + pixelRepresentation: 0, + }, + }); const localImage = createAndCacheLocalImage( { scalarData: imageScalarData, onCacheAdd, skipCreateBuffer }, diff --git a/packages/core/src/types/IStackViewport.ts b/packages/core/src/types/IStackViewport.ts index b3f2d571d3..1b89187375 100644 --- a/packages/core/src/types/IStackViewport.ts +++ b/packages/core/src/types/IStackViewport.ts @@ -1,179 +1,3 @@ -import CPUIImageData from './CPUIImageData'; -import ICamera from './ICamera'; -import IImageData from './IImageData'; -import { IViewport } from './IViewport'; -import Point2 from './Point2'; -import Point3 from './Point3'; -import { Scaling } from './ScalingParameters'; -import StackViewportProperties from './StackViewportProperties'; -import type IImage from './IImage'; -import { IStackInput } from './IStackInput'; -/** - * Interface for Stack Viewport - */ -export default interface IStackViewport extends IViewport { - modality: string; - /** Scaling parameters */ - scaling: Scaling; +import type IStackViewport from '../RenderingEngine/StackViewport'; - stackActorReInitialized: boolean; - /** - * Resizes the viewport - only used in CPU fallback for StackViewport. The - * GPU resizing happens inside the RenderingEngine. - */ - resize: () => void; - /** - * Returns the frame of reference UID, if the image doesn't have imagePlaneModule - * metadata, it returns undefined, otherwise, frameOfReferenceUID is returned. - */ - getFrameOfReferenceUID: () => string; - - /** - * Update the default properties of the viewport and add properties by imageId if specified - * setting the VOI, inverting the colors and setting the interpolation type, rotation - */ - setDefaultProperties( - ViewportProperties: StackViewportProperties, - imageId?: string - ): void; - - /** - * Remove the global default properties of the viewport or remove default properties for an imageId if specified - */ - clearDefaultProperties(imageId?: string): void; - /** - * Sets the properties for the viewport on the default actor. Properties include - * setting the VOI, inverting the colors and setting the interpolation type, rotation - */ - setProperties( - { - voiRange, - invert, - interpolationType, - rotation, - colormap, - }: StackViewportProperties, - suppressEvents?: boolean - ): void; - /** - * Retrieve the viewport default properties - */ - getDefaultProperties: (imageId?: string) => StackViewportProperties; - /** - * Retrieve the viewport properties - */ - getProperties: () => StackViewportProperties; - /** - * canvasToWorld Returns the world coordinates of the given `canvasPos` - * projected onto the plane defined by the `Viewport`'s camera. - */ - canvasToWorld: (canvasPos: Point2) => Point3; - /** - * Returns the canvas coordinates of the given `worldPos` - * projected onto the `Viewport`'s `canvas`. - */ - worldToCanvas: (worldPos: Point3) => Point2; - /** - * Returns the index of the imageId being renderer - */ - getCurrentImageIdIndex: () => number; - /** - * Returns the list of image Ids for the current viewport - */ - getImageIds: () => string[]; - /** - * Returns true if the viewport contains the imageId - */ - hasImageId: (imageId: string) => boolean; - /** - * Returns true if the viewport contains the imageURI - */ - hasImageURI: (imageURI: string) => boolean; - /** - * Returns the currently rendered imageId - */ - getCurrentImageId: () => string; - /** - * Add Image Slices actors to the viewport - */ - addImages( - stackInputs: Array, - immediateRender: boolean, - suppressEvents: boolean - ); - - getImageDataMetadata(image: IImage): any; - /** - * Custom rendering pipeline for the rendering for the CPU fallback - */ - customRenderViewportToCanvas: () => { - canvas: HTMLCanvasElement; - element: HTMLDivElement; - viewportId: string; - renderingEngineId: string; - }; - /** - * Returns the image and its properties that is being shown inside the - * stack viewport. It returns, the image dimensions, image direction, - * image scalar data, vtkImageData object, metadata, and scaling (e.g., PET suvbw) - */ - getImageData(): IImageData | CPUIImageData; - /** - * Returns the raw/loaded image being shown inside the stack viewport. - */ - getCornerstoneImage: () => IImage; - /** - * Reset the viewport properties to the his default values if possible - */ - resetToDefaultProperties(): void; - /** - * Reset the viewport properties to the default metadata values - */ - resetProperties(): void; - /** - * If the user has selected CPU rendering, return the CPU camera, otherwise - * return the default camera - */ - getCamera(): ICamera; - /** - * Set the camera based on the provided camera object. - */ - setCamera(cameraInterface: ICamera): void; - /** - * Sets the imageIds to be visualized inside the stack viewport. It accepts - * list of imageIds, the index of the first imageId to be viewed. It is a - * asynchronous function that returns a promise resolving to imageId being - * displayed in the stack viewport. - * - * @param retrieveConfiguration - Set this to a progressive retriever of your - * choice for progressive retrieval, or leave empty for non-progressive. - */ - setStack( - imageIds: Array, - currentImageIdIndex?: number - ): Promise; - /** - * Centers Pan and resets the zoom for stack viewport. - */ - resetCamera(resetPan?: boolean, resetZoom?: boolean): boolean; - /** - * Loads the image based on the provided imageIdIndex. It is an Async function which - * returns a promise that resolves to the imageId. - */ - setImageIdIndex(imageIdIndex: number): Promise; - /** - * Calibrates the image with new metadata that has been added for imageId. To calibrate - * a viewport, you should add your calibration data manually to - * calibratedPixelSpacingMetadataProvider and call viewport.calibrateSpacing - * for it get applied. - */ - calibrateSpacing(imageId: string): void; - /** - * If the renderer is CPU based, throw an error. Otherwise, returns the `vtkRenderer` responsible for rendering the `Viewport`. - */ - getRenderer(): any; - /** - * It sets the colormap to the default colormap. - */ - unsetColormap(): void; -} +export default IStackViewport; diff --git a/packages/core/src/utilities/getScalingParameters.ts b/packages/core/src/utilities/getScalingParameters.ts index cfa46e7652..a9b59d19e6 100644 --- a/packages/core/src/utilities/getScalingParameters.ts +++ b/packages/core/src/utilities/getScalingParameters.ts @@ -17,8 +17,8 @@ export default function getScalingParameters( const { modality } = generalSeriesModule; const scalingParameters = { - rescaleSlope: modalityLutModule.rescaleSlope, - rescaleIntercept: modalityLutModule.rescaleIntercept, + rescaleSlope: modalityLutModule.rescaleSlope || 1, + rescaleIntercept: modalityLutModule.rescaleIntercept ?? 0, modality, }; diff --git a/packages/core/src/utilities/loadImageToCanvas.ts b/packages/core/src/utilities/loadImageToCanvas.ts index da6e5270ba..db33a8ad45 100644 --- a/packages/core/src/utilities/loadImageToCanvas.ts +++ b/packages/core/src/utilities/loadImageToCanvas.ts @@ -1,4 +1,11 @@ -import type { IImage, ViewportInputOptions } from '../types'; +import type { + IImage, + ViewPresentation, + ViewReference, + ViewportInputOptions, + Point3, + IVolume, +} from '../types'; import { loadAndCacheImage } from '../loaders/imageLoader'; import * as metaData from '../metaData'; @@ -7,10 +14,52 @@ import imageLoadPoolManager from '../requestPool/imageLoadPoolManager'; import renderToCanvasGPU from './renderToCanvasGPU'; import renderToCanvasCPU from './renderToCanvasCPU'; import { getConfiguration } from '../init'; +import cache from '../cache'; -export interface LoadImageOptions { - canvas: HTMLCanvasElement; +/** + * The original load image options specified just an image id, which is optimal + * for things like thumbnails rendering a single image. + */ +export type StackLoadImageOptions = { imageId: string; +}; + +/** + * The full image load options allows specifying more parameters for both the + * presentation and the view so that a specific view can be referenced/displayed. + */ +export type FullImageLoadOptions = { + viewReference: ViewReference; + viewPresentation: ViewPresentation; + imageId: undefined; +}; + +/** + * The canvas load position allows for determining the rendered position of + * image data within the canvas, and can be used to map loaded canvas points + * to and from other viewport positions for things like external computations + * on the load image to canvas view and the viewport view (which may contain + * extraneous data such as segmentation and thus not be usable for external + * computations.) + */ +export type CanvasLoadPosition = { + origin: Point3; + topRight: Point3; + bottomLeft: Point3; + thicknessMm: number; +}; + +/** + * The image canvas can be loaded/set with various view conditions to specify the initial + * view as well as how and where ot render the image. + */ +export type LoadImageOptions = { + canvas: HTMLCanvasElement; + // Define the view specification as optional here, and then incorporate specific + // requirements in mix in types. + imageId?: string; + viewReference?: ViewReference; + viewPresentation?: ViewPresentation; requestType?: RequestType; priority?: number; renderingEngineId?: string; @@ -24,7 +73,7 @@ export interface LoadImageOptions { physicalPixels?: boolean; // Sets the viewport input options Defaults to scale to fit 110% viewportOptions?: ViewportInputOptions; -} +} & (StackLoadImageOptions | FullImageLoadOptions); /** * Loads and renders an imageId to a Canvas. It will use the GPU rendering pipeline @@ -46,55 +95,61 @@ export interface LoadImageOptions { * @param useCPURendering - Force the use of the CPU rendering pipeline (default to false) * @param thumbnail - Render a thumbnail image * @param imageAspect - assign the width based on the aspect ratio of the image - * @param physicalPixels - set the width/height to the physical pixel size * @returns - A promise that resolves when the image has been rendered with the imageId */ export default function loadImageToCanvas( options: LoadImageOptions -): Promise { +): Promise { const { canvas, imageId, + viewReference, requestType = RequestType.Thumbnail, priority = -5, renderingEngineId = '_thumbnails', useCPURendering = false, thumbnail = false, imageAspect = false, - physicalPixels = false, - viewportOptions, + viewportOptions: baseViewportOptions, } = options; + const volumeId = viewReference?.volumeId; + const isVolume = volumeId && !imageId; + const viewportOptions = + viewReference && baseViewportOptions + ? { ...baseViewportOptions, viewReference } + : baseViewportOptions; - const devicePixelRatio = window.devicePixelRatio || 1; const renderFn = useCPURendering ? renderToCanvasCPU : renderToCanvasGPU; return new Promise((resolve, reject) => { - function successCallback(image: IImage, imageId: string) { + function successCallback(imageOrVolume: IImage | IVolume, imageId: string) { const { modality } = metaData.get('generalSeriesModule', imageId) || {}; - image.isPreScaled = image.isPreScaled || image.preScale?.scaled; + const image = !isVolume && (imageOrVolume as IImage); + const volume = isVolume && (imageOrVolume as IVolume); + if (image) { + image.isPreScaled = image.isPreScaled || image.preScale?.scaled; + } if (thumbnail) { canvas.height = 256; canvas.width = 256; } - if (physicalPixels) { - canvas.width = canvas.offsetWidth * devicePixelRatio; - canvas.height = canvas.offsetHeight * devicePixelRatio; + if (imageAspect && image) { + canvas.width = image && (canvas.height * image.width) / image.height; } - if (imageAspect) { - canvas.width = (canvas.height * image.width) / image.height; + canvas.style.width = `${canvas.width / devicePixelRatio}px`; + canvas.style.height = `${canvas.height / devicePixelRatio}px`; + if (volume && useCPURendering) { + reject(new Error('CPU rendering of volume not supported')); } - renderFn( canvas, - image, + imageOrVolume, modality, renderingEngineId, viewportOptions - ).then(() => { - resolve(imageId); - }); + ).then(resolve); } function errorCallback(error: Error, imageId: string) { @@ -113,29 +168,35 @@ export default function loadImageToCanvas( ); } - const { useNorm16Texture, preferSizeOverAccuracy } = - getConfiguration().rendering; - const useNativeDataType = useNorm16Texture || preferSizeOverAccuracy; + const { useNorm16Texture } = getConfiguration().rendering; // IMPORTANT: Request type should be passed if not the 'interaction' // highest priority will be used for the request type in the imageRetrievalPool const options = { targetBuffer: { - type: useNativeDataType ? undefined : 'Float32Array', + type: useNorm16Texture ? undefined : 'Float32Array', }, preScale: { enabled: true, }, - useNativeDataType, useRGBA: !!useCPURendering, requestType, }; - imageLoadPoolManager.addRequest( - sendRequest.bind(null, imageId, null, options), - requestType, - { imageId }, - priority - ); + if (volumeId) { + const volume = cache.getVolume(volumeId) as unknown as IVolume; + if (!volume) { + reject(new Error(`Volume id ${volumeId} not found in cache`)); + } + const useImageId = volume.imageIds[0]; + successCallback(volume, useImageId); + } else { + imageLoadPoolManager.addRequest( + sendRequest.bind(null, imageId, null, options), + requestType, + { imageId }, + priority + ); + } }); } diff --git a/packages/core/src/utilities/renderToCanvasCPU.ts b/packages/core/src/utilities/renderToCanvasCPU.ts index 290077c54b..aeb9242d19 100644 --- a/packages/core/src/utilities/renderToCanvasCPU.ts +++ b/packages/core/src/utilities/renderToCanvasCPU.ts @@ -2,11 +2,13 @@ import { IImage, CPUFallbackEnabledElement, ViewportInputOptions, + IVolume, } from '../types'; import getDefaultViewport from '../RenderingEngine/helpers/cpuFallback/rendering/getDefaultViewport'; import calculateTransform from '../RenderingEngine/helpers/cpuFallback/rendering/calculateTransform'; import drawImageSync from '../RenderingEngine/helpers/cpuFallback/drawImageSync'; +import type { CanvasLoadPosition } from './loadImageToCanvas'; /** * Renders a cornerstone image object to a canvas. @@ -17,11 +19,16 @@ import drawImageSync from '../RenderingEngine/helpers/cpuFallback/drawImageSync' */ export default function renderToCanvasCPU( canvas: HTMLCanvasElement, - image: IImage, + imageOrVolume: IImage | IVolume, modality?: string, _renderingEngineId?: string, _viewportOptions?: ViewportInputOptions -): Promise { +): Promise { + const volume = imageOrVolume as IVolume; + if (volume.volumeId) { + throw new Error('Unsupported volume rendering for CPU'); + } + const image = imageOrVolume as IImage; const viewport = getDefaultViewport(canvas, image, modality); const enabledElement: CPUFallbackEnabledElement = { @@ -36,6 +43,6 @@ export default function renderToCanvasCPU( const invalidated = true; return new Promise((resolve, reject) => { drawImageSync(enabledElement, invalidated); - resolve(image.imageId); + resolve(null); }); } diff --git a/packages/core/src/utilities/renderToCanvasGPU.ts b/packages/core/src/utilities/renderToCanvasGPU.ts index 05ba18dc22..4bd4bbe3df 100644 --- a/packages/core/src/utilities/renderToCanvasGPU.ts +++ b/packages/core/src/utilities/renderToCanvasGPU.ts @@ -2,11 +2,18 @@ import getOrCreateCanvas, { EPSILON, } from '../RenderingEngine/helpers/getOrCreateCanvas'; import { ViewportType, Events } from '../enums'; -import StackViewport from '../RenderingEngine/StackViewport'; -import { IImage, ViewportInputOptions } from '../types'; +import { + IImage, + IStackViewport, + IVolume, + ViewportInputOptions, + IVolumeViewport, + ViewReference, +} from '../types'; import { getRenderingEngine } from '../RenderingEngine/getRenderingEngine'; import RenderingEngine from '../RenderingEngine'; import isPTPrescaledWithSUV from './isPTPrescaledWithSUV'; +import { CanvasLoadPosition } from './loadImageToCanvas'; /** * Renders an cornerstone image to a Canvas. This method will handle creation @@ -23,26 +30,33 @@ import isPTPrescaledWithSUV from './isPTPrescaledWithSUV'; * renderToCanvasGPU(canvas, image) * ``` * @param canvas - Canvas element to render to - * @param image - The image to render + * @param imageOrVolume - The image to render * @param modality - [Default = undefined] The modality of the image * @returns - A promise that resolves when the image has been rendered with the imageId */ export default function renderToCanvasGPU( canvas: HTMLCanvasElement, - image: IImage, + imageOrVolume: IImage | IVolume, modality = undefined, renderingEngineId = '_thumbnails', - viewportOptions: ViewportInputOptions = { displayArea: { imageArea: [1, 1] } } -): Promise { + viewportOptions: ViewportInputOptions & { viewReference?: ViewReference } = { + displayArea: { imageArea: [1, 1] }, + } +): Promise { if (!canvas || !(canvas instanceof HTMLCanvasElement)) { throw new Error('canvas element is required'); } - const imageIdToPrint = image.imageId; + const isVolume = !(imageOrVolume as IImage).imageId; + const image = !isVolume && (imageOrVolume as IImage); + const volume = isVolume && (imageOrVolume as IVolume); + const imageIdToPrint = image?.imageId || volume?.volumeId; const viewportId = `renderGPUViewport-${imageIdToPrint}`; - const imageId = image.imageId; const element = document.createElement('div'); const devicePixelRatio = window.devicePixelRatio || 1; + if (!viewportOptions.displayArea) { + viewportOptions.displayArea = { imageArea: [1, 1] }; + } const originalWidth = canvas.width; const originalHeight = canvas.height; // The canvas width/height are set by flooring the CSS size converted @@ -50,17 +64,12 @@ export default function renderToCanvasGPU( // isn't exact, and using the exact value sometimes leads to an off by 1 // in the actual size, so adding EPSILON to the size resolves // the problem. - element.style.width = `${originalWidth + EPSILON}px`; - element.style.height = `${originalHeight + EPSILON}px`; + // Don't touch the canvas size here as what we get out is a canvas at the right size + element.style.width = `${originalWidth / devicePixelRatio + EPSILON}px`; + element.style.height = `${originalHeight / devicePixelRatio + EPSILON}px`; element.style.visibility = 'hidden'; element.style.position = 'absolute'; - // Up-sampling the provided canvas to match the device pixel ratio - // since we use device pixel ratio to determine the size of the canvas - // inside the rendering engine. - canvas.width = originalWidth * devicePixelRatio; - canvas.height = originalHeight * devicePixelRatio; - document.body.appendChild(element); // add id to the element so we can find it later, and fix the : which is not allowed in css @@ -73,20 +82,20 @@ export default function renderToCanvasGPU( (getRenderingEngine(renderingEngineId) as RenderingEngine) || new RenderingEngine(renderingEngineId); - let viewport = renderingEngine.getViewport(viewportId) as StackViewport; + let viewport = renderingEngine.getViewport(viewportId); if (!viewport) { - const stackViewportInput = { + const viewportInput = { viewportId, - type: ViewportType.STACK, + type: isVolume ? ViewportType.ORTHOGRAPHIC : ViewportType.STACK, element, defaultOptions: { ...viewportOptions, suppressEvents: true, }, }; - renderingEngine.enableElement(stackViewportInput); - viewport = renderingEngine.getViewport(viewportId) as StackViewport; + renderingEngine.enableElement(viewportInput); + viewport = renderingEngine.getViewport(viewportId); } return new Promise((resolve) => { @@ -94,11 +103,20 @@ export default function renderToCanvasGPU( // enable it and later disable it without losing the canvas context let elementRendered = false; + let { viewReference } = viewportOptions; + // Create a named function to handle the event const onImageRendered = (eventDetail) => { if (elementRendered) { return; } + if (viewReference) { + const useViewRef = viewReference; + viewReference = null; + viewport.setViewReference(useViewRef); + viewport.render(); + return; + } // Copy the temporary canvas to the given canvas const context = canvas.getContext('2d'); @@ -114,6 +132,16 @@ export default function renderToCanvasGPU( canvas.height // destination dimensions ); + const origin = viewport.canvasToWorld([0, 0]); + const topRight = viewport.canvasToWorld([ + temporaryCanvas.width / devicePixelRatio, + 0, + ]); + const bottomLeft = viewport.canvasToWorld([ + 0, + temporaryCanvas.height / devicePixelRatio, + ]); + const thicknessMm = 1; elementRendered = true; // remove based on id @@ -135,17 +163,26 @@ export default function renderToCanvasGPU( element.remove(); }); }, 0); - resolve(imageId); + resolve({ + origin, + bottomLeft, + topRight, + thicknessMm, + }); }; element.addEventListener(Events.IMAGE_RENDERED, onImageRendered); - viewport.renderImageObject(image); + if (isVolume) { + (viewport as IVolumeViewport).setVolumes([volume], false, true); + } else { + (viewport as IStackViewport).renderImageObject(imageOrVolume); + } // force a reset camera to center the image and undo the small scaling viewport.resetCamera(); if (modality === 'PT' && !isPTPrescaledWithSUV(image)) { - viewport.setProperties({ + (viewport as IStackViewport).setProperties({ voiRange: { lower: image.minPixelValue, upper: image.maxPixelValue, diff --git a/packages/core/test/renderToCanvas_gpu_test.js b/packages/core/test/renderToCanvas_gpu_test.js index 96aaff1efe..8228f8e497 100644 --- a/packages/core/test/renderToCanvas_gpu_test.js +++ b/packages/core/test/renderToCanvas_gpu_test.js @@ -101,7 +101,11 @@ describe('renderToCanvas -- GPU', () => { try { utilities - .loadImageToCanvas({ canvas, imageId, viewportOptions: {} }) + .loadImageToCanvas({ + canvas, + imageId, + viewportOptions: { displayArea: {} }, + }) .then(() => { vp.setStack([imageId], 0).then(() => { vp.setProperties({ interpolationType: InterpolationType.NEAREST }); @@ -205,7 +209,11 @@ describe('renderToCanvas -- GPU', () => { try { utilities - .loadImageToCanvas({ canvas, imageId, viewportOptions: {} }) + .loadImageToCanvas({ + canvas, + imageId, + viewportOptions: { displayArea: {} }, + }) .then(() => { vp.setStack([imageId], 0).then(() => { vp.setProperties({ interpolationType: InterpolationType.NEAREST }); diff --git a/packages/streaming-image-volume-loader/src/helpers/splitImageIdsBy4DTags.ts b/packages/streaming-image-volume-loader/src/helpers/splitImageIdsBy4DTags.ts index c2a2719fb8..4792d3104d 100644 --- a/packages/streaming-image-volume-loader/src/helpers/splitImageIdsBy4DTags.ts +++ b/packages/streaming-image-volume-loader/src/helpers/splitImageIdsBy4DTags.ts @@ -122,7 +122,8 @@ function getPhilipsPrivateBValue(imageId: string) { function getSiemensPrivateBValue(imageId: string) { // Siemens Private Diffusion B-factor tag (0019, 100c) // Private creator: SIEMENS MR HEADER, VR=IS, VM=1 - let value = metaData.get('0019100c', imageId) || metaData.get('0019100C', imageId); + let value = + metaData.get('0019100c', imageId) || metaData.get('0019100C', imageId); try { const { InlineBinary } = value; diff --git a/packages/tools/src/eventListeners/segmentation/imageChangeEventListener.ts b/packages/tools/src/eventListeners/segmentation/imageChangeEventListener.ts index 4dea56778b..1dbd9362b6 100644 --- a/packages/tools/src/eventListeners/segmentation/imageChangeEventListener.ts +++ b/packages/tools/src/eventListeners/segmentation/imageChangeEventListener.ts @@ -212,33 +212,29 @@ function _imageChangeEventListener(evt) { // I tried calling modified on everything, but seems like we should remove // and add the actor again below viewport.removeActors([actor.uid]); - viewport.addImages( - [ - { - imageId: derivedImageId, - actorUID: actor.uid, - callback: ({ imageActor }) => { - const scalarArray = vtkDataArray.newInstance({ - name: 'Pixels', - numberOfComponents: 1, - values: [...derivedImage.getPixelData()], - }); - - const imageData = vtkImageData.newInstance(); - - imageData.setDimensions(dimensions[0], dimensions[1], 1); - imageData.setSpacing(spacing); - imageData.setDirection(direction); - imageData.setOrigin(originToUse); - imageData.getPointData().setScalars(scalarArray); - - imageActor.getMapper().setInputData(imageData); - }, + viewport.addImages([ + { + imageId: derivedImageId, + actorUID: actor.uid, + callback: ({ imageActor }) => { + const scalarArray = vtkDataArray.newInstance({ + name: 'Pixels', + numberOfComponents: 1, + values: [...derivedImage.getPixelData()], + }); + + const imageData = vtkImageData.newInstance(); + + imageData.setDimensions(dimensions[0], dimensions[1], 1); + imageData.setSpacing(spacing); + imageData.setDirection(direction); + imageData.setOrigin(originToUse); + imageData.getPointData().setScalars(scalarArray); + + imageActor.getMapper().setInputData(imageData); }, - ], - true, - false - ); + }, + ]); triggerSegmentationRender(toolGroup.id); return; diff --git a/packages/tools/src/tools/displayTools/Labelmap/addLabelmapToElement.ts b/packages/tools/src/tools/displayTools/Labelmap/addLabelmapToElement.ts index 5f176030c3..ae3e57824c 100644 --- a/packages/tools/src/tools/displayTools/Labelmap/addLabelmapToElement.ts +++ b/packages/tools/src/tools/displayTools/Labelmap/addLabelmapToElement.ts @@ -73,13 +73,7 @@ async function addLabelmapToElement( ]; // Add labelmap volumes to the viewports to be be rendered, but not force the render - await addImageSlicesToViewports( - renderingEngine, - stackInputs, - [viewportId], - immediateRender, - suppressEvents - ); + await addImageSlicesToViewports(renderingEngine, stackInputs, [viewportId]); } } diff --git a/utils/demo/helpers/addLabelToToolbar.ts b/utils/demo/helpers/addLabelToToolbar.ts index 63c4304944..67ad639593 100644 --- a/utils/demo/helpers/addLabelToToolbar.ts +++ b/utils/demo/helpers/addLabelToToolbar.ts @@ -11,7 +11,7 @@ interface configLabel extends configElement { export default function addLabelToToolbar( config: configLabel ): HTMLLabelElement { - config = csUtilities.deepMerge(config, config.merge); + config = csUtilities.deepMerge(config, config.merge || {}); config.container = config.container ?? document.getElementById('demo-toolbar'); From fb8a592ade66c98ba9c3c1a2bdee3927f3ffabdd Mon Sep 17 00:00:00 2001 From: ohif-bot Date: Tue, 28 May 2024 16:34:51 +0000 Subject: [PATCH 10/14] chore(version): version.json [skip ci] --- commit.txt | 2 +- packages/adapters/package.json | 6 +++--- packages/dicomImageLoader/package.json | 2 +- packages/docs/package.json | 12 ++++++------ packages/nifti-volume-loader/package.json | 2 +- packages/streaming-image-volume-loader/package.json | 2 +- packages/tools/package.json | 2 +- version.json | 4 ++-- version.txt | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/commit.txt b/commit.txt index 63eb8ec871..373f16af27 100644 --- a/commit.txt +++ b/commit.txt @@ -1 +1 @@ -9637dfbb64eeb39d92c979d5922604079847b1e9 \ No newline at end of file +e4002774bcedeb2334d008cb3ab3e294ff1c088b \ No newline at end of file diff --git a/packages/adapters/package.json b/packages/adapters/package.json index 85c5305540..1dcc7c39c0 100644 --- a/packages/adapters/package.json +++ b/packages/adapters/package.json @@ -42,7 +42,7 @@ "homepage": "https://github.com/cornerstonejs/cornerstone3D/blob/main/packages/adapters/README.md", "dependencies": { "@babel/runtime-corejs2": "^7.17.8", - "@cornerstonejs/tools": "^1.75.2", + "@cornerstonejs/tools": "^1.76.0", "buffer": "^6.0.3", "dcmjs": "^0.29.8", "gl-matrix": "^3.4.3", @@ -50,7 +50,7 @@ "ndarray": "^1.0.19" }, "devDependencies": { - "@cornerstonejs/core": "^1.75.2", - "@cornerstonejs/streaming-image-volume-loader": "^1.75.2" + "@cornerstonejs/core": "^1.76.0", + "@cornerstonejs/streaming-image-volume-loader": "^1.76.0" } } diff --git a/packages/dicomImageLoader/package.json b/packages/dicomImageLoader/package.json index bbf4ca33e8..e9cc33244d 100644 --- a/packages/dicomImageLoader/package.json +++ b/packages/dicomImageLoader/package.json @@ -66,7 +66,7 @@ "@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2", "@cornerstonejs/codec-openjpeg": "^1.2.2", "@cornerstonejs/codec-openjph": "^2.4.5", - "@cornerstonejs/core": "^1.75.2", + "@cornerstonejs/core": "^1.76.0", "dicom-parser": "^1.8.9", "pako": "^2.0.4", "uuid": "^9.0.0" diff --git a/packages/docs/package.json b/packages/docs/package.json index f3617bc788..8e16101251 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -29,12 +29,12 @@ "write-heading-ids": "docusaurus write-heading-ids" }, "dependencies": { - "@cornerstonejs/adapters": "^1.75.2", - "@cornerstonejs/core": "^1.75.2", - "@cornerstonejs/dicom-image-loader": "^1.75.2", - "@cornerstonejs/nifti-volume-loader": "^1.75.2", - "@cornerstonejs/streaming-image-volume-loader": "^1.75.2", - "@cornerstonejs/tools": "^1.75.2", + "@cornerstonejs/adapters": "^1.76.0", + "@cornerstonejs/core": "^1.76.0", + "@cornerstonejs/dicom-image-loader": "^1.76.0", + "@cornerstonejs/nifti-volume-loader": "^1.76.0", + "@cornerstonejs/streaming-image-volume-loader": "^1.76.0", + "@cornerstonejs/tools": "^1.76.0", "@docusaurus/core": "2.3.1", "@docusaurus/module-type-aliases": "2.3.1", "@docusaurus/plugin-google-gtag": "2.3.1", diff --git a/packages/nifti-volume-loader/package.json b/packages/nifti-volume-loader/package.json index a9120aadd4..29268c3be3 100644 --- a/packages/nifti-volume-loader/package.json +++ b/packages/nifti-volume-loader/package.json @@ -29,7 +29,7 @@ "webpack:watch": "webpack --mode development --progress --watch --config ./.webpack/webpack.dev.js" }, "dependencies": { - "@cornerstonejs/core": "^1.75.2", + "@cornerstonejs/core": "^1.76.0", "nifti-reader-js": "^0.6.6" }, "contributors": [ diff --git a/packages/streaming-image-volume-loader/package.json b/packages/streaming-image-volume-loader/package.json index 64328d2c61..8afac647c5 100644 --- a/packages/streaming-image-volume-loader/package.json +++ b/packages/streaming-image-volume-loader/package.json @@ -29,7 +29,7 @@ "webpack:watch": "webpack --mode development --progress --watch --config ./.webpack/webpack.dev.js" }, "dependencies": { - "@cornerstonejs/core": "^1.75.2", + "@cornerstonejs/core": "^1.76.0", "comlink": "^4.4.1" }, "contributors": [ diff --git a/packages/tools/package.json b/packages/tools/package.json index f36aa02c74..60264b2e52 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -29,7 +29,7 @@ "webpack:watch": "webpack --mode development --progress --watch --config ./.webpack/webpack.dev.js" }, "dependencies": { - "@cornerstonejs/core": "^1.75.2", + "@cornerstonejs/core": "^1.76.0", "@icr/polyseg-wasm": "0.4.0", "@types/offscreencanvas": "2019.7.3", "comlink": "^4.4.1", diff --git a/version.json b/version.json index 5780a416ac..522d889e04 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "version": "1.75.2", - "commit": "9637dfbb64eeb39d92c979d5922604079847b1e9" + "version": "1.76.0", + "commit": "e4002774bcedeb2334d008cb3ab3e294ff1c088b" } \ No newline at end of file diff --git a/version.txt b/version.txt index de4cb2b779..1f3171c78f 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.75.2 \ No newline at end of file +1.76.0 \ No newline at end of file From 97c7f819997bdff7dda77b94e99c5ae2f7502fc5 Mon Sep 17 00:00:00 2001 From: ohif-bot Date: Tue, 28 May 2024 16:35:07 +0000 Subject: [PATCH 11/14] chore(version): Update package versions [skip ci] --- CHANGELOG.md | 6 ++++++ lerna.json | 2 +- packages/adapters/CHANGELOG.md | 4 ++++ packages/adapters/package.json | 2 +- packages/core/CHANGELOG.md | 6 ++++++ packages/core/package.json | 2 +- packages/dicomImageLoader/CHANGELOG.md | 4 ++++ packages/dicomImageLoader/package.json | 2 +- packages/docs/CHANGELOG.md | 4 ++++ packages/docs/package.json | 2 +- packages/nifti-volume-loader/CHANGELOG.md | 4 ++++ packages/nifti-volume-loader/package.json | 2 +- packages/streaming-image-volume-loader/CHANGELOG.md | 6 ++++++ packages/streaming-image-volume-loader/package.json | 2 +- packages/tools/CHANGELOG.md | 6 ++++++ packages/tools/package.json | 2 +- 16 files changed, 48 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ab752fd17..987b3b1279 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.76.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.2...v1.76.0) (2024-05-28) + +### Features + +- Add render to canvas for mpr/volume viewports ([#1215](https://github.com/cornerstonejs/cornerstone3D/issues/1215)) ([e400277](https://github.com/cornerstonejs/cornerstone3D/commit/e4002774bcedeb2334d008cb3ab3e294ff1c088b)) + ## [1.75.2](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.1...v1.75.2) (2024-05-28) ### Bug Fixes diff --git a/lerna.json b/lerna.json index 592406e845..88c373fea8 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.75.2", + "version": "1.76.0", "packages": [ "packages/adapters", "packages/core", diff --git a/packages/adapters/CHANGELOG.md b/packages/adapters/CHANGELOG.md index 89f5c7545b..0563066801 100644 --- a/packages/adapters/CHANGELOG.md +++ b/packages/adapters/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.76.0](https://github.com/dcmjs-org/dcmjs/compare/v1.75.2...v1.76.0) (2024-05-28) + +**Note:** Version bump only for package @cornerstonejs/adapters + ## [1.75.2](https://github.com/dcmjs-org/dcmjs/compare/v1.75.1...v1.75.2) (2024-05-28) **Note:** Version bump only for package @cornerstonejs/adapters diff --git a/packages/adapters/package.json b/packages/adapters/package.json index 1dcc7c39c0..4b577ccea2 100644 --- a/packages/adapters/package.json +++ b/packages/adapters/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/adapters", - "version": "1.75.2", + "version": "1.76.0", "description": "Adapters for Cornerstone3D to/from formats including DICOM SR and others", "src": "src/index.ts", "main": "./dist/@cornerstonejs/adapters.es.js", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 08f265ab36..afcf741a4e 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.76.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.2...v1.76.0) (2024-05-28) + +### Features + +- Add render to canvas for mpr/volume viewports ([#1215](https://github.com/cornerstonejs/cornerstone3D/issues/1215)) ([e400277](https://github.com/cornerstonejs/cornerstone3D/commit/e4002774bcedeb2334d008cb3ab3e294ff1c088b)) + ## [1.75.2](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.1...v1.75.2) (2024-05-28) ### Bug Fixes diff --git a/packages/core/package.json b/packages/core/package.json index d5e17a353a..c278260d70 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/core", - "version": "1.75.2", + "version": "1.76.0", "description": "", "main": "src/index.ts", "types": "dist/types/index.d.ts", diff --git a/packages/dicomImageLoader/CHANGELOG.md b/packages/dicomImageLoader/CHANGELOG.md index 91bc7933e7..4b10aeb096 100644 --- a/packages/dicomImageLoader/CHANGELOG.md +++ b/packages/dicomImageLoader/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.76.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.2...v1.76.0) (2024-05-28) + +**Note:** Version bump only for package @cornerstonejs/dicom-image-loader + ## [1.75.2](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.1...v1.75.2) (2024-05-28) **Note:** Version bump only for package @cornerstonejs/dicom-image-loader diff --git a/packages/dicomImageLoader/package.json b/packages/dicomImageLoader/package.json index e9cc33244d..3ec5d1efe8 100644 --- a/packages/dicomImageLoader/package.json +++ b/packages/dicomImageLoader/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/dicom-image-loader", - "version": "1.75.2", + "version": "1.76.0", "description": "Cornerstone Image Loader for DICOM WADO-URI and WADO-RS and Local file", "keywords": [ "DICOM", diff --git a/packages/docs/CHANGELOG.md b/packages/docs/CHANGELOG.md index 6de7b57559..7bc85fb3dd 100644 --- a/packages/docs/CHANGELOG.md +++ b/packages/docs/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.76.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.2...v1.76.0) (2024-05-28) + +**Note:** Version bump only for package docs + ## [1.75.2](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.1...v1.75.2) (2024-05-28) **Note:** Version bump only for package docs diff --git a/packages/docs/package.json b/packages/docs/package.json index 8e16101251..2cda577378 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -1,6 +1,6 @@ { "name": "docs", - "version": "1.75.2", + "version": "1.76.0", "private": true, "repository": "https://github.com/cornerstonejs/cornerstone3D", "scripts": { diff --git a/packages/nifti-volume-loader/CHANGELOG.md b/packages/nifti-volume-loader/CHANGELOG.md index 6ad385257e..a2bf8e2785 100644 --- a/packages/nifti-volume-loader/CHANGELOG.md +++ b/packages/nifti-volume-loader/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.76.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.2...v1.76.0) (2024-05-28) + +**Note:** Version bump only for package @cornerstonejs/nifti-volume-loader + ## [1.75.2](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.1...v1.75.2) (2024-05-28) **Note:** Version bump only for package @cornerstonejs/nifti-volume-loader diff --git a/packages/nifti-volume-loader/package.json b/packages/nifti-volume-loader/package.json index 29268c3be3..bd9f99efa2 100644 --- a/packages/nifti-volume-loader/package.json +++ b/packages/nifti-volume-loader/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/nifti-volume-loader", - "version": "1.75.2", + "version": "1.76.0", "description": "", "main": "dist/umd/index.js", "types": "dist/esm/index.d.ts", diff --git a/packages/streaming-image-volume-loader/CHANGELOG.md b/packages/streaming-image-volume-loader/CHANGELOG.md index 5a7ee67e14..4633aed908 100644 --- a/packages/streaming-image-volume-loader/CHANGELOG.md +++ b/packages/streaming-image-volume-loader/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.76.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.2...v1.76.0) (2024-05-28) + +### Features + +- Add render to canvas for mpr/volume viewports ([#1215](https://github.com/cornerstonejs/cornerstone3D/issues/1215)) ([e400277](https://github.com/cornerstonejs/cornerstone3D/commit/e4002774bcedeb2334d008cb3ab3e294ff1c088b)) + ## [1.75.2](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.1...v1.75.2) (2024-05-28) **Note:** Version bump only for package @cornerstonejs/streaming-image-volume-loader diff --git a/packages/streaming-image-volume-loader/package.json b/packages/streaming-image-volume-loader/package.json index 8afac647c5..bcb9ff137a 100644 --- a/packages/streaming-image-volume-loader/package.json +++ b/packages/streaming-image-volume-loader/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/streaming-image-volume-loader", - "version": "1.75.2", + "version": "1.76.0", "description": "", "main": "src/index.ts", "types": "dist/esm/index.d.ts", diff --git a/packages/tools/CHANGELOG.md b/packages/tools/CHANGELOG.md index 1cd0ff6f81..dea60c812e 100644 --- a/packages/tools/CHANGELOG.md +++ b/packages/tools/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.76.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.2...v1.76.0) (2024-05-28) + +### Features + +- Add render to canvas for mpr/volume viewports ([#1215](https://github.com/cornerstonejs/cornerstone3D/issues/1215)) ([e400277](https://github.com/cornerstonejs/cornerstone3D/commit/e4002774bcedeb2334d008cb3ab3e294ff1c088b)) + ## [1.75.2](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.1...v1.75.2) (2024-05-28) **Note:** Version bump only for package @cornerstonejs/tools diff --git a/packages/tools/package.json b/packages/tools/package.json index 60264b2e52..c4328852ca 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/tools", - "version": "1.75.2", + "version": "1.76.0", "description": "Cornerstone3D Tools", "main": "src/index.ts", "types": "dist/types/index.d.ts", From d68d6d0c4b9c7b18b794ccac90695b79ac87fc30 Mon Sep 17 00:00:00 2001 From: Celian-abd <101793092+Celian-abd@users.noreply.github.com> Date: Tue, 28 May 2024 18:42:02 +0200 Subject: [PATCH 12/14] fix(multiframes) add spacingBetweenSlices property for multiframes dicom (#1285) --- .../src/utilities/sortImageIdsAndGetSpacing.ts | 18 ++++++++++++------ .../wadors/metaData/metaDataProvider.ts | 1 + 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/core/src/utilities/sortImageIdsAndGetSpacing.ts b/packages/core/src/utilities/sortImageIdsAndGetSpacing.ts index 938bd31828..3ceff780c5 100644 --- a/packages/core/src/utilities/sortImageIdsAndGetSpacing.ts +++ b/packages/core/src/utilities/sortImageIdsAndGetSpacing.ts @@ -142,10 +142,11 @@ export default function sortImageIdsAndGetSpacing( Math.floor(imageIds.length / 2); } - const { imagePositionPatient: origin, sliceThickness } = metaData.get( - 'imagePlaneModule', - sortedImageIds[0] - ); + const { + imagePositionPatient: origin, + sliceThickness, + spacingBetweenSlices, + } = metaData.get('imagePlaneModule', sortedImageIds[0]); const { strictZSpacingForVolumeViewport } = getConfiguration().rendering; @@ -154,8 +155,13 @@ export default function sortImageIdsAndGetSpacing( // If possible, we use the sliceThickness, but we warn about this dicom file // weirdness. If sliceThickness is not available, we set to 1 just to render if (zSpacing === 0 && !strictZSpacingForVolumeViewport) { - if (sliceThickness) { - console.log('Could not calculate zSpacing. Using sliceThickness'); + if (sliceThickness && spacingBetweenSlices) { + console.log('Could not calculate zSpacing. Using spacingBetweenSlices'); + zSpacing = spacingBetweenSlices; + } else if (sliceThickness) { + console.log( + 'Could not calculate zSpacing and no spacingBetweenSlices. Using sliceThickness' + ); zSpacing = sliceThickness; } else { console.log( diff --git a/packages/dicomImageLoader/src/imageLoader/wadors/metaData/metaDataProvider.ts b/packages/dicomImageLoader/src/imageLoader/wadors/metaData/metaDataProvider.ts index 6ed42803fd..79a19f1a1c 100644 --- a/packages/dicomImageLoader/src/imageLoader/wadors/metaData/metaDataProvider.ts +++ b/packages/dicomImageLoader/src/imageLoader/wadors/metaData/metaDataProvider.ts @@ -133,6 +133,7 @@ function metaDataProvider(type, imageId) { imageOrientationPatient: extractOrientationFromMetadata(metaData), imagePositionPatient: extractPositionFromMetadata(metaData), sliceThickness: getNumberValue(metaData['00180050']), + spacingBetweenSlices: getNumberValue(metaData['00180088']), pixelSpacing: getNumberValues(metaData['00280030'], 2), numberOfFrames: getNumberValue(metaData['00280008']), isNMReconstructable: From bebc8fb60e53d45ee58366ee03bf55409282bf45 Mon Sep 17 00:00:00 2001 From: ohif-bot Date: Tue, 28 May 2024 16:51:41 +0000 Subject: [PATCH 13/14] chore(version): version.json [skip ci] --- commit.txt | 2 +- packages/adapters/package.json | 6 +++--- packages/dicomImageLoader/package.json | 2 +- packages/docs/package.json | 12 ++++++------ packages/nifti-volume-loader/package.json | 2 +- packages/streaming-image-volume-loader/package.json | 2 +- packages/tools/package.json | 2 +- version.json | 4 ++-- version.txt | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/commit.txt b/commit.txt index 373f16af27..bdee5588de 100644 --- a/commit.txt +++ b/commit.txt @@ -1 +1 @@ -e4002774bcedeb2334d008cb3ab3e294ff1c088b \ No newline at end of file +d68d6d0c4b9c7b18b794ccac90695b79ac87fc30 \ No newline at end of file diff --git a/packages/adapters/package.json b/packages/adapters/package.json index 4b577ccea2..f4d0ac166e 100644 --- a/packages/adapters/package.json +++ b/packages/adapters/package.json @@ -42,7 +42,7 @@ "homepage": "https://github.com/cornerstonejs/cornerstone3D/blob/main/packages/adapters/README.md", "dependencies": { "@babel/runtime-corejs2": "^7.17.8", - "@cornerstonejs/tools": "^1.76.0", + "@cornerstonejs/tools": "^1.76.1", "buffer": "^6.0.3", "dcmjs": "^0.29.8", "gl-matrix": "^3.4.3", @@ -50,7 +50,7 @@ "ndarray": "^1.0.19" }, "devDependencies": { - "@cornerstonejs/core": "^1.76.0", - "@cornerstonejs/streaming-image-volume-loader": "^1.76.0" + "@cornerstonejs/core": "^1.76.1", + "@cornerstonejs/streaming-image-volume-loader": "^1.76.1" } } diff --git a/packages/dicomImageLoader/package.json b/packages/dicomImageLoader/package.json index 3ec5d1efe8..7a0fb1c047 100644 --- a/packages/dicomImageLoader/package.json +++ b/packages/dicomImageLoader/package.json @@ -66,7 +66,7 @@ "@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2", "@cornerstonejs/codec-openjpeg": "^1.2.2", "@cornerstonejs/codec-openjph": "^2.4.5", - "@cornerstonejs/core": "^1.76.0", + "@cornerstonejs/core": "^1.76.1", "dicom-parser": "^1.8.9", "pako": "^2.0.4", "uuid": "^9.0.0" diff --git a/packages/docs/package.json b/packages/docs/package.json index 2cda577378..14b7bd5a9d 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -29,12 +29,12 @@ "write-heading-ids": "docusaurus write-heading-ids" }, "dependencies": { - "@cornerstonejs/adapters": "^1.76.0", - "@cornerstonejs/core": "^1.76.0", - "@cornerstonejs/dicom-image-loader": "^1.76.0", - "@cornerstonejs/nifti-volume-loader": "^1.76.0", - "@cornerstonejs/streaming-image-volume-loader": "^1.76.0", - "@cornerstonejs/tools": "^1.76.0", + "@cornerstonejs/adapters": "^1.76.1", + "@cornerstonejs/core": "^1.76.1", + "@cornerstonejs/dicom-image-loader": "^1.76.1", + "@cornerstonejs/nifti-volume-loader": "^1.76.1", + "@cornerstonejs/streaming-image-volume-loader": "^1.76.1", + "@cornerstonejs/tools": "^1.76.1", "@docusaurus/core": "2.3.1", "@docusaurus/module-type-aliases": "2.3.1", "@docusaurus/plugin-google-gtag": "2.3.1", diff --git a/packages/nifti-volume-loader/package.json b/packages/nifti-volume-loader/package.json index bd9f99efa2..9eb82c60d8 100644 --- a/packages/nifti-volume-loader/package.json +++ b/packages/nifti-volume-loader/package.json @@ -29,7 +29,7 @@ "webpack:watch": "webpack --mode development --progress --watch --config ./.webpack/webpack.dev.js" }, "dependencies": { - "@cornerstonejs/core": "^1.76.0", + "@cornerstonejs/core": "^1.76.1", "nifti-reader-js": "^0.6.6" }, "contributors": [ diff --git a/packages/streaming-image-volume-loader/package.json b/packages/streaming-image-volume-loader/package.json index bcb9ff137a..626de2674c 100644 --- a/packages/streaming-image-volume-loader/package.json +++ b/packages/streaming-image-volume-loader/package.json @@ -29,7 +29,7 @@ "webpack:watch": "webpack --mode development --progress --watch --config ./.webpack/webpack.dev.js" }, "dependencies": { - "@cornerstonejs/core": "^1.76.0", + "@cornerstonejs/core": "^1.76.1", "comlink": "^4.4.1" }, "contributors": [ diff --git a/packages/tools/package.json b/packages/tools/package.json index c4328852ca..114091f982 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -29,7 +29,7 @@ "webpack:watch": "webpack --mode development --progress --watch --config ./.webpack/webpack.dev.js" }, "dependencies": { - "@cornerstonejs/core": "^1.76.0", + "@cornerstonejs/core": "^1.76.1", "@icr/polyseg-wasm": "0.4.0", "@types/offscreencanvas": "2019.7.3", "comlink": "^4.4.1", diff --git a/version.json b/version.json index 522d889e04..85b5e5f6d8 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "version": "1.76.0", - "commit": "e4002774bcedeb2334d008cb3ab3e294ff1c088b" + "version": "1.76.1", + "commit": "d68d6d0c4b9c7b18b794ccac90695b79ac87fc30" } \ No newline at end of file diff --git a/version.txt b/version.txt index 1f3171c78f..a23344b18f 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.76.0 \ No newline at end of file +1.76.1 \ No newline at end of file From be9803cb19c0a08fb4b1765ed1e51244e57f2bfb Mon Sep 17 00:00:00 2001 From: ohif-bot Date: Tue, 28 May 2024 16:51:55 +0000 Subject: [PATCH 14/14] chore(version): Update package versions [skip ci] --- CHANGELOG.md | 4 ++++ lerna.json | 2 +- packages/adapters/CHANGELOG.md | 4 ++++ packages/adapters/package.json | 2 +- packages/core/CHANGELOG.md | 4 ++++ packages/core/package.json | 2 +- packages/dicomImageLoader/CHANGELOG.md | 4 ++++ packages/dicomImageLoader/package.json | 2 +- packages/docs/CHANGELOG.md | 4 ++++ packages/docs/package.json | 2 +- packages/nifti-volume-loader/CHANGELOG.md | 4 ++++ packages/nifti-volume-loader/package.json | 2 +- packages/streaming-image-volume-loader/CHANGELOG.md | 4 ++++ packages/streaming-image-volume-loader/package.json | 2 +- packages/tools/CHANGELOG.md | 4 ++++ packages/tools/package.json | 2 +- 16 files changed, 40 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 987b3b1279..f041ac44a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.76.1](https://github.com/cornerstonejs/cornerstone3D/compare/v1.76.0...v1.76.1) (2024-05-28) + +**Note:** Version bump only for package root + # [1.76.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.2...v1.76.0) (2024-05-28) ### Features diff --git a/lerna.json b/lerna.json index 88c373fea8..73146b3c58 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.76.0", + "version": "1.76.1", "packages": [ "packages/adapters", "packages/core", diff --git a/packages/adapters/CHANGELOG.md b/packages/adapters/CHANGELOG.md index 0563066801..24405a93fd 100644 --- a/packages/adapters/CHANGELOG.md +++ b/packages/adapters/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.76.1](https://github.com/dcmjs-org/dcmjs/compare/v1.76.0...v1.76.1) (2024-05-28) + +**Note:** Version bump only for package @cornerstonejs/adapters + # [1.76.0](https://github.com/dcmjs-org/dcmjs/compare/v1.75.2...v1.76.0) (2024-05-28) **Note:** Version bump only for package @cornerstonejs/adapters diff --git a/packages/adapters/package.json b/packages/adapters/package.json index f4d0ac166e..b767a8ea88 100644 --- a/packages/adapters/package.json +++ b/packages/adapters/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/adapters", - "version": "1.76.0", + "version": "1.76.1", "description": "Adapters for Cornerstone3D to/from formats including DICOM SR and others", "src": "src/index.ts", "main": "./dist/@cornerstonejs/adapters.es.js", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index afcf741a4e..7ab5bf85e0 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.76.1](https://github.com/cornerstonejs/cornerstone3D/compare/v1.76.0...v1.76.1) (2024-05-28) + +**Note:** Version bump only for package @cornerstonejs/core + # [1.76.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.2...v1.76.0) (2024-05-28) ### Features diff --git a/packages/core/package.json b/packages/core/package.json index c278260d70..287fab947a 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/core", - "version": "1.76.0", + "version": "1.76.1", "description": "", "main": "src/index.ts", "types": "dist/types/index.d.ts", diff --git a/packages/dicomImageLoader/CHANGELOG.md b/packages/dicomImageLoader/CHANGELOG.md index 4b10aeb096..ebf35613b1 100644 --- a/packages/dicomImageLoader/CHANGELOG.md +++ b/packages/dicomImageLoader/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.76.1](https://github.com/cornerstonejs/cornerstone3D/compare/v1.76.0...v1.76.1) (2024-05-28) + +**Note:** Version bump only for package @cornerstonejs/dicom-image-loader + # [1.76.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.2...v1.76.0) (2024-05-28) **Note:** Version bump only for package @cornerstonejs/dicom-image-loader diff --git a/packages/dicomImageLoader/package.json b/packages/dicomImageLoader/package.json index 7a0fb1c047..94d6c8ccde 100644 --- a/packages/dicomImageLoader/package.json +++ b/packages/dicomImageLoader/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/dicom-image-loader", - "version": "1.76.0", + "version": "1.76.1", "description": "Cornerstone Image Loader for DICOM WADO-URI and WADO-RS and Local file", "keywords": [ "DICOM", diff --git a/packages/docs/CHANGELOG.md b/packages/docs/CHANGELOG.md index 7bc85fb3dd..c9c6b84631 100644 --- a/packages/docs/CHANGELOG.md +++ b/packages/docs/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.76.1](https://github.com/cornerstonejs/cornerstone3D/compare/v1.76.0...v1.76.1) (2024-05-28) + +**Note:** Version bump only for package docs + # [1.76.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.2...v1.76.0) (2024-05-28) **Note:** Version bump only for package docs diff --git a/packages/docs/package.json b/packages/docs/package.json index 14b7bd5a9d..4f22ffc0cb 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -1,6 +1,6 @@ { "name": "docs", - "version": "1.76.0", + "version": "1.76.1", "private": true, "repository": "https://github.com/cornerstonejs/cornerstone3D", "scripts": { diff --git a/packages/nifti-volume-loader/CHANGELOG.md b/packages/nifti-volume-loader/CHANGELOG.md index a2bf8e2785..fb3caabe91 100644 --- a/packages/nifti-volume-loader/CHANGELOG.md +++ b/packages/nifti-volume-loader/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.76.1](https://github.com/cornerstonejs/cornerstone3D/compare/v1.76.0...v1.76.1) (2024-05-28) + +**Note:** Version bump only for package @cornerstonejs/nifti-volume-loader + # [1.76.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.2...v1.76.0) (2024-05-28) **Note:** Version bump only for package @cornerstonejs/nifti-volume-loader diff --git a/packages/nifti-volume-loader/package.json b/packages/nifti-volume-loader/package.json index 9eb82c60d8..aecea91bdc 100644 --- a/packages/nifti-volume-loader/package.json +++ b/packages/nifti-volume-loader/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/nifti-volume-loader", - "version": "1.76.0", + "version": "1.76.1", "description": "", "main": "dist/umd/index.js", "types": "dist/esm/index.d.ts", diff --git a/packages/streaming-image-volume-loader/CHANGELOG.md b/packages/streaming-image-volume-loader/CHANGELOG.md index 4633aed908..6a92f0e215 100644 --- a/packages/streaming-image-volume-loader/CHANGELOG.md +++ b/packages/streaming-image-volume-loader/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.76.1](https://github.com/cornerstonejs/cornerstone3D/compare/v1.76.0...v1.76.1) (2024-05-28) + +**Note:** Version bump only for package @cornerstonejs/streaming-image-volume-loader + # [1.76.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.2...v1.76.0) (2024-05-28) ### Features diff --git a/packages/streaming-image-volume-loader/package.json b/packages/streaming-image-volume-loader/package.json index 626de2674c..4bb6cba79f 100644 --- a/packages/streaming-image-volume-loader/package.json +++ b/packages/streaming-image-volume-loader/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/streaming-image-volume-loader", - "version": "1.76.0", + "version": "1.76.1", "description": "", "main": "src/index.ts", "types": "dist/esm/index.d.ts", diff --git a/packages/tools/CHANGELOG.md b/packages/tools/CHANGELOG.md index dea60c812e..36f1d9a495 100644 --- a/packages/tools/CHANGELOG.md +++ b/packages/tools/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.76.1](https://github.com/cornerstonejs/cornerstone3D/compare/v1.76.0...v1.76.1) (2024-05-28) + +**Note:** Version bump only for package @cornerstonejs/tools + # [1.76.0](https://github.com/cornerstonejs/cornerstone3D/compare/v1.75.2...v1.76.0) (2024-05-28) ### Features diff --git a/packages/tools/package.json b/packages/tools/package.json index 114091f982..37e0e4fe52 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -1,6 +1,6 @@ { "name": "@cornerstonejs/tools", - "version": "1.76.0", + "version": "1.76.1", "description": "Cornerstone3D Tools", "main": "src/index.ts", "types": "dist/types/index.d.ts",