Skip to content, Skip to search

Changes

TrakEM2 Scripting

1,716 bytes added, 22:14, 28 October 2009
no edit summary
Examples in [[Jython Scripting|Jython]].
Open the "Plugins - Scripting - Jython Interpreter" (see [[Scripting Help]]) and make sure there is a TrakEM2 project open, with a display open. Then type or paste:the examples below.
Some basics:
 
*The canvas into which images are dragged and visualized is part of a [http://www.ini.uzh.ch/~acardona/api/ini/trakem2/display/Display.html Display] object. The latter has methods to access its [http://www.ini.uzh.ch/~acardona/api/ini/trakem2/display/Selection.html Selection], as well as the [http://www.ini.uzh.ch/~acardona/api/ini/trakem2/display/Layer.html Layer] and [http://www.ini.uzh.ch/~acardona/api/ini/trakem2/display/LayerSet.html LayerSet] that the Display is viewing.
*The Layer contains 2D objects like [http://www.ini.uzh.ch/~acardona/api/ini/trakem2/display/Patch.html Layer] Patch] (each Patch wraps an image) and [http://www.ini.uzh.ch/~acardona/api/ini/trakem2/display/Dlabel.html Layer] DLabel] (floating text).
*The LayerSet contains 3D objects like [http://www.ini.uzh.ch/~acardona/api/ini/trakem2/display/AreaList.html AreaList], [http://www.ini.uzh.ch/~acardona/api/ini/trakem2/display/Pipe.html Pipe], [http://www.ini.uzh.ch/~acardona/api/ini/trakem2/display/Polyline.html Polyline], [http://www.ini.uzh.ch/~acardona/api/ini/trakem2/display/Ball.html Ball], [http://www.ini.uzh.ch/~acardona/api/ini/trakem2/display/Dissector.html Dissector], [http://www.ini.uzh.ch/~acardona/api/ini/trakem2/display/Treeline.html Treeline] and [http://www.ini.uzh.ch/~acardona/api/ini/trakem2/display/Stack.html Stack] (the latter wraps an ij.ImagePlus that contains an ij.ImageStack).
 
Both Layer and LayerSet and in a way containers. The LayerSet contains as well a list of Layer. The Display merely views the data in a LayerSet, one Layer at a time.
 
See a http://www.ini.uzh.ch/~acardona/img/trakem2_datastructure_diagram.svg TrakEM2 class diagram] for a complete list.
Emailconfirmed, uploaders
653
edits