View in #cornerstone3d on Slack
@Henry_M: Hey! We noticed a peculiar issue with createSlabThicknessSynchronizer
- if you add this to a viewport, for example:
const synchronizerId = 'SLAB_THICKNESS_SYNCHRONIZER_ID';
const synchronizer = synchronizers.createSlabThicknessSynchronizer(synchronizerId);
const renderingEngineId = 'OHIFCornerstoneRenderingEngine';
...
useEffect(() => {
cornerstoneViewportService.subscribe(
cornerstoneViewportService.EVENTS.VIEWPORT_DATA_CHANGED,
event => {
synchronizer.add({
renderingEngineId,
viewportId: event.viewportId,
});
}
);
}, []);
then the initial loaded slice index will be some very weird number instead of middle slice (see attached image).
However, when added with a setTimeout
, it works as expected:
useEffect(() => {
cornerstoneViewportService.subscribe(
cornerstoneViewportService.EVENTS.VIEWPORT_DATA_CHANGED,
event => {
setTimeout(() => {
synchronizer.add({
renderingEngineId,
viewportId: event.viewportId,
});
}, 2000);
}
);
}, []);
Any thoughts about this? Might be OHIF related as well, not sure…
@Alireza_Sedghi: Can you create an issue in github?
seems like a problem
@Henry_M: Sure
https://github.com/OHIF/Viewers/issues/4485
@Veljo_Lasn: As a heads-up, I managed to reproduce this in the live 3.9.1 demo & posted repro steps under the GitHub issue
@Alireza_Sedghi: Great, I will look
@Veljo_Lasn: Notes:
• no synchronizers are involved in the repro
• if I destroy all implicit synchronizers (mpr, sameFORId
) via cornerstoneTools.SynchronizerManager.destroy(id)
, the issue still persists
• also found a no-code repro by activating crosshairs, using one of the inner handles to change a viewport’s slice thickness and then resizing
@Alireza_Sedghi: I created the recovery plan https://github.com/OHIF/Viewers/issues/4500
let us know about other issues as well
@Veljo_Lasn: Fwiw our fork (where me and @Henry_M found the bug) is currently based off of 3.9.0-beta.88
@Alireza_Sedghi Do you need any more input from us under the recovery plan issue?
@Alireza_Sedghi: Reproducible steps always help, ideally in our demo server viewer.ohif.org
You can create separate issues
that recovery issue is for ours to gather a epic
@Veljo_Lasn: Alright. Sorry, I was confused re: whether you’d like us to post a link to the issue we raised under the recovery issue as well
@Alireza_Sedghi: Sorry for the confusion
@Veljo_Lasn: Commented on github as well but in case it helps, we identified that the issue first occurs in 3.9.0-beta.78
@Henry_M: https://github.com/OHIF/Viewers/compare/v3.9.0-beta.77...v3.9.0-beta.78
Leaving this here
@Veljo_Lasn: We were able to get it to behave (for now) by calling renderingEngine.resize(isImmediate, false)
instead of renderingEngine.resize(isImmediate)
here.
I don’t really understand the potential adverse side effects that this could produce though, since I’m not at all familiar with this part of OHIF’s codebase.
<https://github.com/OHIF/Viewers/blob/7586006e7f802462bdb0e1f1d5f91deb9e182c23/extensions/cornerstone/src/services/ViewportService/CornerstoneViewportService.ts | CornerstoneViewportService.ts>