Opened 2 years ago

Closed 23 months ago

Last modified 23 months ago

#10198 closed enhancement (fixed)

Need a volume viewer opened trigger

Reported by: Zach Pearson Owned by: Tom Goddard
Priority: moderate Milestone:
Component: UI Version:
Keywords: Cc: Eric Pettersen
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

It would be helpful if there was a trigger that fired when the volume viewer was opened so the orthoplane viewers could add their custom panels to it. Right now they rely on the assumption that it will always be open, but the user may close and reopen it.

Change History (9)

comment:1 by Eric Pettersen, 2 years ago

Cc: Eric Pettersen added

comment:2 by Eric Pettersen, 2 years ago

There is a chimerax.core.tools.ADD_TOOL_INSTANCE trigger that fires whenever any tool starts. The associated trigger data is a list of newly started tool instances.

comment:3 by Zach Pearson, 2 years ago

Thanks!

comment:4 by Tom Goddard, 2 years ago

What panels are you suggesting adding to the Volume Viewer gui? That gui was not designed to have panels added to it from other tools (and the code is a complete mess of junk leftover from Chimera). What would be the purpose of adding panels rather than using separate panels? Given the complexity of the Volume Viewer interface and the DICOM capabilities I don't see how combining them makes sense.

comment:5 by Zach Pearson, 2 years ago

They are specialized histogram panels (they don't display a plane slider or the menu for changing between plane, surface, volume, etc) that let users change the colors and do leveling on the 2D views. The DICOM code manages the panels that get added. It closes them when the user changes away from one of the 2D layouts, or when the user changes what's shown in one of the viewports, so that there are no dangling panels.

comment:6 by Tom Goddard, 2 years ago

I see, so it is not about adding to the Volume Viewer, more like taking away.

What are the command equivalents for manipulating these 2D views? The volume histogram does not show model numbers for them, it shows "#" and when Volume Viewer logs commands they are invalid (e.g. changing the color: "volume # color white color #ff76ff color white" -> Expected a density maps specifier or a keyword).

Trying to shoehorn 2D-only views into Volume Viewer is not a good idea. It will break when the Volume Viewer code is changed. If you modified the Volume Viewer code directly to add these 2D views without consulting with me, let's have a meeting to discuss. That kind of change should not have been made without discussion.

comment:7 by Zach Pearson, 2 years ago

There are no command equivalents at the moment. I didn't change the volume viewer code; I subclassed from HistogramPane.

comment:8 by Tom Goddard, 23 months ago

Resolution: fixed
Status: assignedclosed

Seems the chimerax.core.tools.ADD_TOOL_INSTANCE trigger does what you need.

comment:9 by Zach Pearson, 23 months ago

I did hook into this, but I needed to use a workaround. Because tools are added to the session and fire this trigger before they are fully initialized, it is not possible to interact with them in the state they're in when they're passed as arguments to ADD_TOOL_INSTANCE callbacks. Instead, I needed to set up a QTimer that waited a half second before calling the code I actually wanted to call.

Note: See TracTickets for help on using tickets.