Image Stitching using FIJI/ImageJ

Hello, I’m a beginner level ImageJ user trying to stitch ROI’s using the Grid Collection Stitching plug in. I have 18 images I’d like to stitch side by side into an unfolded image. After selecting the image series I get the following error:

“ERROR: Found: 1 tiles, but at least 2 are required for stitching. Aborting.”
I’m using the type= positions from file and order=defined by image meta data

Any ideas what I could be doing wrong? And how I could fix it.

Thanks,
Quiroz-1

Below are some sample images

1.tif (380.6 KB)
2.tif (380.6 KB)
3.tif (380.6 KB)
4.tif (380.6 KB)

1 Like

Hey @Quiroz-1,

would you mind sharing a screenshot showing how you configured the stitching? That might make it easier for us to guess what’s wrong :wink:

Cheers,
Robert

Hi Robert,

Yes, here it is.

Thanks,
Quiroz-1

1 Like

Hi @Quiroz-1,

the reason is that your 1.tif image is not an image sequence. It’s a single image. Please put all your images in a folder and run the grid collection stitching like this:

Set the grid size to 4x1, the overlap to 50%, the folder accordingly, the file names for tilies to {i}.tif and deactivate “Compute overlap”

The result should then look like this:

Let us know if it works!

Cheers,
Robert

2 Likes

Hi Robert,

This worked!

One other question, the ROI’s have to be the same size for this to work? I tried doing this process again, cropping individual files instead of cropping a stack of images and it gave me the following error

Thank you,
Quiroz-1

1 Like

I’m afraid the tiles have to have the same size, yes.

Ok great. I will crop entire image stacks to ensure this works.

Thanks for your help!
Quiroz-1

Hi @haesleinhuepf,

I did another test using this stitching method, with some grid paper, and have some questions. There’s a significant difference between selecting the “compute overlap” and not selecting it. When selecting the compute overlap the fused image looks much better than without the compute overlap, but there’s still some very small parts that are not fused 100%.

I’d like to know what these parameters represent and how to optimize the image. I’ve been looking online to for some details on this, but I haven’t found info yet. The plugin website doesn’t provide much info on the different parameters [https://imagej.net/Grid/Collection_Stitching_Plugin].

Here are the ROI’s I used to do the stitching (same size ROI):

1.tif (539.1 KB)
2.tif (539.1 KB)
3.tif (539.1 KB)
4.tif (539.1 KB)
5.tif (539.1 KB)
6.tif (539.1 KB)
7.tif (539.1 KB)
8.tif (539.1 KB)
9.tif (539.1 KB)
10.tif (539.1 KB)

These are the fused images:
without compute overlap
Fused-without compute.tif (2.9 MB)

with compute overlap
Fused-with compute overlap.tif (2.9 MB)

Small not 100% overlap regions highlighted in red

Thank you,
Quiroz-1

2 Likes

Hi @Quiroz-1,

The “compute overlap” checkbox enables the computer to correct the positioning of the tiles automatically. If you turn it off, it will put the images at the position as you configured (e.g. 50% overlap means the second image is placed in the center of the first image). If you turn it on, the program will try to find out if the image fits better at 49% or 51%. The general algorithm behind is called image registration.
If you want to learn some basics about image registration, you can for example have a look at some slides I made:

If you want to learn more about the implementation in the Grid Collection Stitching plugin, I would recommend reading Stephan Preibischs paper:

Let us know if you need any further support!

Cheers,
Robert

1 Like

Hi, especially as a beginner BigStitcher should be much easier to use as it simplifies the import a lot (https://imagej.net/BigStitcher) … did you try this instead?

Best,
Stephan

2 Likes

Hi @StephanPreibisch,

I have not used the BigStitcher plugin. I went ahead and loaded the plug in to try a run. It’s not as intuitive as the Grid/Collection plug in. Could you provide some insight on process workflow?

Is there batch processing that needs to be done before actual image fusion? I tried the “Data set Fusion” option, and noticed the file has to be in “xml”. How do I convert the images to “xml”?

Could you provide some insight on process workflow?

Thank you,
Quiroz-1

Hi, it is still advisable to at least take a look at the documentation :wink: There are also Videos :blush:

Start Bigstitcher, define a new dataset, click a few times ok, Stitch in BigStitcher, fuse in BigStitcher … if you get stuck let me know

Hi @StephanPreibisch,

Reading the documentation I was able to to come up with a stitched image, but not fused correctly. I set the time points to the same (0). I don’t know if this could be the error.


fusedBigStitcher.tif (7.4 MB)

Stitched data set


Also, I got confused as to how to align the images. I see the misalignment in the vertical direction (highlighted in red).

Could you please link the videos you mention.

I appreciate your help.
Thank you,
Quiroz-1

Hi, great progress! Could you upload your input images somewhere? Then I can make a quick HowTo for you…

Seems like you are basically doing it right, just the initial placement of the tiles is off. The outlined black areas are expected. If the algorithm moves some tiles a bit down to match well, there is no image data left and it fills it with black pixels.

Best,
Stephan

Hi @StephanPreibisch,

I attached the images used in the zip file.

Image Stitching.zip (3.8 MB)

Thank you!
Quiroz-1

Hi @StephanPreibisch,

I was able to get the tiles in correct order, and a better fusion. Not perfect, but I’m still playing with the plug-in. Any tips on how to get a perfect fusion? Is there a way for bigstitcher to compute overlap?


One thing I’m having trouble with is being able to see the saved tiffs. I save them as tiffs using the virtual setting, but they open as a blank image. What could be the reason for this?
fused big.tif (11.6 MB)

Thanks,
Quiroz-1