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
Issue : Cine infinite rendering loop #249
Conversation
Remove infinite rendering loop
✅ Deploy Preview for cornerstone-3d-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Interesting bug, thanks for your PR. I'm not sure if this is a fix, but I will think about it |
No problem, thanks |
Yeah I think the problem wasn’t what I said earlier, It looks like it’s because of this
This doesn't update inside
It keeps using the initial value that was defined when I pushed another commit with the new fix.
let me know what you think, I also noticed it was also breaking when you set loop to false, it would loop around anyway, but after fixing the variable both issues are resolved. |
@IbrahimCSAE I like the new fix better, but seems like your eslint/prettier is not setup properly as I see the indentation is wrong. Can you fix that and we merge it? |
Awesome, I just fixed the indentation, does it look alright now? @sedghi Also there's an issue I opened with the MagnifyTool, it seems to break all SVG rendering for all tools for some reason, all of them stop working because of it. |
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.
Thanks
I pushed another commit, I had the variable used before its declaration when I was fixing the indentation, sorry about that. |
This line in the code causes CINE to be in an infinite loop and render the same frame over and over. It happens when you activate the CINE tool and you are on the last image of a series.
and since delta is
const delta = newImageIdIndex - stackData.targetImageIdIndex;
It causes it to go in the negative when it should always be 1 from my understanding.If you would like to replicate the issue, visit this study
https://v3-demo.ohif.org/viewer?StudyInstanceUIDs=1.3.6.1.4.1.25403.345050719074.3824.20170126083429.2
load any series and go to the last image in it by scrolling, so 53/53 for example, and trigger the CINE tool, you will notice it freezes, and it's frozen not because it's stopped but it's just really rendering the same frame over and over.
You can check by recording the performance and looking at the call stack, or you will just notice the CPU usage rising up.
After removing those lines the issue doesn't happen anymore since the calculation for delta comes out with 1 instead of negative values, so 53- 52 = 1, with the previous code it would've been 0-52 = -52 which makes it get stuck.
The way I fixed it could be wrong, so feel free to fix it some other way, but it's an issue to lookout for anyway.