Changes between Initial Version and Version 1 of Ticket #17551, comment 3


Ignore:
Timestamp:
Apr 16, 2026, 1:51:33 PM (4 weeks ago)
Author:
Eric Pettersen

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #17551, comment 3

    initial v1  
    1 Yeah, I agree there should be an public API to provide an arbitrary image for a label.  Currently the mutationscores label command monkey patches method ObjectLabel._label_image().  One idea is to add an ObjectLabel.label_image = None and clients can set label_image to a method and the current _label_image() will call that method if it is not None.  I'd be a bit concerned how this works with session saving.  The mutationscores label code does some fancy footwork in session restore to restore the monkey patches.  It would be better if a public API made it less likely for you to shoot yourself in the foot on session restore.
     1Yeah, I agree there should be an public API to provide an arbitrary image for a label.  Currently the mutationscores label command monkey patches method !ObjectLabel._label_image().  One idea is to add an !ObjectLabel.label_image = None and clients can set label_image to a method and the current _label_image() will call that method if it is not None.  I'd be a bit concerned how this works with session saving.  The mutationscores label code does some fancy footwork in session restore to restore the monkey patches.  It would be better if a public API made it less likely for you to shoot yourself in the foot on session restore.