How to align images manually and merge them into a multi-channel composite image?

Hi,

I have 4 images taken in 4 different days.

I want to manually align the 4 images, because there are small shifts and movements each time I image.

Then I want to merge the 4 aligned images into a 4-channel composite image, where each day image corresponds to a different channel. For example, day1=R, day2=G, day3=B, day4=gray.

Can anyone kindly give me any advice how I can do this?

I don’t think I can use any automatic method for aligning, since the images are quite complicated and need human eye inspection to decide matching points.

I attached the 4 images, if anyone wants to see what they’re like.

Thank you very much!

Day1

Day2

Day3

Day4

1 Like

Hi @Jiseok

There is a pretty complete list of Fiji plugins for alginment here
https://imagej.net/Category:Registration

If you really do need to manually click points to align, and need deformation, then I would recommend Bigwarp.

Bias alert: I wrote Bigwarp.

John

4 Likes

I tried Bigwarp and it’s awesome! Thank you so much.

1 Like

Hi!

Recently I was trying to use BigWarp plugin but somehow there’s an error and I can’t click mark the points…

Do you have any idea what went wrong?

I have a error log window like this:

Warning: could not load class 'Diffraction_PSF_3D'; skipping
java.lang.ArrayIndexOutOfBoundsException: 0
	at org.scijava.annotations.ByteCodeAnalyzer.getU1(ByteCodeAnalyzer.java:147)
	at org.scijava.annotations.ByteCodeAnalyzer.getU2(ByteCodeAnalyzer.java:151)
	at org.scijava.annotations.ByteCodeAnalyzer.getU4(ByteCodeAnalyzer.java:155)
	at org.scijava.annotations.ByteCodeAnalyzer.getU4(ByteCodeAnalyzer.java:143)
	at org.scijava.annotations.ByteCodeAnalyzer.<init>(ByteCodeAnalyzer.java:59)
	at org.scijava.annotations.ByteCodeAnalyzer.getAnnotations(ByteCodeAnalyzer.java:353)
	at org.scijava.annotations.DirectoryIndexer.discoverAnnotations(DirectoryIndexer.java:94)
	at org.scijava.annotations.EclipseHelper.index(EclipseHelper.java:229)
	at org.scijava.annotations.EclipseHelper.maybeIndex(EclipseHelper.java:217)
	at org.scijava.annotations.EclipseHelper.updateAnnotationIndex(EclipseHelper.java:156)
	at org.scijava.annotations.Index.load(Index.java:88)
	at mpicbg.spim.data.generic.base.ViewSetupAttributes.build(ViewSetupAttributes.java:50)
	at mpicbg.spim.data.generic.base.ViewSetupAttributes.getNameForClass(ViewSetupAttributes.java:66)
	at mpicbg.spim.data.generic.sequence.BasicViewSetup.setAttribute(BasicViewSetup.java:157)
	at bigwarp.loader.ImagePlusLoader.load(ImagePlusLoader.java:175)
	at bigwarp.loader.ImagePlusLoader.loadAll(ImagePlusLoader.java:97)
	at bigwarp.BigWarpInit.createBigWarpData(BigWarpInit.java:336)
	at bigwarp.BigWarpInit.createBigWarpDataFromImages(BigWarpInit.java:407)
	at bdv.ij.BigWarpImagePlusPlugIn.run(BigWarpImagePlusPlugIn.java:79)
	at ij.IJ.runUserPlugIn(IJ.java:222)
	at ij.IJ.runPlugIn(IJ.java:186)
	at ij.Executer.runCommand(Executer.java:137)
	at ij.Executer.run(Executer.java:66)
	at java.lang.Thread.run(Thread.java:745)
WARNING:
Opening <SpimData> dataset that is not suited for interactive browsing.
Consider resaving as HDF5 for better performance.
WARNING:
Opening <SpimData> dataset that is not suited for interactive browsing.
Consider resaving as HDF5 for better performance.
WARNING:
Opening <SpimData> dataset that is not suited for interactive browsing.
Consider resaving as HDF5 for better performance.
WARNING:
Opening <SpimData> dataset that is not suited for interactive browsing.
Consider resaving as HDF5 for better performance.

Thanks!

Hi @Jiseok,

Yikes, this may have to do with a recent update to fiji. Did this happen after updating?

Two things:

  1. Can you try replacing the bigwarp_fiji jar in your Fiji plugins folder with the latest un-released version.
  2. How are you running Bigwarp exactly? Are you using a beanshell script? Or clicking through the menus in fiji.

Sorry for the trouble, and thanks for reporting the problem,
John

1 Like

Definitely try this one. You can apply this to a multi stack image.

Yes, it happened recently after updating ImageJ.
I use Bigwarp by clicking through the menus.
Thanks, I’ll try the new version plugin and let you know if it works.

Hi bogovicj,

I tried your latest un-released version and it worked well with the newest fiji update (1.52c - tried on 2018/06/18).

Thanks a lot, this bigwarp plugin is really, really, super helpful. It got rid of a lot of troubles for me and improved my data quality significantly.

I look forward to the official updated release of this plugin. Thanks.

2 Likes

Happy to to hear, thanks for being a “beta-tester” :slight_smile:

John

Hi @bogovicj,

I am trying to enter in the Landmark mode but it doesn’t work. I have tried:

  • Clicking spacebar (to enter in the Landmark mode, it doesn’t appear warning of entering into landmark mode) and later on Ctrl + left click into the point.
  • Holding spacebar + Ctrl + left click

I am on Windows with English distribution of the keyboard.

Thank you,

Miguel

@malj390,

Yea, I know, sorry. The daily build fixes that problem:
http://maven.imagej.net/service/local/repositories/snapshots/content/sc/fiji/bigwarp_fiji/3.1.2-SNAPSHOT/bigwarp_fiji-3.1.2-20180810.162804-10.jar
(replace your bigwarp jar with that and it should work )

I plan on making a new release tomorrow (hopefully).

John

A dependency of bigwarp changed and broke something.

I replaced it but still doesn’t enter into the landmark mode.

It is the first time that I use it so I do not know if I am doing something wrong. Should I replace any dependency?

Thanks,

Miguel

@malj390,

Oh weird, could you please start a new forum post (to keep it separate from this one and hopefully easier for others to find).

If you havn’t recently, try updating your fiji, then replacing the bigwarp jar.
Are there any messages in the bigwarp window? Or errors on the fiji console Window > Console?

Thanks
John

Oh sorry! I just was trying to save it directly and Chrome did not have enough permissions to save it. So I wasn’t replacing it at all. Now, It is working properly!

Great job! Thank you for this utility!

Best regards,
Miguel

1 Like