I was trying to display a color legend in some custom slice views when I noticed that it was not showing as I expected. Is there a certain set of conditions to make sure the color legend shows in the other non-standard slice views.
I start Slicer 5.2.1 (and latest Slicer Preview 5.3.0-2023-02-10), set layout to Four-Up, close Slicer, restart Slicer then run the below snippet
Then if I close Slicer so that it remembers the “Three over three” layout, relaunch Slicer and run the same script I observe the following where the color legend is showing in all the slice views as I would expect:
Is it possible to update displayable manager data using data from other displayable manager? When we create a non standard slice view and displayable manager for that view we must somehow to get color legend actors from already displayed views (for example from Red slice). Since a newly created slice views don’t have such data.
In general, no. Displayable managers should be kept independent to keep the overall complexity of the application manageable.
What do you mean by “non-standard”?
Why would you need to get the color legend actors?
And why would you need to get any information from other displayable managers instead of getting information directly from the MRML scene content? If there is some logic that you don’t want to repeat in multiple displayable managers then that logic can be moved to somewhere the displayable managers can all access it (in MRML display node, MRML logic classes, etc.).