-
Notifications
You must be signed in to change notification settings - Fork 30
ENH: Implement deactivate() for fast marching #63
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
ENH: Implement deactivate() for fast marching #63
Conversation
|
cc: @lassoan @Sunderlandkyl for review thoughts here. This is something our group observed and thought should change based on our development to expose this effect into our Slicer custom app. |
|
This change looks good to me. I'm just wondering how this behaves if the user saves the scene while the preview is active. When the user restsrts Slicer and opens the saved scene, data that was temporarily saved in variables are lost, which may lead to data loss or inconsistent state. |
|
Do you know offhand what happens when a user saves the scene while Fill Between Slices preview is active? Is that preview restored? I believe Fast Marching is unique in that its "preview" is directly modifying the actual segment rather than a temp segment object. I would assume saving the scene will save the segmentation node at its current preview or if the effect is deactivated prior to save then yes it would lose the preview's changes. |
|
Auto-complete effects are working well (we had to be careful saving everything into the scene to make sure scene saving and loading dors not mess up things). Threshold preview is quite robust, too. |
|
@jamesobutler is correct. Since the Fast Marching preview label map is stored in the active segment, the preview is written to disk on save. This PR doesn't do anything to modify that behavior. |
|
Yes, I agree, this change does not affect the incorrect behavior (original segment is lost) when the scene is saved and reloaded. The fix for that would probably require to create a temporary segmentation to preview the result, so the current fix might not be necessary or it may work somewhat differently. @ThomasKierski |
|
OK, this is an improvement for sure and we'll work on the final solution (that is more robust and probably allows faster updates, even in 3D), so let's merge this. I'm just curious, why was it necessary to make a copy of |
|
@lassoan it may have been something peculiar to my environment, but I had an odd edge case pop up where an observer on the active segmentation node / segmentation was causing recursion due to |
|
Tabs for the explanation. Such information needs to be added a comments to the code, because without that the next time someone touches that part of the code will remove the unexplained, seemingly unnecessary steps. Since this code will not stay there for long (as you are already working on a new solution) it is OK to leave it there as is. |
This PR adds an implementation of
deactivate()to the Fast Marching segment editor effect to address the issue where the "preview" label map was not cleaned up when the user switches to another segment editor effect or module. This presented some confusing possibilities, such as the one shown in the video below where a user could edit the preview label map.This PR
fm_pr.mp4
Current
mainbranchfm_issue_720p.mp4