-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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(hydration): Maintain the same slice that the user was on pre hydration in post hydration for SR and SEG. #4200
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,10 +120,10 @@ function getHangingProtocolModule() { | |
name: hpMammography.id, | ||
protocol: hpMammography, | ||
}, | ||
// { | ||
// name: hpScale.id, | ||
// protocol: hpScale, | ||
// }, | ||
{ | ||
name: hpScale.id, | ||
protocol: hpScale, | ||
}, | ||
Comment on lines
122
to
+126
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. revert this for now since when you go to segmenttaion mode this gets matched for some reason There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure |
||
]; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,12 @@ function TrackedMeasurementsContextProvider( | |
|
||
const [viewportGrid, viewportGridService] = useViewportGrid(); | ||
const { activeViewportId, viewports } = viewportGrid; | ||
const { measurementService, displaySetService, customizationService } = servicesManager.services; | ||
const { | ||
measurementService, | ||
displaySetService, | ||
customizationService, | ||
cornerstoneViewportService, | ||
} = servicesManager.services; | ||
|
||
const machineOptions = Object.assign({}, defaultOptions); | ||
machineOptions.actions = Object.assign({}, machineOptions.actions, { | ||
|
@@ -81,6 +86,29 @@ function TrackedMeasurementsContextProvider( | |
}, | ||
}); | ||
}, | ||
|
||
jumpToSameImageInActiveViewport: (ctx, evt) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this be the same logic if there is only one measurement? What I'm asking is, is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It doesn’t matter how many measurements there are, it will still be the same slice the user was on |
||
const { trackedStudy, trackedSeries, activeViewportId } = ctx; | ||
const measurements = measurementService.getMeasurements(); | ||
const trackedMeasurements = measurements.filter( | ||
m => trackedStudy === m.referenceStudyUID && trackedSeries.includes(m.referenceSeriesUID) | ||
); | ||
|
||
const trackedMeasurement = trackedMeasurements[0]; | ||
const referencedDisplaySetUID = trackedMeasurement.displaySetInstanceUID; | ||
const viewport = cornerstoneViewportService.getCornerstoneViewport(activeViewportId); | ||
const imageIndex = viewport.getCurrentImageIdIndex(); | ||
|
||
viewportGridService.setDisplaySetsForViewport({ | ||
viewportId: activeViewportId, | ||
displaySetInstanceUIDs: [referencedDisplaySetUID], | ||
viewportOptions: { | ||
initialImageOptions: { | ||
index: imageIndex, | ||
}, | ||
}, | ||
}); | ||
}, | ||
showStructuredReportDisplaySetInActiveViewport: (ctx, evt) => { | ||
if (evt.data.createdDisplaySetInstanceUIDs.length > 0) { | ||
const StructuredReportDisplaySetInstanceUID = evt.data.createdDisplaySetInstanceUIDs[0]; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need
useOnce
? I don't prefer this approach.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So when the seg is hydrated, the initial image index is set, but lets say the user switches to another series, then drops the referenced series for the seg again, we should not use the initial index again, we should default to first/middle or last.