From 57246c36bdfbd0b78c09a2936f88cc31af2ed3fd Mon Sep 17 00:00:00 2001 From: Peyton Lee Date: Tue, 17 Dec 2024 13:40:31 -0800 Subject: [PATCH 1/4] fix: Track channel load status individually --- src/aics-image-viewer/components/App/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/aics-image-viewer/components/App/index.tsx b/src/aics-image-viewer/components/App/index.tsx index 4d1f5ac6..5191b4ec 100644 --- a/src/aics-image-viewer/components/App/index.tsx +++ b/src/aics-image-viewer/components/App/index.tsx @@ -187,7 +187,7 @@ const App: React.FC = (props) => { // State for image loading/reloading // `true` when this is the initial load of an image - const initialLoadRef = useRef(true); + const hasChannelLoadedRef = useRef([]); // `true` when image data has been requested, but no data has been received yet const [sendingQueryRequest, setSendingQueryRequest] = useState(false); // `true` when all channels of the current image are loaded @@ -258,7 +258,7 @@ const App: React.FC = (props) => { // If this is the first load of this image, auto-generate initial LUTs if ( - initialLoadRef.current || + !hasChannelLoadedRef.current[channelIndex] || !thisChannelsSettings.controlPoints || !thisChannelsSettings.ramp || getChannelsAwaitingResetOnLoad().has(channelIndex) @@ -309,6 +309,7 @@ const App: React.FC = (props) => { if (aimg.channelNames[channelIndex] === getCurrentViewerChannelSettings()?.maskChannelName) { view3d.setVolumeChannelAsMask(aimg, channelIndex); } + hasChannelLoadedRef.current[channelIndex] = true; // when any channel data has arrived: setSendingQueryRequest(false); @@ -316,7 +317,6 @@ const App: React.FC = (props) => { if (aimg.isLoaded()) { view3d.updateActiveChannels(aimg); setImageLoaded(true); - initialLoadRef.current = false; playControls.onImageLoaded(); } }; @@ -400,7 +400,7 @@ const App: React.FC = (props) => { setSendingQueryRequest(true); setImageLoaded(false); - initialLoadRef.current = true; + hasChannelLoadedRef.current = []; const loadSpec = new LoadSpec(); loadSpec.time = viewerState.current.time; From e72806175fbad35fbf721b0e101643e84526f31b Mon Sep 17 00:00:00 2001 From: Peyton Lee Date: Tue, 17 Dec 2024 14:04:06 -0800 Subject: [PATCH 2/4] refactor: Update comment for `hasChannelLoadedRef` --- src/aics-image-viewer/components/App/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aics-image-viewer/components/App/index.tsx b/src/aics-image-viewer/components/App/index.tsx index 5191b4ec..cc076876 100644 --- a/src/aics-image-viewer/components/App/index.tsx +++ b/src/aics-image-viewer/components/App/index.tsx @@ -186,7 +186,7 @@ const App: React.FC = (props) => { // State for image loading/reloading - // `true` when this is the initial load of an image + /** `true` when a channel's data has been loaded for the current image. */ const hasChannelLoadedRef = useRef([]); // `true` when image data has been requested, but no data has been received yet const [sendingQueryRequest, setSendingQueryRequest] = useState(false); From 3d45ee98c6fffed3d95b07b3baf2cc10a14940d4 Mon Sep 17 00:00:00 2001 From: Peyton Lee Date: Tue, 17 Dec 2024 16:16:25 -0800 Subject: [PATCH 3/4] refactor: Bumped volume-viewer to 3.12.3 --- package-lock.json | 18 ++++++++---------- package.json | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 794cacda..c2ceebab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "2.10.3", "license": "ISC", "dependencies": { - "@aics/volume-viewer": "^3.12.2", + "@aics/volume-viewer": "^3.12.3", "@ant-design/icons": "^5.2.5", "@fortawesome/fontawesome-svg-core": "^6.5.2", "@fortawesome/free-solid-svg-icons": "^6.5.2", @@ -97,25 +97,23 @@ } }, "node_modules/@aics/volume-viewer": { - "version": "3.12.2", - "resolved": "https://registry.npmjs.org/@aics/volume-viewer/-/volume-viewer-3.12.2.tgz", - "integrity": "sha512-YRL7gYqQcjiudaHyFXPyCqPMKZkUq+pJ4gXTlgEwcNV2ozLei8/xMlJdi6bmvPTDbTyeii2N3mgsJZT2dGXkqw==", - "license": "MIT", + "version": "3.12.3", + "resolved": "https://registry.npmjs.org/@aics/volume-viewer/-/volume-viewer-3.12.3.tgz", + "integrity": "sha512-iH4BgfucChsaQO6/WEf3rBMnyCETXONhBmhkHKKX3YrJ8hzswEw1NlgBUFKCj5xUxB1K943xVCRgQolYoBbfGA==", "dependencies": { "@babel/runtime": "^7.25.6", "geotiff": "^2.0.5", "serialize-error": "^11.0.3", - "three": "^0.162.0", + "three": "^0.171.0", "throttled-queue": "^2.1.4", "tweakpane": "^3.1.9", "zarrita": "^0.3.2" } }, "node_modules/@aics/volume-viewer/node_modules/three": { - "version": "0.162.0", - "resolved": "https://registry.npmjs.org/three/-/three-0.162.0.tgz", - "integrity": "sha512-xfCYj4RnlozReCmUd+XQzj6/5OjDNHBy5nT6rVwrOKGENAvpXe2z1jL+DZYaMu4/9pNsjH/4Os/VvS9IrH7IOQ==", - "license": "MIT" + "version": "0.171.0", + "resolved": "https://registry.npmjs.org/three/-/three-0.171.0.tgz", + "integrity": "sha512-Y/lAXPaKZPcEdkKjh0JOAHVv8OOnv/NDJqm0wjfCzyQmfKxV7zvkwsnBgPBKTzJHToSOhRGQAGbPJObT59B/PQ==" }, "node_modules/@ampproject/remapping": { "version": "2.3.0", diff --git a/package.json b/package.json index 19367e2b..e32d18ef 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "author": "Megan Riel-Mehan", "license": "ISC", "dependencies": { - "@aics/volume-viewer": "^3.12.2", + "@aics/volume-viewer": "^3.12.3", "@ant-design/icons": "^5.2.5", "@fortawesome/fontawesome-svg-core": "^6.5.2", "@fortawesome/free-solid-svg-icons": "^6.5.2", From 0dd6aed7ffb4723ac4d093ad5f62a507228a8d6c Mon Sep 17 00:00:00 2001 From: Peyton Lee Date: Wed, 18 Dec 2024 09:20:06 -0800 Subject: [PATCH 4/4] 2.10.4 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c2ceebab..0473a319 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@aics/web-3d-viewer", - "version": "2.10.3", + "version": "2.10.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@aics/web-3d-viewer", - "version": "2.10.3", + "version": "2.10.4", "license": "ISC", "dependencies": { "@aics/volume-viewer": "^3.12.3", diff --git a/package.json b/package.json index e32d18ef..4226ac19 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@aics/web-3d-viewer", - "version": "2.10.3", + "version": "2.10.4", "description": "web view of cell volume images", "repository": "github:allen-cell-animated/website-3d-cell-viewer", "main": "es/index.js",