Skip to content, Skip to search

Changes

TrakEM2 Scripting

631 bytes added, 10:40, 12 March 2011
Save the project while running a task
Notice how about we called <i>getOrigins(Tree)</i> and <i>getTargets(Tree)</i>, which filters all potential origins and targets (Patch--an image--, AreaList, etc.) so that only Tree instances will be present in the lists.
 
= Interact with a Ball object =
 
== Set the radius of all balls of all Ball objects in a project ==
 
<source lang="python">
##############
# Set a specific radius to all individual spheres
# of all Ball objects of a TrakEM2 project.
 
 
calibrated_radius = 40 # in microns, nm, whatever
 
 
display = Display.getFront()
layerset = display.getLayerSet()
cal = layerset.getCalibration()
# bring radius to pixels
new_radius = calibrated_radius / cal.pixelWidth
 
for ballOb in layerset.getZDisplayables(Ball):
for i in range(ballOb.getCount()):
ballOb.setRadius(i, new_radius)
ballOb.repaint(True, None)
##############
</source>
= Save the project while running a task =
Emailconfirmed, uploaders
653
edits