Skip to content, Skip to search


TrakEM2 Scripting

9 bytes removed, 05:56, 9 March 2011
Interacting with Layers (Sections)
=== Calibrating the Z dimension ===
=== Setting the Z value of each section === Each [ Layer] stores a Z coordinate as and a thickness value with <i>double</i>precision. This The Z coordinate is in pixels.
How to compute the Z coordinate of a [ Layer]: suppose that the calibration specifies 4x4x50 nm. This means 4 nm/px in the X axis, 4 nm/px in the Y axis, and 50 nm/px in the Z axis. It is assumed that you set this values by right-clicking on the canvas window and choosing "Display - Calibration...", which opens the familiar ImageJ dialog for image calibration.
Then we must set this thickness to every section. This consists of the following steps to be done on the <i>Layer Tree</i> This is the tree that lists the layers in the TrakEM2 window):
1. Right-click on the "Top Level [Layer Set]" node of the <i>Layer Tree</i>. Then choose "Reset layer Z and thickness". 2. Click on the first layer node, then shift+click on the last layer node. All nodes will be selected.
3. Right-click on the selected nodes and choose "Scale...".
4. In the dialog, type in "12.5"--the value we computed above.
To accomplish the same programmaticallyprogramatically, do the following:
<source languagelang="python">
z = 0
thickness = 12.5
Emailconfirmed, uploaders