Re: [chimera-dev] Retrieving model_id / model_name via API
Oops. Should be
v.new_region(ijk_step = (1,1,1), adjust_step = False)
Chimera automatically adjust the step size to stay within a maximum total number of voxels. The adjust_step = False means not to do that automatic changing of the specified step.
Tom
On Mar 7, 2019, at 2:57 PM, Lars Hangartner lhangart@scripps.edu wrote:
Hi Tom.
Thanks for the reply. Unfortunately, this did not work. My implementation was as follows and did not change anything. Best, Lars
for vol in openModels.list(modelTypes=[Volume]): vol.new_region(ijk_step = (1,1,1))
On Mar 7, 2019, at 1:07 PM, Tom Goddard <goddard@sonic.net mailto:goddard@sonic.net> wrote:
To set the step of a Volume model v in Chimera in Python code
v.new_region(ijk_step = (1,1,1))
Tom
On Mar 6, 2019, at 8:42 PM, Lars Hangartner <lhangart@scripps.edu mailto:lhangart@scripps.edu> wrote:
Hi Eric,
Thanks for the swift response, worked like a charm. May I also ask how to set the ’step’ property value from the volume viewer GUI pop-up from a script?
Thanks,
Lars
On Mar 6, 2019, at 3:40 PM, Eric Pettersen <pett@cgl.ucsf.edu mailto:pett@cgl.ucsf.edu> wrote:
Hi Lars, The model attributes for the ID are ‘id’/‘subid’ for the parts before and after any ‘.’ respectively, and the ‘name’ attribute has the model name. You would loop through all volume models with something like:
from chimera import openModels from VolumeViewer import Volume for vol in openModels.list(modelTypes=[Volume]): print “%d.%d %s” % (vol.id http://vol.id/, vol.subid, vol.name)
We realize the programmer documentation isn’t great. What little we have you can find here: https://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/index.html https://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/index.html . One of our objectives for ChimeraX is much better programmer documentation.
—Eric
Eric Pettersen UCSF Computer Graphics Lab
On Mar 6, 2019, at 10:40 AM, Lars Hangartner <lhangart@scripps.edu mailto:lhangart@scripps.edu> wrote:
Hi guys,
I am desperately looking to get the model_id / model name from all open volume objects. I have tried openModel.list()[0].model_id in many iterations but no success… I would like to iterate through models and identify the resampled ones.
Can anybody help?
Thanks,
Lars
P.S: API documentation would really be helpful.
Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu mailto:Chimera-dev@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev
Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu mailto:Chimera-dev@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev
Yup, that took care of it, it works now.
Thanks Tom!
Lars
On Mar 7, 2019, at 3:12 PM, Tom Goddard <goddard@sonic.netmailto:goddard@sonic.net> wrote:
Oops. Should be
v.new_region(ijk_step = (1,1,1), adjust_step = False)
Chimera automatically adjust the step size to stay within a maximum total number of voxels. The adjust_step = False means not to do that automatic changing of the specified step.
Tom
On Mar 7, 2019, at 2:57 PM, Lars Hangartner <lhangart@scripps.edumailto:lhangart@scripps.edu> wrote:
Hi Tom.
Thanks for the reply. Unfortunately, this did not work. My implementation was as follows and did not change anything. Best, Lars
for vol in openModels.list(modelTypes=[Volume]): vol.new_region(ijk_step = (1,1,1))
On Mar 7, 2019, at 1:07 PM, Tom Goddard <goddard@sonic.netmailto:goddard@sonic.net> wrote:
To set the step of a Volume model v in Chimera in Python code
v.new_region(ijk_step = (1,1,1))
Tom
On Mar 6, 2019, at 8:42 PM, Lars Hangartner <lhangart@scripps.edumailto:lhangart@scripps.edu> wrote:
Hi Eric,
Thanks for the swift response, worked like a charm. May I also ask how to set the ’step’ property value from the volume viewer GUI pop-up from a script?
Thanks,
Lars
On Mar 6, 2019, at 3:40 PM, Eric Pettersen <pett@cgl.ucsf.edumailto:pett@cgl.ucsf.edu> wrote:
Hi Lars, The model attributes for the ID are ‘id’/‘subid’ for the parts before and after any ‘.’ respectively, and the ‘name’ attribute has the model name. You would loop through all volume models with something like:
from chimera import openModels from VolumeViewer import Volume for vol in openModels.list(modelTypes=[Volume]): print “%d.%d %s” % (vol.idhttp://vol.id/, vol.subid, vol.name)
We realize the programmer documentation isn’t great. What little we have you can find here: https://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/index.html . One of our objectives for ChimeraX is much better programmer documentation.
—Eric
Eric Pettersen UCSF Computer Graphics Lab
On Mar 6, 2019, at 10:40 AM, Lars Hangartner <lhangart@scripps.edumailto:lhangart@scripps.edu> wrote:
Hi guys,
I am desperately looking to get the model_id / model name from all open volume objects. I have tried openModel.list()[0].model_id in many iterations but no success… I would like to iterate through models and identify the resampled ones.
Can anybody help?
Thanks,
Lars
P.S: API documentation would really be helpful.
_______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edumailto:Chimera-dev@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev
_______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edumailto:Chimera-dev@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev
participants (2)
-
Lars Hangartner
-
Tom Goddard