e0404 / matRad

An open source multi-modality radiation treatment planning sytem developed by e0404 @ DKFZ
http://www.matRad.org
Other
227 stars 176 forks source link

structure visibility change resets viewing widget to isocenter #766

Closed amitantony closed 2 months ago

amitantony commented 2 months ago

bug fix: Viewing widget doing a full update (skips to isocenter), when select/deselecting structure visibility

expected result: update contour without recentering image and reloading viewingWidget

wahln commented 2 months ago

The issue is that the setting actually changes the cst (the Visible property in the 5th col). Are you sure this does not have other consequences (e.g. computing contours?)

I think I encountered some similar thing with objectives, did not want all updates so I defined "cst_obj" as an event. Maybe something similar would make sense, e.g., "cst_param"?

amitantony commented 2 months ago

Summary of the Viewing Widget doUpdate function :

  1. for all events, It updates the plot ( includes our cst_param event )
  2. Initializing Widget for big changes to ct and cst ( defined by the event)
  3. Update IsoDoseLineCache for when theres changes to the visualized components of resultGUI

In summary, The current Fix works as is, But to be more exact and efficient we should modularize the update function to 'UpdateCt', 'UpdateVOIContour', 'UpdateDoseSlice'', etc. ( longer fix )

wahln commented 2 months ago

Yes, there's a few things in the GUI components (especially with regards to update functions) which is a bit annoying to handle. It would probably be more performant as well if only individual components are updated in the ViewingWidget and so son. However, updating the individual plot components might not be as easy. I will test this fix and merge it if it works good enough.