Limit the tile displacement in Stitching

Is there a way to limit the displacement of tiles when using Grid/Collection Stitching with a configuration given by a TileConfiguration.txt file?

Let’s say I have a TileConfiguration like this:

# Define the number of dimensions we are working on
dim = 3

# Define the image coordinates
Name_s1.tif; ; (-101849.934, 97292.0117, 6705)
Name_s2.tif; ; (-100931.934, 97292.0117, 6705)
Name_s3.tif; ; (-101849.934, 98023.7117, 6705)
Name_s4.tif; ; (-100931.934, 98023.7117, 6705)

and I want to refine the alignment by calculating the overlap, but I want to limit the displacement to e.g. 50px in each x, y and z to not disturb the setup too much.
I had cases where there are false correspondences detected, and tiles end up in totally wrong positions in the result stack. In these cases, I’d rather choose to ignore those tiles when the displacement from the original position is too large. Is this possible?

I know the max/avg displacement threshold and absolute displacement threshold parameters mentioned in the documentation, but they seem to be unavailable when running in the Positions from file / Defined by TileConfiguration mode.

@StephanPreibisch, can you comment on that?

Hi @imagejan,

if you launch the stitching process via a macro, you should be able to specify the max displacement with the command, right?

Do you have a use case where this is not a valid workaround? I’d be interested in having the stitching package more “publicly” refactored for fine-grained usage from the scripting languages as well! And/or extending the configuration file syntax to achieve things like this! :smile:


1 Like

What version of the Stitching jar do you have? In a current Fiji, mine’s at 3.1.0. Here’s what my dialog looks like for Positions from file / Defined by TileConfiguration:

So I am wondering if you have an update site enabled providing a skewed Stitching version…?

@hinerm You’re right, they are indeed available, I don’t know why I thought there was a difference between the Grid and the Positions from file modes.

The problem I’m facing is more likely that there are wrong alignments detected in the first place. I was playing around with all three threshold parameters, but still the tiles (stacks that arguably contain only very few regions with signal) deviated quite a lot from the expected grid layout. I’d need a way to tell the plugin: don’t displace each tile by more than ±20 µm from the coordinates given in the TileConfiguration file.

If I understand correctly, the displacement thresholds of the plugin consider the average deviation of each tile pairing in the global state from the local optimum. The original coordinates given in the file are only taken into account for initialization of the phase correlation, not in the subsequent global optimization. Do I misunderstand this?