Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#1999 closed defect (fixed)

Label scaling erratic

Reported by: olibclarke@… Owned by: Tom Goddard
Priority: normal Milestone:
Component: Graphics Version:
Keywords: Cc: Elaine Meng
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

The following bug report has been submitted:
Platform:        Darwin-18.6.0-x86_64-i386-64bit
ChimeraX Version: 0.9 (2019-06-05)
Description
Hi,

Some weirdness going on with the individual residue "label" mouse mode, seems to only happen when used alongside the "zone" mouse mode:

https://www.dropbox.com/s/c141iktfsftuqa0/chimera_label_bug.mov?dl=0

(Last bit of video is where the weird bahvior is)

The "zone" residue labels always scale with zoom. The individual residue labels sometimes scale with zoom, and sometimes do not at all.

Cheers
Oli

Log:
UCSF ChimeraX version: 0.9 (2019-06-05)  
© 2016-2019 Regents of the University of California. All rights reserved.  
How to cite UCSF ChimeraX  

> open 1bl8 format mmCIF fromDatabase pdb

1bl8 title:  
Potassium channel (KCSA) from streptomyces lividans [more info...]  
  
Chain information for 1bl8 #1  
---  
Chain | Description  
A B C D | protein (potassium channel protein)  
  
  

> ui mousemode rightMode label

> label #1/C:37

> camera ortho

> view cofr false

> ui mousemode rightMode zone

> zone /A:46

> ui mousemode rightMode label

> label #1/C:37

> label #1/D:34

> label #1/A:32




OpenGL version: 4.1 ATI-2.9.26
OpenGL renderer: AMD Radeon Pro 580 OpenGL Engine
OpenGL vendor: ATI Technologies Inc.

Change History (11)

comment:1 by pett, 6 years ago

Component: UnassignedGraphics
Owner: set to Tom Goddard
Platform: all
Project: ChimeraX
Status: newassigned
Summary: ChimeraX bug report submissionLabel scaling erratic

comment:2 by Tom Goddard, 6 years ago

Cc: Elaine Meng added

Residue labels can either have height specified in screen pixels or height specified in Angstroms depending on the label command size and height options. The label mouse mode uses the default setting which is label size in pixels, while the zone command makes labels with heights in Angstroms. When you zoom out labels specified in pixels remain the same size on the screen while labels specified in Angstroms get smaller.

This all is pretty weird with the label and zone mouse modes using different label sizing behavior. The weirdness reflects our uncertainty about which kind of scaling is best. Chimera only hand sizes fixed in pixels, ChimeraX offers either pixels or Angstroms.

There is also a bug when both zone and label mouse modes are used that the labels made with label mouse mode don't maintain fixed size in pixels. This is a bug in the label graphics code where it is not sizing the labels correctly because the zone command is using an option to only update the label direction after a minimum rotation of 45 degrees -- that is a setting that applies to all labels for a structure, and that code has a bug where it is not updating the pixel-size labels except after a 45 degree rotation.

I'll fix the scaling bug. But probably we should do more and use the same sizing behavior for both label and zone mouse modes.

in reply to:  3 ; comment:3 by olibclarke@…, 6 years ago

Thanks Tom - my 2 cents are that I much, much prefer the Angstrom scaling behavior as the default. It feels much more natural for interactive use IMO.\\

Cheers
Oli



in reply to:  4 ; comment:4 by goddard@…, 6 years ago

I also think the Angstrom scaling is probably best, but since Chimera did not have that we have not yet decided to change to it in ChimeraX.  Besides appearance, the Angstrom scaling can have much better rendering performance as you zoom in and out with lots of labels shown.  With pixel sizing it has to constantly rebuild the labels at every zoom step.

in reply to:  5 ; comment:5 by Elaine Meng, 6 years ago

Just to doublecheck, Oli, you prefer the one that is not in Chimera?  I was going to say that people are more “used to” the pixel scaling in Chimera, although that in itself may not be reason enough to prefer it.  Also, if the pixel scaling means that labels will be teensy on high-res displays, that would be an argument against it.  An argument for pixel scaling, however, is that I think it’s harder to pick a sufficiently un-annoying default angstrom size because people view things at so many scales.  Is there a difference in drawing speed? I’d thought that when I was showing a bunch of labels things became slow, but I may have attributed that to the wrong thing.

in reply to:  6 ; comment:6 by Elaine Meng, 6 years ago

Maybe there could be a preference for default label size and whether it’s in pixels or angstroms.

in reply to:  7 ; comment:7 by olibclarke@…, 6 years ago

I definitely prefer the one that is *not* in chimera - labels that scale with the size of the molecule. 

Non-scaling labels have always seemed weird to me - they look ridiculous when one zooms out. An easy way to interactively adjust the size of labels might be nice - perhaps some kind of inspection panel accessible from the model window?

Oli


in reply to:  8 ; comment:8 by goddard@…, 6 years ago

Pixel scaling can be made to not give tiny labels on retina displays -- ChimeraX knows if it is using a retina display.  So that is not a factor.  The most usable scaling behavior should be chosen.  We don't have to follow Chimera.

It is a question whether a reasonable default size in Angstroms can be chosen.  I think probably it can be, since in order for the labels to be useful you have to be zoomed to a reasonable level.  If you are zoomed way out, then the pixel-size labels are too big and all overlap each other, and the Angstrom size labels are too small to read.  So labels in general only will work if the zoom level is appropriate.

As far as performance, the Angstrom labels can be faster when there are a hundred labels because they scale in the same way as the structure, and that is all handled by OpenGL.  But both types of labels if they rotate to face you cause a slowdown.  So it is only when zooming, or if the labels are set not to continuously reorient that the Angstrom labels have a speed advantage.

in reply to:  9 ; comment:9 by olibclarke@…, 6 years ago

The scale of the labels used for the “zone around atoms” mode is fine as a default I think. I am using it on a 27” retina iMac with no problems.

Cheers
Oli


comment:10 by Tom Goddard, 6 years ago

Resolution: fixed
Status: assignedclosed

This label scaling bug happened because the zone mouse mode did not reorient labels to face the viewer continuously (instead only after a 45 degree rotation). I have changed the zone mouse mode so it orients the labels continuously.

I also changed the default label size to use physical units (0.7 Angstroms high) instead of pixels so these labels will get bigger and smaller as you zoom in and out. Label size can be controlled with the size and height options of the label command.

I changed the label orient option that allowed reorienting labels to face the viewer after some degrees of rotation so it is a global setting controlled by a new "label orient" command. This is probably only of interest in VR and is enabled and disabled automatically when the vr command is used.

in reply to:  11 ; comment:11 by olibclarke@…, 6 years ago

This is much better - thanks!

one thought:

* The default label style used when using the “label” mouse mode vs the “zone” mouse mode is different. The “label” mouse mode defaults to black text (or white text if the background is black), while the “zone” mode defaults to yellow text, on a black boxed background. The “zone” labels in my opinion are much more readable, particularly when zoomed out a bit - the opaque box background helps a lot with visibility in the context of a complex structure. Is there any reason why both modes couldn’t use the same label style? Perhaps for distances also? 

Or maybe just let users configure some default global display preferences in the “Labels” section of preferences - font (+color+scale in Å/px), background (yes/no/color/transparency), etc, and then have these apply by default to all labels.

Cheers
Oli


Note: See TracTickets for help on using tickets.