Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

cpinter
Copy link
Member

@cpinter cpinter commented Nov 19, 2024

Two small fixes in SH related to recent SlicerRT improvements and investigation.

No need to handle this until after the stable release.


Note

Changes originally integrated through this pull request have been extracted and contributed as independent pull request(s):

@cpinter cpinter added the Status: Draft This pull-request is not yet ready for integration label Nov 19, 2024
@cpinter cpinter requested a review from lassoan November 19, 2024 19:35
@cpinter cpinter force-pushed the sh-folder-visibility-fix branch from c10c16e to ff880bc Compare November 19, 2024 19:46
@cpinter cpinter removed the Status: Draft This pull-request is not yet ready for integration label Feb 3, 2025
@cpinter
Copy link
Member Author

cpinter commented Feb 3, 2025

Now that the stable is out and PW is over, I'd like to propose this PR for integration. Thanks a lot!

@cpinter
Copy link
Member Author

cpinter commented Feb 25, 2025

@lassoan What do you think? Is this a reasonable change? It fixes a real issue, although does not remove the workaround.

@cpinter
Copy link
Member Author

cpinter commented Mar 10, 2025

@lassoan Can you please give this a quick look? Thanks!

@lassoan
Copy link
Contributor

lassoan commented Mar 10, 2025

If there is an update issue then we should be able to address it by adding the missing RequestRender calls (and not with decreasing batch processing probability). Do your have a simple way to reproduce this update issue?

Have you measured computation time vs. number of items to update; with/without batch processing? I think the breakeven point is way below 50 items, but we should really measure it. The best would be to have a Python script that creates nodes and shows/hides them and reports the time it took with and without batch processing.

If needed then the logic of counting items can be tuned (e.g., exclude folders), but usually a folder contains at least 5-10 nodes, so excluding folders (or other rare item types that are not displayable nodes) should not make a huge difference.

@cpinter
Copy link
Member Author

cpinter commented Mar 17, 2025

Thanks for the review! I don't think I'll have time to do this analysis, so maybe I'll just make a fork for this simple change.

Can the commit that fixes the crash be integrated?

@lassoan
Copy link
Contributor

lassoan commented Sep 6, 2025

I've moved out the fix of the crash to #8701, as it does not require any further discussion or testing.

About the folder visibility: I've made some fixes a few days ago that may fix the folder visibility issues that you encountered. @cpinter could you test if you can still reproduce issues with the latest Slicer Preview Release? (if not, then the changes in the second commit of this pull request might not be needed anymore)

@lassoan lassoan added this to the Slicer 5.9 milestone Sep 6, 2025
@jcfr jcfr self-assigned this Sep 9, 2025
@jcfr jcfr force-pushed the sh-folder-visibility-fix branch from ff880bc to 9fd9f34 Compare September 12, 2025 12:11
There has been a threshold in the Subject Hierarchy tree view for the number of children in a folder, above which setting the visibility was done in batch processing state. If batch processing is used, the visibility change is not reflected in the 3D view until rendering is requested (e.g. rotating view). Also, setting the visibility takes about twice as long.

Batch processing makes sense if there are a lot of nodes, but the current threshold (10) seems too low to make up for this gain (it even slows it down as mentioned). Also, this threshold takes into account the total number of children, not just the displayable ones (there may be tables etc.), so its usefulness is limited.

This commit increases the threshold to 50 fix the visibility bug, but apparently it also makes it faster. It will be necessary to revise having 0this threshold, and to fix the root cause of the visibility bug (apparently processEvents and RequestRender calls do not help).

The bug is reliably reproducible by loading the RANDO^ENT patient from the SlicerRT test data (need to have SlicerRT built/installed), and trying to toggle plan visibility. The beams disappear from the 2D views, but not from the 3D views until there is user interaction.

This is part of the work to improve RT plan features, see SlicerRt/SlicerRT@169518a
@jcfr jcfr force-pushed the sh-folder-visibility-fix branch from 9fd9f34 to 8a8b074 Compare September 12, 2025 12:20
@jcfr
Copy link
Member

jcfr commented Sep 12, 2025

@cpinter @lassoan I rebased this pull request and I am updating the milestone to be Slicer 5.11. If you think this is (near-)ready for integration, I will let you update the milestone and move forward with final review & testing.

@jcfr jcfr modified the milestones: Slicer 5.9, Slicer 5.11 Sep 12, 2025
@jcfr jcfr changed the title SH folder visibility fix BUG: Render 3D view quickly when SH folder visibility is toggled Sep 12, 2025
@cpinter
Copy link
Member Author

cpinter commented Sep 12, 2025

could you test if you can still reproduce issues with the latest Slicer Preview Release?

Sorry, again, I missed a comment. I'll do this in the next days. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants