Unable to align layers

I’m trying to align multiple layers of montaged TEM images using the “align layers” function, but get the following error:
pre-aligned all but 0 tiles
1086 features extracted for layer z=2432.000 z=2432.0' layer z=2432.000 z=2432.0’ -> layer z=2000.000 `z=2000.0’: no correspondences found.

java.lang.IllegalArgumentException: Illegal Capacity: -1
at java.util.ArrayList.(ArrayList.java:157)
at mpicbg.models.TileUtil.optimizeConcurrently(TileUtil.java:149)
at mpicbg.models.TileConfiguration.optimizeSilentlyConcurrent(TileConfiguration.java:310)
at mpicbg.models.TileConfiguration.optimize(TileConfiguration.java:376)
at mpicbg.models.TileConfiguration.optimize(TileConfiguration.java:332)
at mpicbg.models.TileConfiguration.optimize(TileConfiguration.java:350)
at mpicbg.trakem2.align.RegularizedAffineLayerAlignment.exec(RegularizedAffineLayerAlignment.java:415)
at mpicbg.trakem2.align.RegularizedAffineLayerAlignment.exec(RegularizedAffineLayerAlignment.java:537)
at mpicbg.trakem2.align.RegularizedAffineLayerAlignment.exec(RegularizedAffineLayerAlignment.java:574)
at mpicbg.trakem2.align.AlignLayersTask.alignLayers(AlignLayersTask.java:222)
at mpicbg.trakem2.align.AlignLayersTask$1.run(AlignLayersTask.java:102)
at java.lang.Thread.run(Thread.java:748)

This error occurs with both the least squares and elastic alignment methods. I’m not fluent in Java, so I’m sure how to interpret what’s going on here. The two layers I’m trying to align are about 720 nm and 432 pixels apart. Could it be happening because the layers I’m trying to align are too far apart for the algorithm to find similarities?

Hi @etozment,

Welcome to the forum.

It will be hard to help without details, but basically, this part:

says that the algorithm could not find point correspondences between the images,
or maybe more likely, that it found some correspondences that were outlier-rejected for some reason. Adjusting the parameters may help - this page describes what they do (it’s alot I know).

But to start, I’d recommend you try:
Plugins > Feature Extraction > Extract SIFT Correspondences
which will let you quickly try different sets of parameters.


1 Like

I think the problem might be the fact that the layers I’m trying to align are mirrored along the x-axis relative to each other. I can fix this by manually flipping each individual image and re-montaging them, but is there a way to just flip the whole layer?

Does anyone know if there’s a way to flip a montaged layer along an axis without editing each of its component images and re-montaging it?