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

bug in Transformation.doBidirectionalRegistration and doUnidirectionalRegistration #13

Open airvine2 opened 2 years ago

airvine2 commented 2 years ago

There is a bug in both functions used to calculate the transformation - within the while loop (which checks state), there is a switch-case statement, which checks the value of state. Then, within case (state==2), there is an if-else statement that checks if state is 1 or 2, and depending on that, updates the value of state. The case 1 statement is missing a break, so when state == 1 the code goes to the if-else and then executes code within if state==1. Then the rest of the code within case state==2 is executed, which seems suspicious. My first guess was that the if state==1 piece is supposed to be within the code section of the case statement where state ==1, and then we add a break. However I just determined this does not work, so I am investigating what the likely correction is. It would be helpful to get the author's input as to the intended behavior.

image