→For importing large collections of images and editing them immediately afterwards: update link: Jython Scripting moved to Jython Scripting Examples a while ago
Infobox | software = ImageJ | name = TrakEM2 | author = Albert Cardona | maintainer = Albert Cardona ([mailto: acardona@ini. phys.ethz.ch firstname.lastname@example.org]) | filename = TrakEM2_ .jar (Included in Fiji) | source = [http://repo.or.cz/w/trakem2.git trakem2 git repository] | released = May 2006 | latest version = 0.8n (April 12, 2011) | status = active | category = [[:Category:Registration|Registration]], [[:Category:Segmentation|Segmentation]], [[:Category:Image annotation|Image annotation]], [[:Category:Plugins|Plugins]] | website = [http://www.ini.uzh.ch/~acardona/trakem2.html TrakEM2 news and documentation]}} TrakEM2 is an ImageJ plugin for morphological data mining, three-dimensional modeling and image stitching, registration, editing and annotation.
See [http://www.ini.uzh.ch/~acardona/snapshots.html TrakEM2 snapshots] for an overview.
== Features ==
The following configuration has been tested in a machine with 8 CPU cores and 16 Gb of RAM, running Ubuntu 8.04 "Hardy", with a 1.6.0_16 or newer JVM:
fiji -Xms10g -Xmx10g -Xincgc -XX:MaxPermSize=256m -XX:PermSize=256m
-XX:NewRatio=5 -XX:CMSTriggerRatio=50 -XX:+UseCompressedOops --
To set the script to all images, save the above to a file named "whatever.bsh" (notice the filename extension ".bsh") and then right-click on the TrakEM2 canvas and choose "Script - Set preprocessor script layer-wise", and choose the whole range of layers. This will set the script to every image of every layer, and trigger mipmap regeneration for every image. When TrakEM2 loads the image, the script will run on the image before TrakEM2 ever sees its contents.
The preprocessor script gives you maximum power: do whatever you want with the image. For example, [[Jython Scripting#Correct_illumination_in_a_stack:_apply_the_illumination_of_one_slice_to_all_others | normalize the image]] relative to a known good mean and standard deviation for your data set.
=== For regenerating mipmaps the fastest possible ===
If you change the method for generating mipmaps to a non-Gaussian method, the above situation does not occur. Set the number of threads for regenerating mipmaps to the number of cores, or less if your computer doesn't have much RAM.
== How much RAM should I allocate to the JVM for Fiji to run TrakEM2? ==
[[Image:TrakEM2-display-2.png|thumb|left|232px|[[TrakEM2]] showing one section of a serial section transmission electron microscopy (ssTEM) data set, with numerous neuronal arbors reconstructed using [http://www.ini.uzh.ch/~acardona/trakem2_manual.html#trees treelines] and [http://www.ini.uzh.ch/~acardona/trakem2_manual.html#connectors connectors] (for synapses).]]
[[Image:TrakEM2_Display_segmentations.png|thumb|left|232px|Example TrakEM2 segmentations, including Ball, Pipe, Profile, AreaList and floating text labels.]]