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."
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:
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!
_______________________________________________
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/