Accesing current image in series
Hi forks, We are making AI analytic for each image, but when I scroll mouse, I cannot find the way to handle what current image index is. we want to show the result for each image.
the current Image index is depend on currentImageIdIndex. I tried to check in OHIFCornerstoneViewport.js but sopInstanceUid always undefined.
Can you tell us the way to handle it.
If you are referring to the series number displayed in the lower left, that value is displayed by the HTML element with the class name "bottom-left overlay-element". To access the element:
const bottom_left_overlay = window.document.getElementsByClassName("bottom-left overlay-element")[0];
You could get the first child element and figure out how the innerHTML is assigned or just cheat and read the innerHTML value.
Hi @mtm12, I mean when I scroll mouse on the content of viewer (the center of viewer) => the image will change, so we want to trigger this current image index to show the result. Because each image will have a result on platform/viewer
example in viewportSpecificData, we have an array of data, for each data, we want to get the currentImageIdIndex.
Please let us know how can we trigger this from cornerstone to viewer
Hello trung1704ptit,
The function mouseWheelCallback(evt) is fired when the mouse wheel is scrolled. See the code around line 20549 in the StackScrollMouseWheelTool
Marc
On Sun, Mar 8, 2020 at 10:19 PM trung1704ptit [email protected] wrote:
Hi @mtm12 https://github.com/mtm12, I mean when I scroll mouse on the content of viewer (the center of viewer) => the image will change, so we want to trigger this current image index to show the result. Because each image will have a result on platform/viewer
example my series has 40 images. when we want to trigger the currentImage / 40
Please let us know how can we trigger this from cornerstone to viewer
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OHIF/Viewers/issues/1480?email_source=notifications&email_token=AGWQ3UVNH6JJJTBCHQQYTSTRGRG4JA5CNFSM4LBB25YKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOFNRSQ#issuecomment-596302026, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGWQ3UWQRPVG42NSOGVSBHTRGRG4JANCNFSM4LBB25YA .
-- Marc McLean
cornerstone.js emits a cornerstonenewimage event when a new image is displayed:
https://github.com/cornerstonejs/cornerstone/blob/master/src/events.js#L2
The event includes the new image's cornerstone image id. You can then fetch the "stack" toolstate for the enabledElement that emitted the event. Then use the cornerstone image id from the event, and the list of cornerstoneImageIds in toolState, to determine the currentImageIdIndex (which may already be on the stack toolstate anyway)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.