View in #cornerstone3d on Slack
@Peter_Newhook: I’m displaying a stack of CT images, and I’m using StackScrollTool
for mouse scrolling, and a custom scroll bar React component to let the user scroll images by dragging a scroll bar. When the user drags the scroll bar, I’m calling viewport.setImageIdIndex()
to change the displayed image. Changing the displayed image based on the scroll bar is working. However, when if I then touch the scroll wheel, the index is changed based on the index from before the scroll bar is touched. Is setImageIdIndex()
the correct way to do this, and are there any small examples that include a scroll bar? I see scroll wheel and scroll bar are implemented in OHIF Veiwer.
@Alireza_Sedghi: OHIF scrollbar works fine AFAIK, check it out https://github.com/OHIF/Viewers/blob/4ef67c0cf70ea576d1db13349ee8bb2b109d1aad/extensions/cornerstone/src/Viewport/Overlays/ViewportImageScrollbar.tsx
<Viewers/extensions/cornerstone/src/Viewport/Overlays/ViewportImageScrollbar.tsx at 4ef67c0cf70ea576d1db13349ee8bb2b109d1aad · OHIF/Viewers · GitHub | ViewportImageScrollbar.tsx>
@Peter_Newhook: Thanks a lot, I was expected it to be a lot harder to navigate the OHIF implementation. But utilitites.jumpToSlice()
is exactly what I needed. https://www.cornerstonejs.org/docs/api/core/namespaces/utilities/functions/jumpToSlice
Function: jumpToSlice() | Cornerstone.js