Extending Amira Label Files in Fiji

In some projects data stacks need to be extended, e.g. if a structure is not completely covered in the so far sectioned part of a sample. Adding more images to an alignment in TrakEM2 and exporting the resulting image stack to Amira is easily done, however Amira will not extend the already started label file without copying the label present on the last slice to all new following slices.

With the knowledge of the fact, that label files are solely tiff stacks using single channels to store the labels (see also here), it is no big problem to extend this tiff (label) stacks to fit the larger image stack im Amira later.

The following example will extend a given label file by 5 slices in order to fit a data stack of 12 slices instead of the original seven.

A) Open the Amira Label file in Fiji (see here).

B) Scroll to the last image in the stack

C) Open a new macro

D) Copy the following script to your macro

n = nSlices;
setSlice(n);
a = getNumber ("number of slices to add?", 100);
   for
   (i = 0; i < a; i++) {
   	run("Add Slice");
   }

It should look like this afterwards:

E) Hit “Run” and enter the needed number of slices to be added.

Result:

F) To save the label file, go to File –> Save as –> Amira Mesh and save the file in .am format.

This file can now be opened in Amira and will fit the extended data stack.

Leave a Reply