I use the Grid/Collection stitching plugin in Fiji in a macro to stitch tiles from IHC images together for subsequent analysis. The images often contain structured and empty areas. I use “Linear blending” as fusion method and “Compute overlap” with 5% tile overlap:
tileOverlap = 5; run("Grid/Collection stitching", "type=[Grid: row-by-row] order=[Right & Up] grid_size_x="+gridX +" grid_size_y="+gridY +" tile_overlap="+tileOverlap +" first_file_index_i=1 directory="+dirInput_tif +" file_names="+image +" output_textfile_name=TileConfiguration.txt fusion_method=[Linear Blending] regression_threshold=0.30 max/avg_displacement_threshold=2.50 absolute_displacement_threshold=3.50 compute_overlap display_fusion computation_parameters=[Save computation time (but use more RAM)] image_output=[Fuse and display]");
This works well, however I get black tiles in areas (mostly in the corners) where there is no visible structures to stitch together (which makes sense to me because it is difficult to compute the overlap of nothing). If I do not compute the overlap I get stitching of all tiles but the stitching result is not always accurate. The plugin does only accept integer for the overlap percentage. It does not cause issues to the subsequent analysis if I replace the black squares with white ones, nevertheless having a complete stitched image would be preferred.
Is there a way to force the stitching plugin to just use the defined overlap for tiles where no overlapping structure could be found?