Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(volumeLoad): should not have missing slices when loading #3287

Merged
merged 2 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions extensions/cornerstone-dicom-sr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"dependencies": {
"@babel/runtime": "^7.20.13",
"classnames": "^2.3.2",
"@cornerstonejs/adapters": "^0.4.1",
"@cornerstonejs/core": "^0.36.5",
"@cornerstonejs/tools": "^0.55.1"
"@cornerstonejs/adapters": "^0.6.0",
"@cornerstonejs/core": "^0.38.0",
"@cornerstonejs/tools": "^0.58.0"
}
}
8 changes: 4 additions & 4 deletions extensions/cornerstone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
},
"dependencies": {
"@babel/runtime": "^7.20.13",
"@cornerstonejs/adapters": "^0.4.1",
"@cornerstonejs/core": "^0.36.5",
"@cornerstonejs/streaming-image-volume-loader": "^0.15.1",
"@cornerstonejs/tools": "^0.55.1",
"@cornerstonejs/adapters": "^0.6.0",
"@cornerstonejs/core": "^0.38.0",
"@cornerstonejs/streaming-image-volume-loader": "^0.15.13",
"@cornerstonejs/tools": "^0.58.0",
"@kitware/vtk.js": "26.5.6",
"html2canvas": "^1.4.1",
"lodash.debounce": "4.0.8",
Expand Down
13 changes: 11 additions & 2 deletions extensions/cornerstone/src/getHangingProtocolModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const mpr: Types.HangingProtocol.Protocol = {
// Unknown number of priors referenced - so just match any study
numberOfPriorsReferenced: 0,
protocolMatchingRules: [],
// imageLoadStrategy: 'nth',
imageLoadStrategy: 'interleaveTopToBottom',
callbacks: {
// Switches out of MPR mode when the layout change button is used
onLayoutChange: [
Expand Down Expand Up @@ -170,7 +170,7 @@ const mprAnd3DVolumeViewport = {
availableTo: {},
editableBy: {},
protocolMatchingRules: [],
imageLoadStrategy: 'interleaveTopToBottom',
imageLoadStrategy: 'interleaveCenter',
displaySetSelectors: {
mprDisplaySet: {
seriesMatchingRules: [
Expand All @@ -184,6 +184,15 @@ const mprAnd3DVolumeViewport = {
},
required: true,
},
{
attribute: 'Modality',
constraint: {
equals: {
wayfarer3130 marked this conversation as resolved.
Show resolved Hide resolved
value: 'CT',
},
},
required: true,
},
],
},
},
Expand Down
19 changes: 18 additions & 1 deletion extensions/cornerstone/src/init.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,26 @@ export default async function init({
viewportId
);

const ohifViewport = cornerstoneViewportService.getViewportInfo(
wayfarer3130 marked this conversation as resolved.
Show resolved Hide resolved
viewportId
);

const {
lutPresentationStore,
positionPresentationStore,
} = stateSyncService.getState();
const { presentationIds } = ohifViewport.getViewportOptions();
const presentations = {
positionPresentation:
positionPresentationStore[presentationIds?.positionPresentationId],
lutPresentation:
lutPresentationStore[presentationIds?.lutPresentationId],
};

cornerstoneViewportService.setVolumesForViewport(
viewport,
volumeInputArray
volumeInputArray,
presentations
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,19 +506,16 @@ class CornerstoneViewportService extends PubSubService
!hangingProtocolService.customImageLoadPerformed
) {
// delegate the volume loading to the hanging protocol service if it has a custom image load strategy
if (
hangingProtocolService.runImageLoadStrategy({
viewportId: viewport.id,
volumeInputArray,
})
) {
// Fallback to the default strategy if the custom one fails
return;
}
return hangingProtocolService.runImageLoadStrategy({
wayfarer3130 marked this conversation as resolved.
Show resolved Hide resolved
viewportId: viewport.id,
volumeInputArray,
});
}

volumeToLoad.forEach(volume => {
volume.load();
if (!volume.loadStatus.loaded && !volume.loadStatus.loading) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about cancelled?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should be able to resume the cancel, so I don't think so

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If so, you need to remove the cancelled flag in the load then - that can wait for now, but you might want to test it.

volume.load();
}
});

// This returns the async continuation only
Expand Down
4 changes: 2 additions & 2 deletions extensions/measurement-tracking/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"peerDependencies": {
"@ohif/core": "^3.0.0",
"classnames": "^2.3.2",
"@cornerstonejs/core": "^0.36.5",
"@cornerstonejs/tools": "^0.55.1",
"@cornerstonejs/core": "^0.38.0",
"@cornerstonejs/tools": "^0.58.0",
"@ohif/extension-cornerstone-dicom-sr": "^3.0.0",
"dcmjs": "^0.29.4",
"lodash.debounce": "^4.17.21",
Expand Down
4 changes: 3 additions & 1 deletion platform/viewer/public/config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ window.config = {
maxNumRequests: {
interaction: 100,
thumbnail: 75,
prefetch: 10,
// Prefetch number is dependent on the http protocol. For http 2 or
// above, the number of requests can be go a lot higher.
prefetch: 25,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The prefetch number is heavily dependent on protocol - running http/2 or /3 allows for high prefetch numbers, but a prefetch of 25 is too high for /1.1 or /1.0. The issue is that it starts blocking the fetch queue. I think I would add a comment here explaining a bit of that - I would also try as high as 100 and see if it makes a difference. If you consider a latency of 200 ms, for a fetch size of 200k, then the transfer time probably on the 20 ms time frame, and you want to completely consume all the latency time with transfer time, so that means in a perfect overlap situation, you need 20/200 = 10 prefetch, which in a practical world with random transfer times, you want 2-3 times that amount, so 25 is a good practical amount.

},
// filterQueryParam: false,
dataSources: [
Expand Down
70 changes: 33 additions & 37 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1407,13 +1407,13 @@
resolved "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9"
integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==

"@cornerstonejs/adapters@^0.4.1":
version "0.4.1"
resolved "https://registry.yarnpkg.com/@cornerstonejs/adapters/-/adapters-0.4.1.tgz#fedab0d9cfea609f5219950c86e546198ad0f3c8"
integrity sha512-DQabSBdTN/A5tsncnDLdsb6LI5I/FTG3gSmNpDAkc9fAZY6Ljj0lCLt9KHB5OA1Gbvrlcab/DGJ/2YW6Z7ifRg==
"@cornerstonejs/adapters@^0.6.0":
version "0.6.0"
resolved "https://registry.npmjs.org/@cornerstonejs/adapters/-/adapters-0.6.0.tgz#9b2efdabb0d596d53ae4854556956b668cca7535"
integrity sha512-bzOwtOX0EfJ/PufPq1mONPU+HmVQf+pA/78+mbHuV8bvznM1IkSzc2h0WYsLXTdVEkZrGwgWCwrOiYGfsNW1tQ==
dependencies:
"@babel/runtime-corejs2" "^7.17.8"
dcmjs "^0.29.4"
dcmjs "^0.29.5"
gl-matrix "^3.4.3"
lodash.clonedeep "^4.5.0"
ndarray "^1.0.19"
Expand Down Expand Up @@ -1443,44 +1443,28 @@
resolved "https://registry.npmjs.org/@cornerstonejs/codec-openjph/-/codec-openjph-2.4.2.tgz#e96721d56f6ec96f7f95c16321d88cc8467d8d81"
integrity sha512-lgdvBvvNezleY+4pIe2ceUsJzlZe/0PipdeubQ3vZZOz3xxtHHMR1XFCl4fgd8gosR8COHuD7h6q+MwgrwBsng==

"@cornerstonejs/core@^0.35.1":
version "0.35.1"
resolved "https://registry.npmjs.org/@cornerstonejs/core/-/core-0.35.1.tgz#fd5e9f878b51807366d9d0c6659ac91b43efed87"
integrity sha512-n6nFo3XVkMKmhNsF20yPznO3jo3MpOl8X+3k/HyHVlZujIsBT/jz0X4dEg/3fzA0aLPdWdZ/kkVw8TBanVKTGA==
"@cornerstonejs/core@^0.38.0":
version "0.38.0"
resolved "https://registry.npmjs.org/@cornerstonejs/core/-/core-0.38.0.tgz#6ee3341f38f78e98da85d2511ac16f25e9800f18"
integrity sha512-4/+qDEtGQRwV6AN5Ze4S6oOFiNH48oT5Mp/YQEzJHO+Zn9ceRHZ6ReTwccVUJ5QY2d5d89CoWJ2sKhdsLFZsNw==
dependencies:
detect-gpu "^4.0.45"
lodash.clonedeep "4.5.0"

"@cornerstonejs/core@^0.36.2":
version "0.36.2"
resolved "https://registry.npmjs.org/@cornerstonejs/core/-/core-0.36.2.tgz#205573bfd75a273fa6bca587662b4dd1f5e46167"
integrity sha512-jJYawOjLGop18O426YxyBepkiaYT/xHMa3mqhToIO5KRxK/UYSGHt0RS8wSHeFR8pNkCAHepcdfhyIVkAln66g==
"@cornerstonejs/streaming-image-volume-loader@^0.15.13":
version "0.15.13"
resolved "https://registry.npmjs.org/@cornerstonejs/streaming-image-volume-loader/-/streaming-image-volume-loader-0.15.13.tgz#d4c6651f5edac0adbc2c4059b78945fb70c38eb5"
integrity sha512-o0e+vEr08GmMztjabPs7vHKYhofW0dQvSI8Dy7tb1wKEnf05Tis/5s9sCt6PORNHXweK+Cylja3xy8b469ZuVw==
dependencies:
detect-gpu "^4.0.45"
lodash.clonedeep "4.5.0"
"@cornerstonejs/core" "^0.38.0"
cornerstone-wado-image-loader "^4.10.2"

"@cornerstonejs/core@^0.36.5":
version "0.36.5"
resolved "https://registry.yarnpkg.com/@cornerstonejs/core/-/core-0.36.5.tgz#2e8c2fc2f9d00c2b5a0f1666aa575ab5024f3616"
integrity sha512-5Z4GEjpWaYbEbSpbgNc92oiwTcD8TUpVw1TUQ5UC4OkzxBMN4THmkGifRq5kJpxJTahGVsoU4W1S7of+YsULlg==
"@cornerstonejs/tools@^0.58.0":
version "0.58.0"
resolved "https://registry.npmjs.org/@cornerstonejs/tools/-/tools-0.58.0.tgz#c9a2ba6a96491a565fe03a2ef1c1403bd70992e4"
integrity sha512-sVsX6WGLmHg5UUg7p9iwvwjb8AswUypO2jARyIVtpa3JM3dP16Y0uh1jTWJFG2xWLZgEXDXcFCIhw5nOSohy7A==
dependencies:
detect-gpu "^4.0.45"
lodash.clonedeep "4.5.0"

"@cornerstonejs/streaming-image-volume-loader@^0.15.1":
version "0.15.1"
resolved "https://registry.npmjs.org/@cornerstonejs/streaming-image-volume-loader/-/streaming-image-volume-loader-0.15.1.tgz#b9fd0efbebbd232119ef0ae7b63bf8b3498bf539"
integrity sha512-xtBG2RlhjOX/Cd4qGLYGKXjF7oLhRtksmXpPB5nOa1BBBgrGOQHFjNuyh3uhVHg30e5po9oCfomSPHwovhexzw==
dependencies:
"@cornerstonejs/core" "^0.35.1"
cornerstone-wado-image-loader "^4.10.0"

"@cornerstonejs/tools@^0.55.1":
version "0.55.1"
resolved "https://registry.npmjs.org/@cornerstonejs/tools/-/tools-0.55.1.tgz#cde00881c35a43f2d10c634350e46f45e8bf9a7b"
integrity sha512-fYRNqnS9WXWBrkOd++nocKqjlD6p3BvFtPCJeaA8M2bdgEHEHK+KbM999GG5YTmWV88xLW4mjSl+wJvbdWUwEQ==
dependencies:
"@cornerstonejs/core" "^0.36.2"
"@cornerstonejs/core" "^0.38.0"
lodash.clonedeep "4.5.0"
lodash.get "^4.4.2"

Expand Down Expand Up @@ -8527,7 +8511,7 @@ cornerstone-math@^0.1.9:
resolved "https://registry.npmjs.org/cornerstone-math/-/cornerstone-math-0.1.10.tgz#a3f99db64d73c5adee61ae0d570128eca1682d07"
integrity sha512-23XSAyP7t70ANvhFyqwvva+zFd1bQ2d5GL7tg9qKE932WmImjA2Y9tiy5n0iTtnf51W/78Png8Lia2o4dCdJaQ==

cornerstone-wado-image-loader@^4.10.0, cornerstone-wado-image-loader@^4.10.2:
cornerstone-wado-image-loader@^4.10.2:
version "4.10.2"
resolved "https://registry.yarnpkg.com/cornerstone-wado-image-loader/-/cornerstone-wado-image-loader-4.10.2.tgz#139956654324fd2b01fe5b4900d0f4ed8c52633d"
integrity sha512-qj9dThELqYCm3jAZfg9qnUl8d76gngOl55kYJabY5lh/dFeVIxno/hYxy3ydE7RtG2c/TUGXb+EMUl0CJSqKBQ==
Expand Down Expand Up @@ -9259,6 +9243,18 @@ dcmjs@^0.29.4:
ndarray "^1.0.19"
pako "^2.0.4"

dcmjs@^0.29.5:
version "0.29.5"
resolved "https://registry.npmjs.org/dcmjs/-/dcmjs-0.29.5.tgz#3e2311fc47aafc70f21e236ad89e2ff9ba6589fd"
integrity sha512-CcLo3pwitf9JhhvW3/icCraxUhaIKJRyOys9XJlBBDn5TQskyJzxgveLKejcryHn4DooqlJPeMuM4ixdPFEERQ==
dependencies:
"@babel/runtime-corejs2" "^7.17.8"
gl-matrix "^3.1.0"
lodash.clonedeep "^4.5.0"
loglevelnext "^3.0.1"
ndarray "^1.0.19"
pako "^2.0.4"

debug-log@^1.0.0:
version "1.0.1"
resolved "https://registry.npmjs.org/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f"
Expand Down