Feature suggestion: cubic interpolation for image display

Dear ChimeraX team, (I have a vague memory of discussing this before, apologies if duplicate!) When displaying volumes as images (e.g. cryo-ET volume slices), I see that by default it uses linear interpolation: https://www.rbvi.ucsf.edu/chimerax/docs/user/commands/volume.html#style Would it be possible to offer higher-order interpolation options such as cubic? I love how customizable it is to make figures in ChimeraX, but this is the one feature that we really miss compared e.g. to 3dmod from IMOD. Thank you! -- Ricardo Diogo Righetto

The link I intended to send is actually this one https://www.rbvi.ucsf.edu/chimerax/docs/user/commands/volume.html#dispsolid -- Ricardo Diogo Righetto Em qua., 12 de mar. de 2025 às 14:37, Ricardo Righetto < ricardorighetto@gmail.com> escreveu:
Dear ChimeraX team,
(I have a vague memory of discussing this before, apologies if duplicate!)
When displaying volumes as images (e.g. cryo-ET volume slices), I see that by default it uses linear interpolation: https://www.rbvi.ucsf.edu/chimerax/docs/user/commands/volume.html#style
Would it be possible to offer higher-order interpolation options such as cubic?
I love how customizable it is to make figures in ChimeraX, but this is the one feature that we really miss compared e.g. to 3dmod from IMOD.
Thank you!
-- Ricardo Diogo Righetto

Hi Ricardo, ChimeraX volume display supports nearest neighbor and trilinear interpolation. Nearest neighbor means when rendering on the screen the nearest volume grid point is used for the intensity while trilinear means the interpolation is linear along the x, y and z axes. 3dmod in IMOD says it does nearest neighbor and cubic: "The checkerboard button toggles between nearest neighbor and slower, cubic interpolation." https://bio3d.colorado.edu/imod/doc/man/3dmod.html It is a bit strange that 3dmod offers nearest neighbor but not linear and quadratic, and jumps right to cubic, especially since cubic involves sampling 4 data points along each axis. But looking at the 3dmod code file b3dgfx.cpp getCubicFactors() reveals it indeed uses 4 consecutive data values and is using a form of cubic interpolation. ChimeraX does linear interpolation on the GPU as it renders and it is built into OpenGL graphics so it is very fast. While we could write out own GPU shader code to do higher-order interpolation it would be somewhat complicated. I am curious how much better cubic interpolation looks. Could you send an image of a tomogram view using 3dmod cubic interpolation and the same view with ChimeraX tri-linear interpolation (the default) to give an idea of the improvement? If it is much better I may write the GPU shader code to do it. One thing you could try is to use the ChimeraX volume rendering option colormapOnGpu volume #1 colormapOnGpu true This interpolates the volume values for each screen pixel in the rendering and then maps them to color brightness while the default (colormapOnGpu false) interpolates the colors for each grid point of the data. In my test on tomogram EMDB 1273 it made little difference. This option is used primarily for DICOM medical imaging where very large jumps in intensity occur from voxel to voxel for seeing fine features like airways in lungs. Tom
On Mar 12, 2025, at 6:37 AM, Ricardo Righetto via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Dear ChimeraX team,
(I have a vague memory of discussing this before, apologies if duplicate!)
When displaying volumes as images (e.g. cryo-ET volume slices), I see that by default it uses linear interpolation: https://www.rbvi.ucsf.edu/chimerax/docs/user/commands/volume.html#style
Would it be possible to offer higher-order interpolation options such as cubic?
I love how customizable it is to make figures in ChimeraX, but this is the one feature that we really miss compared e.g. to 3dmod from IMOD.
Thank you!
-- Ricardo Diogo Righetto _______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/

Hi Tom, I tried to reproduce almost exactly the same scene in IMOD and in ChimeraX. I made screenshots so you can see exactly what I see on my screen, but since we run everything through a VNC session on the cluster with OpenGL rendering through VirtualGL, which I know is not officially supported by either program, I also exported PNGs from both. For IMOD, I used the default Auto-contrast at the slice I wanted to show, and exported the PNG using its snapshot key binding. For ChimeraX, I tried to pan the view to approximately the same position, enforced the same zoom level, and tried to match the contrast as best as possible (somehow, applying the same levels that the 3dmod main window showed me didn't yield the same results in ChimeraX -- but that's probably my misunderstanding of how levels are set in 3dmod). I then exported the scene with the command save ~/Pictures/save_chimerax.png width 1563 height 1114 supersample 4 (these dimensions were meant to match the IMOD-exported PNG) I hope you can appreciate how in IMOD the inner details of the contractile injection system, the ribosomes, the membrane leaflets and even from within the lipid droplets appear much "sharper". Furthermore, it concerns me that in ChimeraX there is some sort of directional aliasing artifacts inside the membrane double leaflets (roughly horizontal, top ~left, and roughly vertical, center ~right). I don't know if that's a direct consequence of the trilinear interpolation, or some other issue. I could not see any difference by setting 'volume #1 colormapOnGpu true', but it might be due to our "unusual" remote display setup, not sure. Please find the files for download here: https://drive.switch.ch/index.php/s/VrLA0hqUSB2HqQt Thank you so much for looking into this! Best wishes, -- Ricardo Diogo Righetto Em qua., 12 de mar. de 2025 às 18:43, Tom Goddard <goddard@sonic.net> escreveu:
Hi Ricardo,
ChimeraX volume display supports nearest neighbor and trilinear interpolation. Nearest neighbor means when rendering on the screen the nearest volume grid point is used for the intensity while trilinear means the interpolation is linear along the x, y and z axes. 3dmod in IMOD says it does nearest neighbor and cubic:
"The checkerboard button toggles between nearest neighbor and slower, cubic interpolation."
https://bio3d.colorado.edu/imod/doc/man/3dmod.html
It is a bit strange that 3dmod offers nearest neighbor but not linear and quadratic, and jumps right to cubic, especially since cubic involves sampling 4 data points along each axis. But looking at the 3dmod code file b3dgfx.cpp getCubicFactors() reveals it indeed uses 4 consecutive data values and is using a form of cubic interpolation. ChimeraX does linear interpolation on the GPU as it renders and it is built into OpenGL graphics so it is very fast. While we could write out own GPU shader code to do higher-order interpolation it would be somewhat complicated. I am curious how much better cubic interpolation looks. Could you send an image of a tomogram view using 3dmod cubic interpolation and the same view with ChimeraX tri-linear interpolation (the default) to give an idea of the improvement? If it is much better I may write the GPU shader code to do it.
One thing you could try is to use the ChimeraX volume rendering option colormapOnGpu
volume #1 colormapOnGpu true
This interpolates the volume values for each screen pixel in the rendering and then maps them to color brightness while the default (colormapOnGpu false) interpolates the colors for each grid point of the data. In my test on tomogram EMDB 1273 it made little difference. This option is used primarily for DICOM medical imaging where very large jumps in intensity occur from voxel to voxel for seeing fine features like airways in lungs.
Tom
On Mar 12, 2025, at 6:37 AM, Ricardo Righetto via ChimeraX-users < chimerax-users@cgl.ucsf.edu> wrote:
Dear ChimeraX team,
(I have a vague memory of discussing this before, apologies if duplicate!)
When displaying volumes as images (e.g. cryo-ET volume slices), I see that by default it uses linear interpolation: https://www.rbvi.ucsf.edu/chimerax/docs/user/commands/volume.html#style
Would it be possible to offer higher-order interpolation options such as cubic?
I love how customizable it is to make figures in ChimeraX, but this is the one feature that we really miss compared e.g. to 3dmod from IMOD.
Thank you!
-- Ricardo Diogo Righetto _______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/

Hi Ricardo, I think it makes most sense to compare screen captures since that is what you see on the screen. In particular the non-screen-capture saved image with ChimeraX option "supersample 4" is expanding the resolution 4-fold and then binning which makes edges smoother but may smooth everything which I gather you don't want if you want to see detail. It would probably be interesting to compare to a 3rd screen capture with nearest-neighbor so we see the actual size of the data voxels. At any rate here is a zoom in of 3dmod on left and ChimeraX on right from your screen captures. My main impression is that the contrast set in 3dmod with the "Auto-contrast" function gives a higher contrast image which probably helps see detail. The cubic interpolation 3dmod image actually looks less smooth than ChimeraX, but maybe that is also an effect of the higher contrast. We don't have an auto-contrast feature in ChimeraX but I think that could be quite useful, more useful than cubic interpolation. Tom 
On Mar 13, 2025, at 3:10 AM, Ricardo Righetto via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi Tom,
I tried to reproduce almost exactly the same scene in IMOD and in ChimeraX. I made screenshots so you can see exactly what I see on my screen, but since we run everything through a VNC session on the cluster with OpenGL rendering through VirtualGL, which I know is not officially supported by either program, I also exported PNGs from both.
For IMOD, I used the default Auto-contrast at the slice I wanted to show, and exported the PNG using its snapshot key binding. For ChimeraX, I tried to pan the view to approximately the same position, enforced the same zoom level, and tried to match the contrast as best as possible (somehow, applying the same levels that the 3dmod main window showed me didn't yield the same results in ChimeraX -- but that's probably my misunderstanding of how levels are set in 3dmod). I then exported the scene with the command
save ~/Pictures/save_chimerax.png width 1563 height 1114 supersample 4 (these dimensions were meant to match the IMOD-exported PNG)
I hope you can appreciate how in IMOD the inner details of the contractile injection system, the ribosomes, the membrane leaflets and even from within the lipid droplets appear much "sharper". Furthermore, it concerns me that in ChimeraX there is some sort of directional aliasing artifacts inside the membrane double leaflets (roughly horizontal, top ~left, and roughly vertical, center ~right). I don't know if that's a direct consequence of the trilinear interpolation, or some other issue.
I could not see any difference by setting 'volume #1 colormapOnGpu true', but it might be due to our "unusual" remote display setup, not sure.
Please find the files for download here: https://drive.switch.ch/index.php/s/VrLA0hqUSB2HqQt
Thank you so much for looking into this!
Best wishes,
-- Ricardo Diogo Righetto
Em qua., 12 de mar. de 2025 às 18:43, Tom Goddard <goddard@sonic.net <mailto:goddard@sonic.net>> escreveu:
Hi Ricardo,
ChimeraX volume display supports nearest neighbor and trilinear interpolation. Nearest neighbor means when rendering on the screen the nearest volume grid point is used for the intensity while trilinear means the interpolation is linear along the x, y and z axes. 3dmod in IMOD says it does nearest neighbor and cubic:
"The checkerboard button toggles between nearest neighbor and slower, cubic interpolation."
https://bio3d.colorado.edu/imod/doc/man/3dmod.html
It is a bit strange that 3dmod offers nearest neighbor but not linear and quadratic, and jumps right to cubic, especially since cubic involves sampling 4 data points along each axis. But looking at the 3dmod code file b3dgfx.cpp getCubicFactors() reveals it indeed uses 4 consecutive data values and is using a form of cubic interpolation. ChimeraX does linear interpolation on the GPU as it renders and it is built into OpenGL graphics so it is very fast. While we could write out own GPU shader code to do higher-order interpolation it would be somewhat complicated. I am curious how much better cubic interpolation looks. Could you send an image of a tomogram view using 3dmod cubic interpolation and the same view with ChimeraX tri-linear interpolation (the default) to give an idea of the improvement? If it is much better I may write the GPU shader code to do it.
One thing you could try is to use the ChimeraX volume rendering option colormapOnGpu
volume #1 colormapOnGpu true
This interpolates the volume values for each screen pixel in the rendering and then maps them to color brightness while the default (colormapOnGpu false) interpolates the colors for each grid point of the data. In my test on tomogram EMDB 1273 it made little difference. This option is used primarily for DICOM medical imaging where very large jumps in intensity occur from voxel to voxel for seeing fine features like airways in lungs.
Tom
On Mar 12, 2025, at 6:37 AM, Ricardo Righetto via ChimeraX-users <chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu>> wrote:
Dear ChimeraX team,
(I have a vague memory of discussing this before, apologies if duplicate!)
When displaying volumes as images (e.g. cryo-ET volume slices), I see that by default it uses linear interpolation: https://www.rbvi.ucsf.edu/chimerax/docs/user/commands/volume.html#style
Would it be possible to offer higher-order interpolation options such as cubic?
I love how customizable it is to make figures in ChimeraX, but this is the one feature that we really miss compared e.g. to 3dmod from IMOD.
Thank you!
-- Ricardo Diogo Righetto _______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu> To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu <mailto:chimerax-users-leave@cgl.ucsf.edu> Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/

Hi Ricardo, The horizontal and vertical artifacts, seen as crosses on bright points in ChimeraX is distracting and I guess is an effect of the trilinear interpolation (biliear for a single plane image). It almost looks like refractor telescope artifacts where a horizontal and vertical spider arms hold the secondary mirror. It is worth investigating those artifacts too. I've made a ChimeraX ticket to look into the contrast https://www.rbvi.ucsf.edu/trac/ChimeraX/attachment/ticket/17093/ and cross artifacts https://www.rbvi.ucsf.edu/trac/ChimeraX/ticket/17094 Tom
On Mar 13, 2025, at 6:00 PM, Tom Goddard via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi Ricardo,
I think it makes most sense to compare screen captures since that is what you see on the screen. In particular the non-screen-capture saved image with ChimeraX option "supersample 4" is expanding the resolution 4-fold and then binning which makes edges smoother but may smooth everything which I gather you don't want if you want to see detail. It would probably be interesting to compare to a 3rd screen capture with nearest-neighbor so we see the actual size of the data voxels.
At any rate here is a zoom in of 3dmod on left and ChimeraX on right from your screen captures. My main impression is that the contrast set in 3dmod with the "Auto-contrast" function gives a higher contrast image which probably helps see detail. The cubic interpolation 3dmod image actually looks less smooth than ChimeraX, but maybe that is also an effect of the higher contrast. We don't have an auto-contrast feature in ChimeraX but I think that could be quite useful, more useful than cubic interpolation.
Tom
<3dmod_chimerax_compare.png>
On Mar 13, 2025, at 3:10 AM, Ricardo Righetto via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi Tom,
I tried to reproduce almost exactly the same scene in IMOD and in ChimeraX. I made screenshots so you can see exactly what I see on my screen, but since we run everything through a VNC session on the cluster with OpenGL rendering through VirtualGL, which I know is not officially supported by either program, I also exported PNGs from both.
For IMOD, I used the default Auto-contrast at the slice I wanted to show, and exported the PNG using its snapshot key binding. For ChimeraX, I tried to pan the view to approximately the same position, enforced the same zoom level, and tried to match the contrast as best as possible (somehow, applying the same levels that the 3dmod main window showed me didn't yield the same results in ChimeraX -- but that's probably my misunderstanding of how levels are set in 3dmod). I then exported the scene with the command
save ~/Pictures/save_chimerax.png width 1563 height 1114 supersample 4 (these dimensions were meant to match the IMOD-exported PNG)
I hope you can appreciate how in IMOD the inner details of the contractile injection system, the ribosomes, the membrane leaflets and even from within the lipid droplets appear much "sharper". Furthermore, it concerns me that in ChimeraX there is some sort of directional aliasing artifacts inside the membrane double leaflets (roughly horizontal, top ~left, and roughly vertical, center ~right). I don't know if that's a direct consequence of the trilinear interpolation, or some other issue.
I could not see any difference by setting 'volume #1 colormapOnGpu true', but it might be due to our "unusual" remote display setup, not sure.
Please find the files for download here: https://drive.switch.ch/index.php/s/VrLA0hqUSB2HqQt
Thank you so much for looking into this!
Best wishes,
-- Ricardo Diogo Righetto
Em qua., 12 de mar. de 2025 às 18:43, Tom Goddard <goddard@sonic.net <mailto:goddard@sonic.net>> escreveu:
Hi Ricardo,
ChimeraX volume display supports nearest neighbor and trilinear interpolation. Nearest neighbor means when rendering on the screen the nearest volume grid point is used for the intensity while trilinear means the interpolation is linear along the x, y and z axes. 3dmod in IMOD says it does nearest neighbor and cubic:
"The checkerboard button toggles between nearest neighbor and slower, cubic interpolation."
https://bio3d.colorado.edu/imod/doc/man/3dmod.html
It is a bit strange that 3dmod offers nearest neighbor but not linear and quadratic, and jumps right to cubic, especially since cubic involves sampling 4 data points along each axis. But looking at the 3dmod code file b3dgfx.cpp getCubicFactors() reveals it indeed uses 4 consecutive data values and is using a form of cubic interpolation. ChimeraX does linear interpolation on the GPU as it renders and it is built into OpenGL graphics so it is very fast. While we could write out own GPU shader code to do higher-order interpolation it would be somewhat complicated. I am curious how much better cubic interpolation looks. Could you send an image of a tomogram view using 3dmod cubic interpolation and the same view with ChimeraX tri-linear interpolation (the default) to give an idea of the improvement? If it is much better I may write the GPU shader code to do it.
One thing you could try is to use the ChimeraX volume rendering option colormapOnGpu
volume #1 colormapOnGpu true
This interpolates the volume values for each screen pixel in the rendering and then maps them to color brightness while the default (colormapOnGpu false) interpolates the colors for each grid point of the data. In my test on tomogram EMDB 1273 it made little difference. This option is used primarily for DICOM medical imaging where very large jumps in intensity occur from voxel to voxel for seeing fine features like airways in lungs.
Tom
On Mar 12, 2025, at 6:37 AM, Ricardo Righetto via ChimeraX-users <chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu>> wrote:
Dear ChimeraX team,
(I have a vague memory of discussing this before, apologies if duplicate!)
When displaying volumes as images (e.g. cryo-ET volume slices), I see that by default it uses linear interpolation: https://www.rbvi.ucsf.edu/chimerax/docs/user/commands/volume.html#style
Would it be possible to offer higher-order interpolation options such as cubic?
I love how customizable it is to make figures in ChimeraX, but this is the one feature that we really miss compared e.g. to 3dmod from IMOD.
Thank you!
-- Ricardo Diogo Righetto _______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu> To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu <mailto:chimerax-users-leave@cgl.ucsf.edu> Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/

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: 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: image.png] [image: 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 Em sex., 14 de mar. de 2025 às 02:16, Tom Goddard <goddard@sonic.net> escreveu:
Hi Ricardo,
The horizontal and vertical artifacts, seen as crosses on bright points in ChimeraX is distracting and I guess is an effect of the trilinear interpolation (biliear for a single plane image). It almost looks like refractor telescope artifacts where a horizontal and vertical spider arms hold the secondary mirror. It is worth investigating those artifacts too. I've made a ChimeraX ticket to look into the contrast
https://www.rbvi.ucsf.edu/trac/ChimeraX/attachment/ticket/17093/
and cross artifacts
https://www.rbvi.ucsf.edu/trac/ChimeraX/ticket/17094
Tom
On Mar 13, 2025, at 6:00 PM, Tom Goddard via ChimeraX-users < chimerax-users@cgl.ucsf.edu> wrote:
Hi Ricardo,
I think it makes most sense to compare screen captures since that is what you see on the screen. In particular the non-screen-capture saved image with ChimeraX option "supersample 4" is expanding the resolution 4-fold and then binning which makes edges smoother but may smooth everything which I gather you don't want if you want to see detail. It would probably be interesting to compare to a 3rd screen capture with nearest-neighbor so we see the actual size of the data voxels.
At any rate here is a zoom in of 3dmod on left and ChimeraX on right from your screen captures. My main impression is that the contrast set in 3dmod with the "Auto-contrast" function gives a higher contrast image which probably helps see detail. The cubic interpolation 3dmod image actually looks less smooth than ChimeraX, but maybe that is also an effect of the higher contrast. We don't have an auto-contrast feature in ChimeraX but I think that could be quite useful, more useful than cubic interpolation.
Tom
<3dmod_chimerax_compare.png>
On Mar 13, 2025, at 3:10 AM, Ricardo Righetto via ChimeraX-users < chimerax-users@cgl.ucsf.edu> wrote:
Hi Tom,
I tried to reproduce almost exactly the same scene in IMOD and in ChimeraX. I made screenshots so you can see exactly what I see on my screen, but since we run everything through a VNC session on the cluster with OpenGL rendering through VirtualGL, which I know is not officially supported by either program, I also exported PNGs from both.
For IMOD, I used the default Auto-contrast at the slice I wanted to show, and exported the PNG using its snapshot key binding. For ChimeraX, I tried to pan the view to approximately the same position, enforced the same zoom level, and tried to match the contrast as best as possible (somehow, applying the same levels that the 3dmod main window showed me didn't yield the same results in ChimeraX -- but that's probably my misunderstanding of how levels are set in 3dmod). I then exported the scene with the command
save ~/Pictures/save_chimerax.png width 1563 height 1114 supersample 4 (these dimensions were meant to match the IMOD-exported PNG)
I hope you can appreciate how in IMOD the inner details of the contractile injection system, the ribosomes, the membrane leaflets and even from within the lipid droplets appear much "sharper". Furthermore, it concerns me that in ChimeraX there is some sort of directional aliasing artifacts inside the membrane double leaflets (roughly horizontal, top ~left, and roughly vertical, center ~right). I don't know if that's a direct consequence of the trilinear interpolation, or some other issue.
I could not see any difference by setting 'volume #1 colormapOnGpu true', but it might be due to our "unusual" remote display setup, not sure.
Please find the files for download here: https://drive.switch.ch/index.php/s/VrLA0hqUSB2HqQt
Thank you so much for looking into this!
Best wishes,
-- Ricardo Diogo Righetto
Em qua., 12 de mar. de 2025 às 18:43, Tom Goddard <goddard@sonic.net> escreveu:
Hi Ricardo,
ChimeraX volume display supports nearest neighbor and trilinear interpolation. Nearest neighbor means when rendering on the screen the nearest volume grid point is used for the intensity while trilinear means the interpolation is linear along the x, y and z axes. 3dmod in IMOD says it does nearest neighbor and cubic:
"The checkerboard button toggles between nearest neighbor and slower, cubic interpolation."
https://bio3d.colorado.edu/imod/doc/man/3dmod.html
It is a bit strange that 3dmod offers nearest neighbor but not linear and quadratic, and jumps right to cubic, especially since cubic involves sampling 4 data points along each axis. But looking at the 3dmod code file b3dgfx.cpp getCubicFactors() reveals it indeed uses 4 consecutive data values and is using a form of cubic interpolation. ChimeraX does linear interpolation on the GPU as it renders and it is built into OpenGL graphics so it is very fast. While we could write out own GPU shader code to do higher-order interpolation it would be somewhat complicated. I am curious how much better cubic interpolation looks. Could you send an image of a tomogram view using 3dmod cubic interpolation and the same view with ChimeraX tri-linear interpolation (the default) to give an idea of the improvement? If it is much better I may write the GPU shader code to do it.
One thing you could try is to use the ChimeraX volume rendering option colormapOnGpu
volume #1 colormapOnGpu true
This interpolates the volume values for each screen pixel in the rendering and then maps them to color brightness while the default (colormapOnGpu false) interpolates the colors for each grid point of the data. In my test on tomogram EMDB 1273 it made little difference. This option is used primarily for DICOM medical imaging where very large jumps in intensity occur from voxel to voxel for seeing fine features like airways in lungs.
Tom
On Mar 12, 2025, at 6:37 AM, Ricardo Righetto via ChimeraX-users < chimerax-users@cgl.ucsf.edu> wrote:
Dear ChimeraX team,
(I have a vague memory of discussing this before, apologies if duplicate!)
When displaying volumes as images (e.g. cryo-ET volume slices), I see that by default it uses linear interpolation: https://www.rbvi.ucsf.edu/chimerax/docs/user/commands/volume.html#style
Would it be possible to offer higher-order interpolation options such as cubic?
I love how customizable it is to make figures in ChimeraX, but this is the one feature that we really miss compared e.g. to 3dmod from IMOD.
Thank you!
-- Ricardo Diogo Righetto _______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/

Hi Ricardo, Thanks for the detailed investigation and explanation of the 3dmod auto contrast. That would be great to add to ChimeraX. I'll add your info to the ChimeraX ticket. You can reply to the ChimeraX ticket email to add any comments or images. I think you have made it perfectly clear how the auto contrast could work. I don't think using trilinear interpolation with 2 data planes is a good approach to handle the cross artifacts. First you would need to show 2 planes instead of 1 to get ChimeraX to use trilinear interpolation. For just one plane it will use bilinear and it will give actual planes of the volume, not an interpolation between two neighboring planes. That is important for making the sharpest details visible. If I show two planes I still see the horizontal/vertical/cross artifacts. But that is expected because the default rendering is using a stack of semi-transparent 2d planes with bilinear projection. You can change that to using trilinear projection (uses OpenGL 3D textures) using the "projectionMode 3d" option of the volume command. I tried and the artifacts are still visible. As expected the artifacts are less visible when there are multiple stacked planes shown. open 1273 from emdb volume #1 region 0,0,35,2047,2047,36 projectionMode 3d I have a vague recollection of studying the horizontal/vertical/cross artifacts about 15 years ago (in Chimera) and coming to the conclusion that they were intrinsic to the bilinear method which treats the x and y axes specially and is not rotationally invariant. I do not recall investigating solutions to that problem, but I'm sure solutions exist, though possibly they are too complex or slow for us to implement. Tom 
On Mar 14, 2025, at 4:59 AM, Ricardo Righetto via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
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
Em sex., 14 de mar. de 2025 às 02:16, Tom Goddard <goddard@sonic.net <mailto:goddard@sonic.net>> escreveu:
Hi Ricardo,
The horizontal and vertical artifacts, seen as crosses on bright points in ChimeraX is distracting and I guess is an effect of the trilinear interpolation (biliear for a single plane image). It almost looks like refractor telescope artifacts where a horizontal and vertical spider arms hold the secondary mirror. It is worth investigating those artifacts too. I've made a ChimeraX ticket to look into the contrast
https://www.rbvi.ucsf.edu/trac/ChimeraX/attachment/ticket/17093/
and cross artifacts
https://www.rbvi.ucsf.edu/trac/ChimeraX/ticket/17094
Tom
On Mar 13, 2025, at 6:00 PM, Tom Goddard via ChimeraX-users <chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu>> wrote:
Hi Ricardo,
I think it makes most sense to compare screen captures since that is what you see on the screen. In particular the non-screen-capture saved image with ChimeraX option "supersample 4" is expanding the resolution 4-fold and then binning which makes edges smoother but may smooth everything which I gather you don't want if you want to see detail. It would probably be interesting to compare to a 3rd screen capture with nearest-neighbor so we see the actual size of the data voxels.
At any rate here is a zoom in of 3dmod on left and ChimeraX on right from your screen captures. My main impression is that the contrast set in 3dmod with the "Auto-contrast" function gives a higher contrast image which probably helps see detail. The cubic interpolation 3dmod image actually looks less smooth than ChimeraX, but maybe that is also an effect of the higher contrast. We don't have an auto-contrast feature in ChimeraX but I think that could be quite useful, more useful than cubic interpolation.
Tom
<3dmod_chimerax_compare.png>
On Mar 13, 2025, at 3:10 AM, Ricardo Righetto via ChimeraX-users <chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu>> wrote:
Hi Tom,
I tried to reproduce almost exactly the same scene in IMOD and in ChimeraX. I made screenshots so you can see exactly what I see on my screen, but since we run everything through a VNC session on the cluster with OpenGL rendering through VirtualGL, which I know is not officially supported by either program, I also exported PNGs from both.
For IMOD, I used the default Auto-contrast at the slice I wanted to show, and exported the PNG using its snapshot key binding. For ChimeraX, I tried to pan the view to approximately the same position, enforced the same zoom level, and tried to match the contrast as best as possible (somehow, applying the same levels that the 3dmod main window showed me didn't yield the same results in ChimeraX -- but that's probably my misunderstanding of how levels are set in 3dmod). I then exported the scene with the command
save ~/Pictures/save_chimerax.png width 1563 height 1114 supersample 4 (these dimensions were meant to match the IMOD-exported PNG)
I hope you can appreciate how in IMOD the inner details of the contractile injection system, the ribosomes, the membrane leaflets and even from within the lipid droplets appear much "sharper". Furthermore, it concerns me that in ChimeraX there is some sort of directional aliasing artifacts inside the membrane double leaflets (roughly horizontal, top ~left, and roughly vertical, center ~right). I don't know if that's a direct consequence of the trilinear interpolation, or some other issue.
I could not see any difference by setting 'volume #1 colormapOnGpu true', but it might be due to our "unusual" remote display setup, not sure.
Please find the files for download here: https://drive.switch.ch/index.php/s/VrLA0hqUSB2HqQt
Thank you so much for looking into this!
Best wishes,
-- Ricardo Diogo Righetto
Em qua., 12 de mar. de 2025 às 18:43, Tom Goddard <goddard@sonic.net <mailto:goddard@sonic.net>> escreveu:
Hi Ricardo,
ChimeraX volume display supports nearest neighbor and trilinear interpolation. Nearest neighbor means when rendering on the screen the nearest volume grid point is used for the intensity while trilinear means the interpolation is linear along the x, y and z axes. 3dmod in IMOD says it does nearest neighbor and cubic:
"The checkerboard button toggles between nearest neighbor and slower, cubic interpolation."
https://bio3d.colorado.edu/imod/doc/man/3dmod.html
It is a bit strange that 3dmod offers nearest neighbor but not linear and quadratic, and jumps right to cubic, especially since cubic involves sampling 4 data points along each axis. But looking at the 3dmod code file b3dgfx.cpp getCubicFactors() reveals it indeed uses 4 consecutive data values and is using a form of cubic interpolation. ChimeraX does linear interpolation on the GPU as it renders and it is built into OpenGL graphics so it is very fast. While we could write out own GPU shader code to do higher-order interpolation it would be somewhat complicated. I am curious how much better cubic interpolation looks. Could you send an image of a tomogram view using 3dmod cubic interpolation and the same view with ChimeraX tri-linear interpolation (the default) to give an idea of the improvement? If it is much better I may write the GPU shader code to do it.
One thing you could try is to use the ChimeraX volume rendering option colormapOnGpu
volume #1 colormapOnGpu true
This interpolates the volume values for each screen pixel in the rendering and then maps them to color brightness while the default (colormapOnGpu false) interpolates the colors for each grid point of the data. In my test on tomogram EMDB 1273 it made little difference. This option is used primarily for DICOM medical imaging where very large jumps in intensity occur from voxel to voxel for seeing fine features like airways in lungs.
Tom
On Mar 12, 2025, at 6:37 AM, Ricardo Righetto via ChimeraX-users <chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu>> wrote:
Dear ChimeraX team,
(I have a vague memory of discussing this before, apologies if duplicate!)
When displaying volumes as images (e.g. cryo-ET volume slices), I see that by default it uses linear interpolation: https://www.rbvi.ucsf.edu/chimerax/docs/user/commands/volume.html#style
Would it be possible to offer higher-order interpolation options such as cubic?
I love how customizable it is to make figures in ChimeraX, but this is the one feature that we really miss compared e.g. to 3dmod from IMOD.
Thank you!
-- Ricardo Diogo Righetto _______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu> To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu <mailto:chimerax-users-leave@cgl.ucsf.edu> Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu> To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu <mailto:chimerax-users-leave@cgl.ucsf.edu> Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu> To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu <mailto:chimerax-users-leave@cgl.ucsf.edu> Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
participants (2)
-
Ricardo Righetto
-
Tom Goddard