Eachmodel option for volume?

Hi, Fitmap has a handy "eachmodel true" option, which allows one to fit a bunch of maps or models to a single target map. It would be useful I think to have a similar option in the "volume" command, to allow one to quickly multiply a bunch of maps (e.g. from 3D classification) by a single mask. Cheers Oli

Hi Oliver, Maybe better than adding "eachmodel" options to lots of commands in order to allow applying to several models you can use the following trick. The perframe command allows running another command substituting in a different number on each run. For example to multiply ten maps #3, #4, ..., #12 by a mask #2 use perframe "volume multiply #$1 #2" range 3,12 The $1 will be replaced by 3, then 4, ..., then12. So perframe can be used like a "for" loop in a programming language. It's intended use was for movie recording where it runs a command for each rendered frame. In that use you don't use the range option but instead you say how many frames to run the command for, for example, perframe "move x 1.5 model #5" frames 30 The perframe looping trick doesn't work well if your model numbers are not a contiguous range. But I think in typical multi-model actions they are a contiguous range. Documentation for perframe https://www.rbvi.ucsf.edu/chimerax/docs/user/commands/perframe.html Tom
On Jun 10, 2025, at 9:44 AM, Oliver Clarke via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi,
Fitmap has a handy "eachmodel true" option, which allows one to fit a bunch of maps or models to a single target map.
It would be useful I think to have a similar option in the "volume" command, to allow one to quickly multiply a bunch of maps (e.g. from 3D classification) by a single mask.
Cheers Oli _______________________________________________ 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/

Ah! Yes, that makes sense, I didn't think about perframe, that's a great idea! Cheers Oli
On Jun 10, 2025, at 3:01 PM, Tom Goddard <goddard@sonic.net> wrote:
Hi Oliver,
Maybe better than adding "eachmodel" options to lots of commands in order to allow applying to several models you can use the following trick. The perframe command allows running another command substituting in a different number on each run. For example to multiply ten maps #3, #4, ..., #12 by a mask #2 use
perframe "volume multiply #$1 #2" range 3,12
The $1 will be replaced by 3, then 4, ..., then12. So perframe can be used like a "for" loop in a programming language. It's intended use was for movie recording where it runs a command for each rendered frame. In that use you don't use the range option but instead you say how many frames to run the command for, for example,
perframe "move x 1.5 model #5" frames 30
The perframe looping trick doesn't work well if your model numbers are not a contiguous range. But I think in typical multi-model actions they are a contiguous range.
Documentation for perframe
https://www.rbvi.ucsf.edu/chimerax/docs/user/commands/perframe.html
Tom
On Jun 10, 2025, at 9:44 AM, Oliver Clarke via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi,
Fitmap has a handy "eachmodel true" option, which allows one to fit a bunch of maps or models to a single target map.
It would be useful I think to have a similar option in the "volume" command, to allow one to quickly multiply a bunch of maps (e.g. from 3D classification) by a single mask.
Cheers Oli _______________________________________________ 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)
-
Oliver Clarke
-
Tom Goddard