[new-map-options] Error when using the "subregion" option

Dear ChimeraX developers, When using the "subregion" option for different map-related functions (volume morph, volume copy) I encountered the following error : *ValueError: could not broadcast input array from shape (150,150,150) into shape (151,151,151)File "C:\Program Files\ChimeraX 1.1\bin\lib\site-packages\chimerax\map\volume.py", line 982, in writable_copy*g.array*[:,:,:] = self.region_matrix(r) *If you want to reproduce the error, I worked on EMDB22000 and I typed in the console : *volume copy #1 subregion 150,150,150,300,300,300 *alternatively *volume morph #1 #2 subregion 150,150,150,300,300,300 * raises the same error. I tried on two versions of ChimeraX (including the last stable from September) and got the same error twice. Would you have any idea how to solve this? Thanks very much, Best, Arthur

Hi Arthur, That is a bug and I will fix it, probably today. It is easy to avoid. The map EMDB 22000 has grid size 300. But ChimeraX (and Chimera) uses grid indices that start at 0, so the index range along each axis is 0-299, so the copy command volume copy #1 subregion 150,150,150,300,300,300 is asking to include grid index 300 which is one beyond the edge of the map. Still it should clamp it to 299. But if you use the command volume copy #1 subregion 150,150,150,299,299,299 it works correctly and gives a grid size 150 map as expected. Tom
On Nov 13, 2020, at 10:14 AM, Arthur Ecoffet <arthurecoffet@gmail.com> wrote:
Dear ChimeraX developers,
When using the "subregion" option for different map-related functions (volume morph, volume copy) I encountered the following error : ValueError: could not broadcast input array from shape (150,150,150) into shape (151,151,151)
File "C:\Program Files\ChimeraX 1.1\bin\lib\site-packages\chimerax\map\volume.py", line 982, in writable_copy g.array[:,:,:] = self.region_matrix(r)
If you want to reproduce the error, I worked on EMDB22000 and I typed in the console : volume copy #1 subregion 150,150,150,300,300,300 alternatively volume morph #1 #2 subregion 150,150,150,300,300,300 raises the same error.
I tried on two versions of ChimeraX (including the last stable from September) and got the same error twice. Would you have any idea how to solve this?
Thanks very much, Best, Arthur _______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users

Hi Arthur, I fixed the bug, will be in tonight's ChimeraX builds. The daily builds section is below the production releases on the ChimeraX download page: https://www.rbvi.ucsf.edu/chimerax/download.html#daily I interpreted command volume copy #1 subregion 150,150,150,300,300,300 which includes one grid point beyond the edge of the map of size 300 (indices from 0 to 299) as cropping to the part actually in the map. An alternative would be to add zeros where you request a region outside the map bounds, but I think that is rarely desired so I did not do that. Tom
On Nov 13, 2020, at 10:48 AM, Tom Goddard <goddard@sonic.net> wrote:
Hi Arthur,
That is a bug and I will fix it, probably today.
It is easy to avoid. The map EMDB 22000 has grid size 300. But ChimeraX (and Chimera) uses grid indices that start at 0, so the index range along each axis is 0-299, so the copy command
volume copy #1 subregion 150,150,150,300,300,300
is asking to include grid index 300 which is one beyond the edge of the map. Still it should clamp it to 299. But if you use the command
volume copy #1 subregion 150,150,150,299,299,299
it works correctly and gives a grid size 150 map as expected.
Tom
On Nov 13, 2020, at 10:14 AM, Arthur Ecoffet <arthurecoffet@gmail.com <mailto:arthurecoffet@gmail.com>> wrote:
Dear ChimeraX developers,
When using the "subregion" option for different map-related functions (volume morph, volume copy) I encountered the following error : ValueError: could not broadcast input array from shape (150,150,150) into shape (151,151,151)
File "C:\Program Files\ChimeraX 1.1\bin\lib\site-packages\chimerax\map\volume.py", line 982, in writable_copy g.array[:,:,:] = self.region_matrix(r)
If you want to reproduce the error, I worked on EMDB22000 and I typed in the console : volume copy #1 subregion 150,150,150,300,300,300 alternatively volume morph #1 #2 subregion 150,150,150,300,300,300 raises the same error.
I tried on two versions of ChimeraX (including the last stable from September) and got the same error twice. Would you have any idea how to solve this?
Thanks very much, Best, Arthur _______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu <mailto:ChimeraX-users@cgl.ucsf.edu> Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users
_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users
participants (2)
-
Arthur Ecoffet
-
Tom Goddard