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

feat: volume API and TMTV mode #2814

Merged
merged 25 commits into from
May 31, 2022
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
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-3d/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
"@babel/runtime": "7.17.9",
"lodash.merge": "^4.6.2",
"lodash.debounce": "4.0.8",
"@cornerstonejs/core": "^0.8.1",
"@cornerstonejs/tools": "^0.15.0",
"@cornerstonejs/streaming-image-volume-loader": "^0.2.26",
"@cornerstonejs/core": "^0.10.2",
"@cornerstonejs/tools": "^0.17.2",
"@cornerstonejs/streaming-image-volume-loader": "^0.3.2",
"shader-loader": "^1.3.1",
"@kitware/vtk.js": "^24.10.0",
"dom-to-image": "^2.6.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const OHIFCornerstoneViewport = React.memo(props => {
}

const { viewportId, element } = evt.detail;
const viewportInfo = Cornerstone3DViewportService.getViewportInfoById(
const viewportInfo = Cornerstone3DViewportService.getViewportInfo(
viewportId
);
const viewportIndex = viewportInfo.getViewportIndex();
Expand Down Expand Up @@ -172,6 +172,8 @@ const OHIFCornerstoneViewport = React.memo(props => {
// we need to remove the old volume from the cache, and let the
// viewport to re-add it which will use the new metadata. Otherwise, the
// viewport will use the cached volume and the new metadata will not be used.
// Note: this approach does not actually end of sending network requests
// and it uses the network cache
useEffect(() => {
const { unsubscribe } = DisplaySetService.subscribe(
DisplaySetService.EVENTS.DISPLAY_SET_SERIES_METADATA_INVALIDATED,
Expand Down Expand Up @@ -381,7 +383,7 @@ function _jumpToMeasurement(
displaySetInstanceUID
);

const imageIdIndex = referencedDisplaySet.images.findIndex(
const imageIndex = referencedDisplaySet.images.findIndex(
i => i.SOPInstanceUID === SOPInstanceUID
);

Expand All @@ -394,7 +396,7 @@ function _jumpToMeasurement(
if (targetElement !== null) {
const metadata = {
...measurement.metadata,
imageIdIndex,
imageIndex,
};
cs3DTools.utilities.jumpToSlice(targetElement, metadata);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ function CornerstoneOverlays(props) {
viewportIndex
);

if (
viewportInfo &&
viewportInfo.viewportOptions?.customViewportOptions &&
viewportInfo.viewportOptions?.customViewportOptions?.hideOverlays
) {
if (viewportInfo?.viewportOptions?.customViewportOptions?.hideOverlays) {
return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ function CornerstoneViewportOverlay({
upper
);

// Don't set VOI if already set
if (voi.windowCenter !== null || voi.windowWidth !== null) {
sedghi marked this conversation as resolved.
Show resolved Hide resolved
return;
}

setVOI({ windowCenter, windowWidth });
};

Expand All @@ -50,7 +55,7 @@ function CornerstoneViewportOverlay({
return () => {
element.removeEventListener(Enums.Events.VOI_MODIFIED, updateVOI);
};
}, [viewportIndex, viewportData]);
}, [viewportIndex, viewportData, voi, element]);

/**
* Updating the scale when the viewport changes its zoom
Expand Down
Loading