This module handles tens of objects in a handful of folders that are created and deleted during the workflow. Till now it was stable enough. But now it is not, one folder with lots of items and subfolders is not visible on the subject hierarchie till I press right click on some folder visibility button, then it appears but Slicer shows the processing mouse cursor animation and then it crashes (sometimes). Other times it crashes when I start processing but not reliably (this involves creation and deletion of folders).
I mean today’s preview release by “now” and “till now”.
To investigate, we need to be able to reproduce the issue. Ideally, a script that we can copy-paste into the Python console.
On a virtual surgical plan, BRP creates the hierarchy below when clicking the “Update fibula planes over the fibula line, bone pieces and transform them to the mandible” button:
BoneReconstructionPlanner/
Mandible reconstruction/
LotsOfNodesAndSubfolders
Inverse mandible reconstruction/ <-- this folder visibility is set to hidden while creating it
LotsOfNodesAndSubfolders
There are two problems with the image below:
The “Inverse mandible reconstruction” folder doesn’t appear on the qMRMLSubjectHierarchyTreeView although it has been created.
The orange mandible that appears over the fibula on the lower 3D view is inside the “Inverse mandible reconstruction” folder (and it should be hidden because its parent folder is hidden)
You need to install BoneReconstructionPlanner extension, then in “application settings”->“modules” replace the BRP folder path by the module path inside this branch of BRP, load the scene I provided, switch to BoneReconstructionPlanner module and do the button-clicks I explained at the beginning.
If you delete and create a folder with the same name Slicer remembers if it was visible or not before you would have deleted it
This is useful for BRP because you can select on the treeview if you want to see the folder of “Mandible reconstruction” or “Inverse mandible reconstruction” and then after updating the virtual surgical plan it doesn’t autotoggle back to “Mandible reconstruction” folder
It should be safe to call folderPlugin.setDisplayVisibility(inverseMandibleReconstructionFolder, 0) right after creating the folder. I could not reproduce any issue with calling this method immediately.
Would you be able to come up with a minimal example that demonstrates how calling setDisplayVisibility immediately causes any issue?