Import of large Amira label files to TrakEM2

Some projects might need in a later project step a realignment of the image data (after segmentations have been done already) to correct for so far overlooked smaller alignment errors. It is possible to recalculate the Amira labels to the new image transformations in TrakEM2 (assumed you have done the initial image alignment in TrakEM2), so that all so far performed segmenting work is not lost.

To do so, the label data first needs to be loaded back onto the original alignment, in order to send it in a second step to a sibling project, containing the new alignment of the image files. The Amira label import can be done relatively straight forward in small to medium sized projects, but can lead to system crashes in case of large data sets due to the amount of RAM needed for this process. 

This issue can however be easily solved by the following procedure:

  1. import the Amira label file into FIJI (File—> Import—>Amira)
  2. split the tif stack into several parts in the following way: duplicate the stack (shift-d) and define each time a sub-range of the stack (e.g. 1-300, 301-601….), save each substack as Tif file.
  3. import the labels of the substacks one after the other in TrakeEM2 (Import—> Import labels as arealists…) to the original aligned project (Make sure to set the right starting point in z). The labels will show up in the project window
The original label numbers of all substacks remain the same during the import

4. Merge the labels: As TrakEM2 reads out the different channels in each substack, all parts of the same label have the same name (e.g. Label 1 (area_list)). Mark all of them (holding shift while clicking on the labels in the Z space list) and merge them (right click —> merge). Final result are again single files per label.

Merging of the multiple label parts to generate the final single labels