Hello all,
I am using ImageJ (Fiji) to register pairs of images. I have written a macro to automate the process but have recently discovered some strange behaviour.
I use bUnwarpJ to register and SIFT/MOPS to find landmarks. One of the problems I have encountered is when I copy mask images across prior to registration. Here I have the following snipet of code which adds a stack to one image and copies the mask.
//Add source mask
selectWindow("Source Mask");
run("Copy");
close();
selectWindow(sourceName);
run("Add Slice");
run("Paste");
wait(1000);
setSlice(1);
//Add target mask
selectWindow("Target Mask");
run("Copy");
close();
selectWindow(targetName);
run("Add Slice");
run("Paste");
wait(1000);
setSlice(1);
RegisterPair.txtMost of the time this works fine. However occasionally both source and target mask are copied across to the source image only and the target image has no mask. Why would this happen.
There are a few other examples of such incidences occurring. For example to check if registration is successful I have another macro which applies pseudo colour to the registered source image and target image and uses imageCalculator to create the sum of the two. This works fine most of the time but occassionally it fails to find one of the images. When I run the macro again this problem no longer exists.
Additionally my macro appears to converge at slightly different solutions without changing any input parameters. My laptop is new (2 months) and I don't think the problem is hardware related. Is there anything obvious which will cause such issues?
Thanks,
Jamie