Merge Labels

Suppose you have two parts that are already registered (overlap perfectly), you can use the Merge module (compute -> Merge) to merge the parts into a complete piece.


The values in the overlaping area will be from one data input or another, they will NOT be added or combined in any manner. Here the Merging means physical attices.

If you need to register the parts first, try the image registration wizard (Geometry Transforms > Image Registration Wizard ). You can find a tutorial from Avizo 8 user’s guide, chapter Using the Image Registration Wizard - example with partially overlapping images, page 349.

You can also merge the segmented data (.label files) directly, although the problem is that corresponding materials will NOT magically know “they are the same material”. To cleanly merge the labels, you need to do some pre-processing first.

Suppose you have two label files, the first one have 4 materials, with data value 1, 2, 3, 4. The exterior (not belong to any material) has data value 0. The second one have 2 materials, with data value 1, 2. Similarly, the exterior has data value 0.

Now you can invoke the segmenation editor to look at the materials, and decide that material 1 in file 1 and material 1 in file 2 are the same material, thus needs to be “merged”. On the other hand, material 2 in file 2 is a separate material of its own, it should NOT be merged with any materials in file 1. In this case, I would want my file 2 ‘s two materials have data value 1 and 5, and after merge, the merged file will have 5 materials, with data value 1, 2, 3, 4, 5. Both exterior will remain data value 0. Here are the steps to achieve this goal:

  1. Attach “Arithmetic” module to file 2 dataset, set expression to: A==1, apply, you get a “result” dataset
  2. Attach another “Arithmetic” module to file 2 dataset, set expression to : 5*(A==2), apply, you get a “result2” dataset.
  3. Attach “Arithmetic” module to “result” dataset, set the second input to “result2” dataset, set expression to : A+B, apply, you get “result3” dataset.
  4. You can combine the previous three Arithmetic modules into one: attach Arithmetic to file 2 dataset, set expression to : 1*(A==1) + 5*(A==2), apply. You get a result dataset ready to be merged with file 1 dataset.
  5. Now attach “Merge” module to file 1 dataset, set second input to “result3” dataset, apply. You will get a new label file where all materials are correctly merged.


Before merging the label files, make sure that the materials can be merged to begin with. For example, you can’t expect to merge material 1 in file 1 to both materials 1 and 2 in file 2, that doesn’t make any sense.