Opened 7 months ago

Last modified 7 months ago

#17093 assigned enhancement

Add volume display auto-contrast capability

Reported by: ricardorighetto@… Owned by: Tom Goddard
Priority: moderate Milestone:
Component: Volume Data Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

Ricardo Righetto says he sees more detail in tomogram slices in 3dmod than in ChimeraX that he thinks may be because of 3dmod cubic interpolation. He provided images that suggest that the more important difference is the 3dmod auto-contrast function which makes the 3dmod image have much higher contrast.

Discussion on ChimeraX mailing list is here

https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/thread/W2GN55INWG4YFH5UXFYV6GGCZ6JO6Z3X/

Attachments (1)

3dmod_chimerax_compare.png (2.2 MB ) - added by Tom Goddard 7 months ago.
Comparison 3dmod on left, chimerax on right.

Change History (3)

by Tom Goddard, 7 months ago

Attachment: 3dmod_chimerax_compare.png added

Comparison 3dmod on left, chimerax on right.

comment:1 by Tom Goddard, 7 months ago

Ricardo figured out the exact 3dmod auto contrast algorithm and replicated it in ChimeraX and it produced identical appearance with nearest neighbor interpolation as shown in Ricardo's mailing list message

https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/message/HXDCWJXUVIE7ZGV2TMMH6HMFOGJOTU5T/

comment:2 by Tom Goddard, 7 months ago

Here is the text of Ricardo's auto contrast algorithm email

Hi Tom,

Thank you so much for looking further into this. I believe addressing both the contrast and the interpolation issues will greatly improve visualization of cryo-ET data.

I've now managed to emulate the Auto-contrast levels from IMOD in ChimeraX. I have also made screenshots from both programs using nearest-neighbor interpolation, which are available from the same download link as before.

As can be seen in my 3dmod Info window, I have the following contrast slider values after hitting "Auto" on that tomo slice:

image.png

(The Low and High sliders are enabled by setting "Load non-byte data into program as 16-bit integers" in Edit --> Options --> Load/Scale)

After digging through the IMOD documentation
https://bio3d.colorado.edu/imod/doc/3dmodguide.html#InformationWindow
https://bio3d.colorado.edu/imod/betaDoc/man/3dmod.html#TOP

I understood that the intensity value -0.5779 stored in the MRC file is mapped to grayscale 0 while 0.4262 is mapped to 255. This mapping is defined by the Low and High sliders.
After this mapping, the contrast is stretched such that the grayscale 53 in that mapping becomes the new 0 and 200 becomes the new 255. This second mapping is defined by the Black and White sliders.

Doing the math, I could then tell ChimeraX:

vol #1 color gray(0) level -0.3692,1 color gray(256) level 0.20963,1
# Furthermore:
camera ortho
vol #1 linearinterpolation false
zoom pixelsize 10.74
zoom 4

Comparing IMOD/ChimeraX side by side:
image.png image.png
(snaps taken with the mouse hence the imprecision)

However, how does IMOD get to these values in the first place when you hit "Auto" is a different story, which is not yet clear to me. But I believe an Auto-contrast from -2 to +2 SD levels or -3 to +3 would work close enough (that's usually how I get a "nice" contrast started in ChimeraX -- btw I absolutely love to use rmsLevel and sdLevel!).

As for the cross artifacts, would trilinear interpolation considering the slices above and below the current one being displayed alleviate the issue?

I'm not sure if I can reply to the tickets directly, so I wrote here. May also be helpful to others wanting to emulate IMOD auto-contrast.

Thanks again!

--
Ricardo Diogo Righetto

Note: See TracTickets for help on using tickets.