
Hi, I am starting to build a matrix of USB HID devices using controllermate on a mac. I am planning to use two 3dconnexion devices. one to handle 6D translation/rotation, and the other to manage color/lighting; or maybe left hand for trans and right for rotation, etc. . The current driver in chimera only sees one device. If I touch the first USB 3dconnexion device plugged in, it behaves as expected. Touching the second device, chimera acts as though it is the first device. So the driver is not keeping track of the number of devices. In controllermate I can see both devices and can program them independently. For example, I will be able to remap these signals to my choosing and pass it on to a chimera extension I am developing. The second problem I am having is when chimera starts up it exclusively grabs the low level driver, ignoring the the high level driver which incorporates context management. Consequently controllermate is unable to intercept and modify the signal before passing it on. A good reason to do this would be creating deadband zones, or a user defined response curve, or integration with multibutton panel like the logitech g13 so that I can modulate the response (eg, 0.1x,1x,10x,100x, etc). How do I disable 3dConnexion so that it will not load in chimera? I could wipe out the code, but would prefer minimally screwing with chimera base code which is a headache for daily builds and has a risk factor of unforeseen consequences. Something in preferences would be helpful. In a related question on preferences, the scroll wheel is tied to camera zoom. I would like to remap that as a movement in z. Generally I like to keep my scale factor at 1; I find heavy or casual use tends to get me into camera problems. Is this possible? at the moment I disable the scroll wheel. Matthew Dougherty National Center for Macromolecular Imaging Baylor College of Medicine

Hi Matt, Chimera use of 3dconnexion devices like Space Navigator was a pain to implement because 3dconnexion has different APIs on Windows, Mac and Linux -- so we have 3 different ways of interfacing to the device for those 3 operating systems. None of them have been very well implemented. On Mac OS Chimera gets the space navigator events via a C++ library we wrote. It is Chimera.app/Contents/Resources/lib/_spacenavigator.so Remove or rename that (e.g. to _spacenavigator.so.keep) and Chimera will not get an space navigator events. I recently tried two space navigators on the Mac by modifying _spacenavigator.so. I used one to dock a ligand while the other changed the view point. I didn't check in that code though. But it was not difficult to get the separate events from two devices. I haven't decided whether to check in that code. It requires some clean-up that I don't have time for right now. The Mac Chimera interface gets the space nav events even when Chimera does not have the input focus. I think this is probably what you mean by it is using the low level driver. I spent many hours trying to get it to receive only events when Chimera had the input focus, there is an argument to a 3dconnexion initialization routine that is supposed to do this, but nothing worked. I found no working example on the web either. Look at the Chimera _spacenavigator.so code in the spacenav_connect() routine if you want to see where the problem is. http://plato.cgl.ucsf.edu/trac/chimera/browser/trunk/libs/_spacenavigator/sp... My experience has been that the 3dconnexion drivers are very poor compared to the hardware quality. Chimera has the scroll wheel hard-coded to zoom. That is bad. I made a Chimera request to fix this 4 months ago when you asked http://plato.cgl.ucsf.edu/trac/chimera/ticket/11512 Has not received any attention. Tom -------- Original Message -------- Subject: [chimera-dev] 3dconnexion From: Dougherty, Matthew T To: chimera-dev@cgl.ucsf.edu Date: 3/7/13 3:18 PM
Hi,
I am starting to build a matrix of USB HID devices using controllermate on a mac.
I am planning to use two 3dconnexion devices. one to handle 6D translation/rotation, and the other to manage color/lighting; or maybe left hand for trans and right for rotation, etc. . The current driver in chimera only sees one device. If I touch the first USB 3dconnexion device plugged in, it behaves as expected. Touching the second device, chimera acts as though it is the first device. So the driver is not keeping track of the number of devices.
In controllermate I can see both devices and can program them independently.
For example, I will be able to remap these signals to my choosing and pass it on to a chimera extension I am developing.
The second problem I am having is when chimera starts up it exclusively grabs the low level driver, ignoring the the high level driver which incorporates context management. Consequently controllermate is unable to intercept and modify the signal before passing it on. A good reason to do this would be creating deadband zones, or a user defined response curve, or integration with multibutton panel like the logitech g13 so that I can modulate the response (eg, 0.1x,1x,10x,100x, etc).
How do I disable 3dConnexion so that it will not load in chimera? I could wipe out the code, but would prefer minimally screwing with chimera base code which is a headache for daily builds and has a risk factor of unforeseen consequences. Something in preferences would be helpful.
In a related question on preferences, the scroll wheel is tied to camera zoom. I would like to remap that as a movement in z. Generally I like to keep my scale factor at 1; I find heavy or casual use tends to get me into camera problems. Is this possible? at the moment I disable the scroll wheel.
Matthew Dougherty National Center for Macromolecular Imaging Baylor College of Medicine _______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev

I had to get into the code and knock the rotation values down by dividing by 15. no one in the lab uses 3dconnexion, excited at first, disappointed in the end. It is like a bomb when you touch it; effectively useless and creates problems. for the mac I would recommend ditching it, tell the users to go with controllermate. It is the way to go on the mac, no reservations on that recommendation. I can do two simultaneously, manage the focus, and create a usable response function. Plus I can easily program in 5 shuttle expresses, logitech g13, logitech extreme pro, and an xkey 3 button foot pedal. All can be interconnected as functional multipliers, so I am building fail safe combos to prevent accidental button pushes that erase my positions, etc. Today I did a 2 hour dome/USB demo with Jane Richardson. She sees how it will make a difference in her package. I can even use it to finesse different s/w packages to behave at the same time. For example, matching chimera stereo output, to frame pack on HDMI using a third party system utility. Making stereo operate automatically is a priority. Chimera.app/Contents/Resources/lib/_spacenavigator.so I was trying to avoid that, I would rather not muck with the code that way. I guess I could write a keyboard shortcut to cull it reliably, or a startup script to look for it and erase it. http://plato.cgl.ucsf.edu/trac/chimera/ticket/11512 completely forgot about that. if it is going to be a major problem, close it. again I will nail it with controllermate using a contour shuttle express to do the z moves, and 3d connexion to do the xy translations. A lot of this translation/rotation stuff is like mountain climbing, one misstep and you are upside down falling into a pit of WTF. the 6D stuff is nice, but for most humans it is going to be a long learning curve, until at least you can properly set the response curve to match one's habits. Which puts its success squarely on getting the human interface correct, either by self investigation, training or examples. Two related questions: 1) At this point, all my displays are moving to 1080p, so I have fixed reproducible real estate that I can account for. How would I call up the "camera side view" and place the top corner at pixel 500,700? Then close it when I am done using python? 2) I have started going head on to master solid rendering. I have been trying to avoid it for 20 years, because of its complexity. Isosurface, one variable, get the researcher to confess the number. It is complex because of 1) the methods, and 2) the void on how to manage the control space; I can see situations where 100-1000 variables are needed to get the data to be stunningly visual. Any thoughts on that? Compared to the Amira's volume render gui, Chimera is pretty limited; but I am thinking through commands and python it may have more possibilities making it more formidable. Are the docs comprehensive, or will I need to get into the source to access more features? Are there any volume rendering chimera power users? extensions? Matthew Dougherty National Center for Macromolecular Imaging Baylor College of Medicine ________________________________________ From: Tom Goddard [goddard@sonic.net] Sent: Thursday, March 07, 2013 6:07 PM To: Dougherty, Matthew T Cc: chimera-dev@cgl.ucsf.edu Subject: Re: [chimera-dev] 3dconnexion Hi Matt, Chimera use of 3dconnexion devices like Space Navigator was a pain to implement because 3dconnexion has different APIs on Windows, Mac and Linux -- so we have 3 different ways of interfacing to the device for those 3 operating systems. None of them have been very well implemented. On Mac OS Chimera gets the space navigator events via a C++ library we wrote. It is Chimera.app/Contents/Resources/lib/_spacenavigator.so Remove or rename that (e.g. to _spacenavigator.so.keep) and Chimera will not get an space navigator events. I recently tried two space navigators on the Mac by modifying _spacenavigator.so. I used one to dock a ligand while the other changed the view point. I didn't check in that code though. But it was not difficult to get the separate events from two devices. I haven't decided whether to check in that code. It requires some clean-up that I don't have time for right now. The Mac Chimera interface gets the space nav events even when Chimera does not have the input focus. I think this is probably what you mean by it is using the low level driver. I spent many hours trying to get it to receive only events when Chimera had the input focus, there is an argument to a 3dconnexion initialization routine that is supposed to do this, but nothing worked. I found no working example on the web either. Look at the Chimera _spacenavigator.so code in the spacenav_connect() routine if you want to see where the problem is. http://plato.cgl.ucsf.edu/trac/chimera/browser/trunk/libs/_spacenavigator/sp... My experience has been that the 3dconnexion drivers are very poor compared to the hardware quality. Chimera has the scroll wheel hard-coded to zoom. That is bad. I made a Chimera request to fix this 4 months ago when you asked http://plato.cgl.ucsf.edu/trac/chimera/ticket/11512 Has not received any attention. Tom -------- Original Message -------- Subject: [chimera-dev] 3dconnexion From: Dougherty, Matthew T To: chimera-dev@cgl.ucsf.edu Date: 3/7/13 3:18 PM
Hi,
I am starting to build a matrix of USB HID devices using controllermate on a mac.
I am planning to use two 3dconnexion devices. one to handle 6D translation/rotation, and the other to manage color/lighting; or maybe left hand for trans and right for rotation, etc. . The current driver in chimera only sees one device. If I touch the first USB 3dconnexion device plugged in, it behaves as expected. Touching the second device, chimera acts as though it is the first device. So the driver is not keeping track of the number of devices.
In controllermate I can see both devices and can program them independently.
For example, I will be able to remap these signals to my choosing and pass it on to a chimera extension I am developing.
The second problem I am having is when chimera starts up it exclusively grabs the low level driver, ignoring the the high level driver which incorporates context management. Consequently controllermate is unable to intercept and modify the signal before passing it on. A good reason to do this would be creating deadband zones, or a user defined response curve, or integration with multibutton panel like the logitech g13 so that I can modulate the response (eg, 0.1x,1x,10x,100x, etc).
How do I disable 3dConnexion so that it will not load in chimera? I could wipe out the code, but would prefer minimally screwing with chimera base code which is a headache for daily builds and has a risk factor of unforeseen consequences. Something in preferences would be helpful.
In a related question on preferences, the scroll wheel is tied to camera zoom. I would like to remap that as a movement in z. Generally I like to keep my scale factor at 1; I find heavy or casual use tends to get me into camera problems. Is this possible? at the moment I disable the scroll wheel.
Matthew Dougherty National Center for Macromolecular Imaging Baylor College of Medicine _______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev

Hi Matt, Here is Python to get the side view dialog, display it, query its size and position on the screen in pixels, reposition it, and close it. from chimera import dialogs, viewing d = dialogs.find(viewing.ViewerDialog.name, create = 1) # Get the side view dialog d.enter() # Display the dialog d.uiMaster().winfo_toplevel().wm_geometry() # Get the current size and position '400x341+1186+696' d.uiMaster().winfo_toplevel().wm_geometry('+500+700') # set the position to 500,700 d.Close() # Close window For volumetric rendering you could look at the solid rendering option in the Chimera docs to get warmed up http://www.cgl.ucsf.edu/chimera/docs/ContributedSoftware/volumeviewer/volume... Chimera doesn't do lighting with volumetric rendering and I think it is somewhat important. That said, my feeling is that 98% of the time volumetric rendering is only used for 1 or a couple planes -- basically a graylevel slice view. The typical viewer can make little sense out of an image with 3 nested transparent surfaces. Volumetric rendering of 200 slices is like 200 transparent layers. This has very little value in my experience. The human eye and human depth perception is simply not good enough to make sense of this. It is like looking at a room filled with smoke. For looking at a few planes, take a look at the new orthoplanes and box display modes in Chimera 1.7 http://www.cgl.ucsf.edu/chimera/docs/ContributedSoftware/volumeviewer/volume... If you really are set on high quality volumetric rendering you should find other software to do it. But first I'd try to find an image where you think it really is better than the alternatives. That isn't easy to find. Regarding your comments about alternative input devices, I also have a strong opinion on that subject! 99% of everyone uses only a keyboard and mouse or trackpad. Why? Because you only have two hands. Once you get 3 devices its a royal pain. You need to click on menus, type text, and do some magic with some alternative device(s)? Then the devices play musical chairs in your hands -- very unsatisfactory. Specialists, like you with your animation work, can use the extra devices, but you are the 1%. For everyone else these devices are just a neat gimmick, that quickly ends up behind the computer display never being used. Tom On Mar 7, 2013, at 7:12 PM, "Dougherty, Matthew T" <matthewd@bcm.edu> wrote:
I had to get into the code and knock the rotation values down by dividing by 15. no one in the lab uses 3dconnexion, excited at first, disappointed in the end. It is like a bomb when you touch it; effectively useless and creates problems.
for the mac I would recommend ditching it, tell the users to go with controllermate. It is the way to go on the mac, no reservations on that recommendation. I can do two simultaneously, manage the focus, and create a usable response function. Plus I can easily program in 5 shuttle expresses, logitech g13, logitech extreme pro, and an xkey 3 button foot pedal. All can be interconnected as functional multipliers, so I am building fail safe combos to prevent accidental button pushes that erase my positions, etc.
Today I did a 2 hour dome/USB demo with Jane Richardson. She sees how it will make a difference in her package. I can even use it to finesse different s/w packages to behave at the same time. For example, matching chimera stereo output, to frame pack on HDMI using a third party system utility. Making stereo operate automatically is a priority.
Chimera.app/Contents/Resources/lib/_spacenavigator.so I was trying to avoid that, I would rather not muck with the code that way. I guess I could write a keyboard shortcut to cull it reliably, or a startup script to look for it and erase it.
http://plato.cgl.ucsf.edu/trac/chimera/ticket/11512 completely forgot about that. if it is going to be a major problem, close it. again I will nail it with controllermate using a contour shuttle express to do the z moves, and 3d connexion to do the xy translations. A lot of this translation/rotation stuff is like mountain climbing, one misstep and you are upside down falling into a pit of WTF. the 6D stuff is nice, but for most humans it is going to be a long learning curve, until at least you can properly set the response curve to match one's habits. Which puts its success squarely on getting the human interface correct, either by self investigation, training or examples.
Two related questions: 1) At this point, all my displays are moving to 1080p, so I have fixed reproducible real estate that I can account for. How would I call up the "camera side view" and place the top corner at pixel 500,700? Then close it when I am done using python?
2) I have started going head on to master solid rendering. I have been trying to avoid it for 20 years, because of its complexity. Isosurface, one variable, get the researcher to confess the number. It is complex because of 1) the methods, and 2) the void on how to manage the control space; I can see situations where 100-1000 variables are needed to get the data to be stunningly visual. Any thoughts on that? Compared to the Amira's volume render gui, Chimera is pretty limited; but I am thinking through commands and python it may have more possibilities making it more formidable. Are the docs comprehensive, or will I need to get into the source to access more features?
Are there any volume rendering chimera power users? extensions?
Matthew Dougherty National Center for Macromolecular Imaging Baylor College of Medicine ________________________________________ From: Tom Goddard [goddard@sonic.net] Sent: Thursday, March 07, 2013 6:07 PM To: Dougherty, Matthew T Cc: chimera-dev@cgl.ucsf.edu Subject: Re: [chimera-dev] 3dconnexion
Hi Matt,
Chimera use of 3dconnexion devices like Space Navigator was a pain to implement because 3dconnexion has different APIs on Windows, Mac and Linux -- so we have 3 different ways of interfacing to the device for those 3 operating systems. None of them have been very well implemented.
On Mac OS Chimera gets the space navigator events via a C++ library we wrote. It is
Chimera.app/Contents/Resources/lib/_spacenavigator.so
Remove or rename that (e.g. to _spacenavigator.so.keep) and Chimera will not get an space navigator events.
I recently tried two space navigators on the Mac by modifying _spacenavigator.so. I used one to dock a ligand while the other changed the view point. I didn't check in that code though. But it was not difficult to get the separate events from two devices. I haven't decided whether to check in that code. It requires some clean-up that I don't have time for right now.
The Mac Chimera interface gets the space nav events even when Chimera does not have the input focus. I think this is probably what you mean by it is using the low level driver. I spent many hours trying to get it to receive only events when Chimera had the input focus, there is an argument to a 3dconnexion initialization routine that is supposed to do this, but nothing worked. I found no working example on the web either. Look at the Chimera _spacenavigator.so code in the spacenav_connect() routine if you want to see where the problem is.
http://plato.cgl.ucsf.edu/trac/chimera/browser/trunk/libs/_spacenavigator/sp...
My experience has been that the 3dconnexion drivers are very poor compared to the hardware quality.
Chimera has the scroll wheel hard-coded to zoom. That is bad. I made a Chimera request to fix this 4 months ago when you asked
http://plato.cgl.ucsf.edu/trac/chimera/ticket/11512
Has not received any attention.
Tom
-------- Original Message -------- Subject: [chimera-dev] 3dconnexion From: Dougherty, Matthew T To: chimera-dev@cgl.ucsf.edu Date: 3/7/13 3:18 PM
Hi,
I am starting to build a matrix of USB HID devices using controllermate on a mac.
I am planning to use two 3dconnexion devices. one to handle 6D translation/rotation, and the other to manage color/lighting; or maybe left hand for trans and right for rotation, etc. . The current driver in chimera only sees one device. If I touch the first USB 3dconnexion device plugged in, it behaves as expected. Touching the second device, chimera acts as though it is the first device. So the driver is not keeping track of the number of devices.
In controllermate I can see both devices and can program them independently.
For example, I will be able to remap these signals to my choosing and pass it on to a chimera extension I am developing.
The second problem I am having is when chimera starts up it exclusively grabs the low level driver, ignoring the the high level driver which incorporates context management. Consequently controllermate is unable to intercept and modify the signal before passing it on. A good reason to do this would be creating deadband zones, or a user defined response curve, or integration with multibutton panel like the logitech g13 so that I can modulate the response (eg, 0.1x,1x,10x,100x, etc).
How do I disable 3dConnexion so that it will not load in chimera? I could wipe out the code, but would prefer minimally screwing with chimera base code which is a headache for daily builds and has a risk factor of unforeseen consequences. Something in preferences would be helpful.
In a related question on preferences, the scroll wheel is tied to camera zoom. I would like to remap that as a movement in z. Generally I like to keep my scale factor at 1; I find heavy or casual use tends to get me into camera problems. Is this possible? at the moment I disable the scroll wheel.
Matthew Dougherty National Center for Macromolecular Imaging Baylor College of Medicine _______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev

Hi Tom, the USB-HID development is going well. I implemented the code below, make it operate where I needed it, put the cursor onto the panel ready to go, using a single button push; then use another button to close it and move back to the display, click on it to make it active, so to be ready for more button pushes. This combined with other codes I can now easily manage hundreds of savepos, or tweak z & focal parameters, then triage them later. Now I want to do something similar for a variety of dialogs, I particularly want to move the main display, Reply Log, Volume Viewer, Model Panel, & Keyboard Shortcuts. How can I systemically figure these out without bugging you on these small details? Couple of other related questions & observations: 1) On the example below: the ViewerDialog has five panels. How can I control which panel comes up? 2) with all the more sophisticated camera movements, I am beginning to rethink lighting. In the past I have just used defaults, maybe a few adjustments on reflectivity. Can I create more lights, or move lights? I assume I can, but I don't want to start mucking around the code and start breaking things or create things that will be hard to maintain. 3) I have noticed >50% of the time when Chimera comes up the accelerator commands are inactive requiring me to type "ac". 4) after getting a basic USB-HID config I plan to go after volume rendering, as mentioned before. A key method in structuring the transfer function is to push a square wave through the range of data, flagging thresholds that have interesting density; from that combine them and individually adjust those thresholds in context of the group. So I think the USB-HID will be helpful in sorting through it quickly. thanks, Matthew Dougherty National Center for Macromolecular Imaging Baylor College of Medicine ________________________________________ From: Tom Goddard [goddard@sonic.net] Sent: Friday, March 08, 2013 8:40 PM To: Dougherty, Matthew T Cc: chimera-dev@cgl.ucsf.edu Subject: Re: [chimera-dev] 3dconnexion Hi Matt, Here is Python to get the side view dialog, display it, query its size and position on the screen in pixels, reposition it, and close it. from chimera import dialogs, viewing d = dialogs.find(viewing.ViewerDialog.name, create = 1) # Get the side view dialog d.enter() # Display the dialog d.uiMaster().winfo_toplevel().wm_geometry() # Get the current size and position '400x341+1186+696' d.uiMaster().winfo_toplevel().wm_geometry('+500+700') # set the position to 500,700 d.Close() # Close window

Hi Matt, Tom Goddard is on a trip to LA and will be back at work on Wednesday, so I'm going to answer the questions I can and leave the others for Tom... On Mar 28, 2013, at 7:56 PM, Dougherty, Matthew T wrote:
Hi Tom,
the USB-HID development is going well. I implemented the code below, make it operate where I needed it,
The code listed below actually works as is? I should think you would need to suppress the "dialog tiling" that Chimera attempts to do, which happens asynchronously after dialog creation. Do you autostart the SideView? Anyway, if you run into conflicts between your attempted positioning and the tiling, add a line to your code: from chimera import dialogs, viewing viewing.ViewerDialog.autoposition = False d = dialogs.find(viewing.ViewerDialog.name, create = 1) # Get the side view dialog The vast majority of Chimera dialogs work this way (IDLE is the only exception I can think of off the top of my head).
put the cursor onto the panel ready to go, using a single button push; then use another button to close it and move back to the display, click on it to make it active, so to be ready for more button pushes. This combined with other codes I can now easily manage hundreds of savepos, or tweak z & focal parameters, then triage them later.
Now I want to do something similar for a variety of dialogs, I particularly want to move the main display, Reply Log, Volume Viewer, Model Panel, & Keyboard Shortcuts. How can I systemically figure these out without bugging you on these small details?
In IDLE, the following will list the dialog registrations: from chimera.dialogs import _allDialogs from pprint import pprint pprint(_allDialogs) From the output of the above commands I glean that: Reply Log: chimera.tkgui._ReplyDialog Model Panel: ModelPanel.base.ModelPanel (since ModelPanel imports * from base, just ModelPanel.ModelPanel is okay) The main display, which isn't really a dialog, is chimera.tkgui.app. I guess this isn't exactly systematic since a lot of extensions don't register their dialogs until the extension is imported. So for example the Volume Viewer dialog isn't listed unless you do an "import VolumeViewer" before the commands I listed above. If you do then you see that: Volume Viewer: VolumeViewer.volumedialog.Volume_Dialog Unfortunately for Keyboard Shortcuts, simply "import Accelerators" isn't enough; you have to "import Accelerators.gui" by which time you might have well just looked in the Python file. Nonetheless, that import reveals: Keyboard Shortcuts: Accelerators.gui.Accelerator_Browser So do you know how to find the Python module name for a tool? Unless it's "core" enough to be in the chimera module itself (in which case the inspection of _allDialogs should get it), go to Chimera's "share" folder and: grep "Tool Name" */ChimeraExtension.py That should reveal which module registers the tool.
Couple of other related questions & observations: 1) On the example below: the ViewerDialog has five panels. How can I control which panel comes up?
Urg. Do not blame me -- I did not write this code. You use the displayed tab name prepended with a 'p' (really, I did not write this!) as follows if you have the Side View dialog instance in the variable 'd': d.nb.raise_page('pRotation') In most sane code you would just be using the displayed tab name.
2) with all the more sophisticated camera movements, I am beginning to rethink lighting. In the past I have just used defaults, maybe a few adjustments on reflectivity. Can I create more lights, or move lights? I assume I can, but I don't want to start mucking around the code and start breaking things or create things that will be hard to maintain.
Look at the Lighting module. It looks like you are limited to a maximum of 3 lights, but I'm guessing that's good enough. There are functions in there for changing the lighting "mode" (1/2/3 lights, or ambient lighting only), contrast, brightness, and the color/direction of the various lights. These last two questions will have to wait until Tom's return... --Eric
3) I have noticed >50% of the time when Chimera comes up the accelerator commands are inactive requiring me to type "ac". 4) after getting a basic USB-HID config I plan to go after volume rendering, as mentioned before. A key method in structuring the transfer function is to push a square wave through the range of data, flagging thresholds that have interesting density; from that combine them and individually adjust those thresholds in context of the group. So I think the USB-HID will be helpful in sorting through it quickly.
thanks,
Matthew Dougherty National Center for Macromolecular Imaging Baylor College of Medicine ________________________________________ From: Tom Goddard Sent: Friday, March 08, 2013 8:40 PM To: Dougherty, Matthew T Cc: chimera-dev@cgl.ucsf.edu Subject: Re: [chimera-dev] 3dconnexion
Hi Matt,
Here is Python to get the side view dialog, display it, query its size and position on the screen in pixels, reposition it, and close it.
from chimera import dialogs, viewing d = dialogs.find(viewing.ViewerDialog.name, create = 1) # Get the side view dialog d.enter() # Display the dialog d.uiMaster().winfo_toplevel().wm_geometry() # Get the current size and position '400x341+1186+696' d.uiMaster().winfo_toplevel().wm_geometry('+500+700') # set the position to 500,700 d.Close() # Close window
_______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev

Here's my earlier reply to Matt that I accidentally did not sent to chimera-dev. Hi Matt, I've attached some Python showing how to position various dialogs on the screen. It just requires knowing the dialog name. Have to paw through Chimera code to find that -- hard for you. Sorry we do not have Chimera programming documented. It is a goal of Chimera 2 that all the programming info will be documented. Not sure why the keyboard shortcuts are only sometimes active. But I'd bet it is because the graphics window doesn't have the focus. If you automatically start the command-line and keyboard shortcuts, it may be random which one wins and gets the keyboard input. I have keyboard shortcuts on by default but not command-line and I believe on the Mac they always work first time for me. You can set the volume rendering transfer function to a window using the volume command. For example, volume #0 style solid level 1.1,0.8 level 2.3,0.8 sets the brightness and opacity to .8 (on a scale of 0 to 1) over density value interval 1.1 to 2.3. The brightness and opacity unfortunately cannot be independently controlled. Chimera is capable of it, but it would require low level function calls. Also if you set opacities all to 1 you tend to get a black cube unless you add "colorMode rgba". Tom On Apr 1, 2013, at 12:49 PM, Eric Pettersen wrote:
Hi Matt, Tom Goddard is on a trip to LA and will be back at work on Wednesday, so I'm going to answer the questions I can and leave the others for Tom...
On Mar 28, 2013, at 7:56 PM, Dougherty, Matthew T wrote:
Hi Tom,
the USB-HID development is going well. I implemented the code below, make it operate where I needed it,
The code listed below actually works as is? I should think you would need to suppress the "dialog tiling" that Chimera attempts to do, which happens asynchronously after dialog creation. Do you autostart the SideView? Anyway, if you run into conflicts between your attempted positioning and the tiling, add a line to your code:
from chimera import dialogs, viewing viewing.ViewerDialog.autoposition = False d = dialogs.find(viewing.ViewerDialog.name, create = 1) # Get the side view dialog
The vast majority of Chimera dialogs work this way (IDLE is the only exception I can think of off the top of my head).
put the cursor onto the panel ready to go, using a single button push; then use another button to close it and move back to the display, click on it to make it active, so to be ready for more button pushes. This combined with other codes I can now easily manage hundreds of savepos, or tweak z & focal parameters, then triage them later.
Now I want to do something similar for a variety of dialogs, I particularly want to move the main display, Reply Log, Volume Viewer, Model Panel, & Keyboard Shortcuts. How can I systemically figure these out without bugging you on these small details?
In IDLE, the following will list the dialog registrations:
from chimera.dialogs import _allDialogs from pprint import pprint pprint(_allDialogs)
From the output of the above commands I glean that:
Reply Log: chimera.tkgui._ReplyDialog Model Panel: ModelPanel.base.ModelPanel (since ModelPanel imports * from base, just ModelPanel.ModelPanel is okay)
The main display, which isn't really a dialog, is chimera.tkgui.app.
I guess this isn't exactly systematic since a lot of extensions don't register their dialogs until the extension is imported. So for example the Volume Viewer dialog isn't listed unless you do an "import VolumeViewer" before the commands I listed above. If you do then you see that:
Volume Viewer: VolumeViewer.volumedialog.Volume_Dialog
Unfortunately for Keyboard Shortcuts, simply "import Accelerators" isn't enough; you have to "import Accelerators.gui" by which time you might have well just looked in the Python file. Nonetheless, that import reveals:
Keyboard Shortcuts: Accelerators.gui.Accelerator_Browser
So do you know how to find the Python module name for a tool? Unless it's "core" enough to be in the chimera module itself (in which case the inspection of _allDialogs should get it), go to Chimera's "share" folder and:
grep "Tool Name" */ChimeraExtension.py
That should reveal which module registers the tool.
Couple of other related questions & observations: 1) On the example below: the ViewerDialog has five panels. How can I control which panel comes up?
Urg. Do not blame me -- I did not write this code. You use the displayed tab name prepended with a 'p' (really, I did not write this!) as follows if you have the Side View dialog instance in the variable 'd':
d.nb.raise_page('pRotation')
In most sane code you would just be using the displayed tab name.
2) with all the more sophisticated camera movements, I am beginning to rethink lighting. In the past I have just used defaults, maybe a few adjustments on reflectivity. Can I create more lights, or move lights? I assume I can, but I don't want to start mucking around the code and start breaking things or create things that will be hard to maintain.
Look at the Lighting module. It looks like you are limited to a maximum of 3 lights, but I'm guessing that's good enough. There are functions in there for changing the lighting "mode" (1/2/3 lights, or ambient lighting only), contrast, brightness, and the color/direction of the various lights.
These last two questions will have to wait until Tom's return...
--Eric
3) I have noticed >50% of the time when Chimera comes up the accelerator commands are inactive requiring me to type "ac". 4) after getting a basic USB-HID config I plan to go after volume rendering, as mentioned before. A key method in structuring the transfer function is to push a square wave through the range of data, flagging thresholds that have interesting density; from that combine them and individually adjust those thresholds in context of the group. So I think the USB-HID will be helpful in sorting through it quickly.
thanks,
Matthew Dougherty National Center for Macromolecular Imaging Baylor College of Medicine ________________________________________ From: Tom Goddard Sent: Friday, March 08, 2013 8:40 PM To: Dougherty, Matthew T Cc: chimera-dev@cgl.ucsf.edu Subject: Re: [chimera-dev] 3dconnexion
Hi Matt,
Here is Python to get the side view dialog, display it, query its size and position on the screen in pixels, reposition it, and close it.
from chimera import dialogs, viewing d = dialogs.find(viewing.ViewerDialog.name, create = 1) # Get the side view dialog d.enter() # Display the dialog d.uiMaster().winfo_toplevel().wm_geometry() # Get the current size and position '400x341+1186+696' d.uiMaster().winfo_toplevel().wm_geometry('+500+700') # set the position to 500,700 d.Close() # Close window
_______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev
participants (3)
-
Dougherty, Matthew T
-
Eric Pettersen
-
Tom Goddard