[Chimera-users] Saving images of all scenes in session?

Oliver Clarke olibclarke at gmail.com
Mon Sep 28 07:30:14 PDT 2015


OK, sort of figured out the second part of this - here is a basic extension that will iterate over each scene and take an image at each with the defined parameters - I still think it would be very handy if something similar were to be incorporated into the image saving part of the GUI though:

from Midas.midas_text import addCommand
def cmd_scenesnap(scenesnap,args):
  from Midas.midas_text import doExtensionFunc
  def scenesnap(rootname):
    from chimera import runCommand
    from Animate import Scenes
    scene_list=Scenes.scenes.dispnames()
    mkdir_cmd="cd ~; system mkdir chimera_tmp; cd chimera_tmp; system mkdir {0}; cd {0}".format(rootname)
    runCommand(mkdir_cmd)
    for scene in scene_list:
      runCommand("scene {} reset".format(scene))
      img_name=str(rootname)+"_"+str(scene)
      runCommand("copy file {} png width 2000 supersample 4".format(img_name))
  doExtensionFunc(scenesnap,args)
addCommand("scenesnap", cmd_scenesnap, help=False)


> On Sep 27, 2015, at 11:01 AM, Oliver Clarke <olibclarke at gmail.com> wrote:
> 
> Hi all,
> 
> Apologies for yet another post and thank you for your patience! :-)
> 
> Feature suggestion (or maybe this exists already?): I would like a way to iterate over all scenes in a session and save an image at each scene, with the same display settings (e.g keep background or make transparent, image format, wall-eye/cross-eye stereo, etc).
> 
> This would be really very helpful when making, remaking and updating figures. Most of the time, I will have a session, say “Fig1.py”, within which I will have a bunch of scenes corresponding to each panel. It would be really advantageous to be able to take images of each scene all at once, saving each as (for example) Fig1_scene_name.jpg, Fig1_scene_name2.jpg etc. This could work in the same way as saving series of maps or models does now - just have a checkbox in the Save Image dialog for “save images for all scenes in session”, or something similar.
> 
> It can take quite a while to save each image when on a slow computer, or when using graphics intensive settings such as silhouettes and shadows, so being able to save matched sets of images (e.g. low and hi-res versions, stereo versions, etc) with a couple of clicks would save a lot of time, particularly for example if you realize that the versions you saved the first time were all too low res and you want to go back and save a higher res version of every panel.
> 
> I realize you guys might not have time to implement this for Chimera 1, as development of Chimera 2 is top priority, so maybe I can write a script to do this in the meantime? Is there any way to return a list of scene names using one of the built in python functions? I guess something in Animate.Scenes ought to do this, but not being much of a python programmer I can’t quite figure it out - any tips much appreciated.
> 
> Cheers,
> Oli.





More information about the Chimera-users mailing list