Hi Hernando,
This isn't my area of expertise, but did you really need a rectangular region of the map?
I was thinking that if you are basing this on some atom or set of atoms, it may be easier to use "vop zone" to get all parts of the map within some distance cutoff of those atom(s).
<https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/vop.html#zone>
Or if a cubic region centered on a specific atom or marker would be OK, see "vop boxes"
<https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/vop.html#boxes>
If you must use the rectangular "region" my guess is that it should be your first equation, but it may not come out exactly because the map is gridded rather than continuous. Also note that the Volume Viewer dialog does not report the coordinates of the origin. Instead it reports the grid indices of the XYZ origin (0,0,0 coordinate). So you have to do more math to figure out the actual coordinates of the grid origin.
If you are considering switching to ChimeraX, note that ChimeraX also has the same "vop" capabilities as mentioned above for Chimera, except as the ChimeraX commands "volume zone" and "volume boxes":
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/volume.html#vop>
... and ChimeraX will actually tell you the coordinates of the grid origin as well as the map indices of the XYZ origin (0,0,0), if you use ChimeraX command "volume settings"
I hope this helps,
Elaine
-----
Elaine C. Meng, Ph.D.
UCSF Chimera(X) team
Resource for Biocomputing, Visualization, and Informatics
Department of Pharmaceutical Chemistry
University of California, San Francisco
On Jan 2, 2024, at 1:47 PM, Hernando J Sosa via Chimera-users <chimera-users@cgl.ucsf.edu> wrote:
Dear Chimera,
I want to extract a submap around some parts of an atomic model that is aligned to the main map. For this I am using the volume region command, but I am running into a problem converting the atomic coordinates to voxel coordinates when the pixel size of the map is different from 1 and the map origin is not at 0,0,0.
What would be the right formula to go from one set the coordinates to the other and be able to get a submap in the right place?
i.e.
If a sub-volume were to be extracted at coordinates x1,y1,z1 and x2,y2,z2 of the atomic model
what would be the volume coordinates to use in the command
volume #mainmap region VX1, VY1, VZ1, VX2, VY2, VZ2 assuming the map voxel size is Mapvsize and the map orig Orig is at cx,cy,cz.
To go from one set of coordinates to the other I have tried:
MapCoord = (ModelCoord - Orig) / Mapvsize
and
MapCoord = (ModelCoord /Mapvsize) - Orig
None seems to extract the volume at the right place. The first one seems closer (??)
Thanks
Hernando
_______________________________________________
Chimera-users mailing list -- chimera-users@cgl.ucsf.edu
To unsubscribe send an email to chimera-users-leave@cgl.ucsf.edu
Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimera-users@cgl.ucsf.edu/