fiji / bUnwarpJ

ImageJ/Fiji plugin for consistent elastic registration of 2D images
http://imagej.net/BUnwarpJ
GNU General Public License v3.0
23 stars 10 forks source link

Registration fails using macro call but succeeds if performed manually #5

Closed mariokreutzfeldt closed 4 years ago

mariokreutzfeldt commented 5 years ago

Hello,

I want to register Tissue Micro Array cores. While it works for many cores, I have some image pairs where image registration fails when performed using the macro call but is perfect if the registration is performed using the plug-in manually with the same settings. Due to the source of the images, their dimensions are not identical. Maybe this causes issues in the macro call? Attached are the results of the macro call and the manual registration as well as the example image pair (zip file). Any idea what could cause this issue?

Thank you and best regards, Mario

------MACRO CALL------

// ImageJ version: 1.52r
// tested bunwarpJ versions: 2.6.8 ,2.6.9 ,2.6.10 ,2.6.11

// set variables
source ="D:/TMALynch_01_A01__round2_C3.tif";
target ="D:/TMALynch_01_A01__round1_C3.tif";
target_txt=target+ ".txt";

// open images
run("Bio-Formats Windowless Importer", "open=" + target);
run("Bio-Formats Windowless Importer", "open=" + source);

// call bunwarpJ 
run("bUnwarpJ", "source_image="+source+" target_image="+target+" registration=Mono image_subsample_factor=2 initial_deformation=[Very Coarse] final_deformation=[Super Fine] divergence_weight=0.1 curl_weight=0.1 landmark_weight=0 image_weight=1 consistency_weight=10 stop_threshold=0.01 save_transformations save_direct_transformation="+target_txt+" ");

registered_macrol registered_manual

bunwarpJ_bug.zip

ctrueden commented 5 years ago

@iarganda Do you have time to look into this?

@mariokreutzfeldt If you don't receive a response here, I encourage you to try posting your question on the Image.sc Forum tagged with imagej and fiji.

mariokreutzfeldt commented 5 years ago

@ctrueden

Thank you, I will post it there, too! I'd just like to add another observation:

When aligning 3 images the following way in a macro call using sub-sampling factor 4: 1 (target) <- 2 (source) 1 (target) <- 3 (source)

After merging all 3 images after registration, image 2 and 3 overlap perfectly, but the target image 1 is shifted 6px up and 6px to the left. This shift is always the same in hundreds images I have registered that way.

Best regards, Mario

iarganda commented 5 years ago

I will try to have a look as soon as I can (which may be in a few days)!

mariokreutzfeldt commented 4 years ago

@iarganda Hi, I just wanted to know if you already had the time to look into the issue? Please let me know if you need additional information or examples.

Thank you and best regards, Mario

iarganda commented 4 years ago

I found the bug, working on it!

iarganda commented 4 years ago

OK, it should be fixed now with the latest release. Thanks a lot for reporting, let me know if find any other problem!

ctrueden commented 4 years ago

@iarganda Thank you so much for investigating and fixing! 🙏 💖

For cutting new releases in future, please use the release-version.sh script, rather than pushing directly to master. See this documentation for details.

Thanks again!

mariokreutzfeldt commented 4 years ago

Thank you very much @iarganda for fixing this issue so fast! Have a great day!

iarganda commented 4 years ago

@mariokreutzfeldt , thank YOU for reporting!

iarganda commented 4 years ago

@ctrueden sorry about that. I should get updated myself... I'll try to do that next time!