Python Function that implements the "center" method from the GUI

Hello, For an automatic pipeline workflow, I want to have a way to center several mrc files using the Python module. However, I can't seem to find the corresponding Python function that I can use in a script to "center" an opened map. Is there a Python function to "center" a map similarily as in the GUI? Kind regards, Tong

Hi Tong, I'm not sure what you mean by "centering an mrc file". If you mean the ChimeraX "view" command, that just moves the ChimeraX camera so the model is shown, and that would not make any difference in an automated pipeline unless your pipeline saves images. Maybe you mean changing the origin of the volume, e.g. "volume #1 originIndex 50,50,50" so that it aligns with some other models. At any rate the Python functions that do these commands are listed in the ChimeraX Programming guide: https://www.cgl.ucsf.edu/chimerax/docs/devel/modules/core/commands/user_comm... If you mean the Center button on the Map Coordinates panel which sets the origin index to the center of the map grid, here are the lines of Python code that do that https://github.com/RBVI/ChimeraX/blob/1197e6f20f584e42c07ac44a7e787c9a237561... Tom
On Dec 1, 2023, at 9:05 AM, tong.you--- via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hello,
For an automatic pipeline workflow, I want to have a way to center several mrc files using the Python module. However, I can't seem to find the corresponding Python function that I can use in a script to "center" an opened map.
Is there a Python function to "center" a map similarily as in the GUI?
Kind regards,
Tong _______________________________________________ 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)
-
Tom Goddard
-
tong.you@icm.uu.se