Loading src/main/java/com/elphel/imagej/cuas/CuasMotion.java +186 −179 Original line number Diff line number Diff line Loading @@ -2674,6 +2674,7 @@ public class CuasMotion { double k = Math.PI/2/(half_range_boosted + 0.5); for (int i = 1; i <= half_range_boosted; i ++) { window_full[half_range_boosted + i] = smooth ? (Math.cos(i*k)):1.0; window_full[half_range_boosted - i] = smooth ? (Math.cos(i*k)):1.0; // By Claude on 05/11/2026 s0+=2 * window_full[half_range_boosted + i]; } for (int i = 0; i < window_full.length; i ++) { Loading Loading @@ -2754,7 +2755,7 @@ public class CuasMotion { // may be faster if process only where vector_field[nseq][ntile] is not null for (int nSeq = ai.getAndIncrement(); nSeq < frames_accum.length; nSeq = ai.getAndIncrement()) { for (int i = 0; i < frames_accum[nSeq].length; i++) { frames_accum[nSeq][i] *=-1; frames_accum[nSeq][i] *=-0.625; // By Claude on 05/11/2026: restore pre-fix amplitude (window fix doubled it) if (zero_fill && Double.isNaN(frames_accum[nSeq][i])){ frames_accum[nSeq][i] = 0f; } Loading Loading @@ -8242,6 +8243,9 @@ public class CuasMotion { cuasMotion.tilesX); // int tilesX) { parentCLT.saveImagePlusInModelDirectory(imp_ext); } // double [][][][] targets_new_multi = null; int num_new = 0; { // perform new accumulations of shifted non-conflicting tiles float [][] fpixels_accumulated = cuasMotion.shiftAndRenderAccumulate( clt_parameters, // CLTParameters clt_parameters, Loading Loading @@ -8351,7 +8355,6 @@ public class CuasMotion { } parentCLT.saveImagePlusInModelDirectory(imp_acc); // ImagePlus imp) } // no need to to evaluate scores now - can be done all at once when all non-centered will be replaced by centered, removed (almost) duplicates // evaluating scores, but it is not needed // new results are sorted by decreasing amplitude, there should be only one - test it. If not still use only the first Loading Loading @@ -8424,7 +8427,8 @@ public class CuasMotion { parentCLT.saveImagePlusInModelDirectory(imp_new_scores); // ImagePlus imp) } int num_new = addNewResults( //int num_new += addNewResults( target_sequence_multi, // final double [][][] target_sequence, // will only process non-nulls here targets_new_multi, // final double [][][] new_sequence, // add just one best here? Loading @@ -8435,6 +8439,9 @@ public class CuasMotion { if (debugLevel > -4) { System.out.println("Added "+num_new+" new tiles as good/bad at iteration "+niter+"."); } } if (save_filtered_low) { String title = model_prefix+"-ADDED_NEW_CENTERED_MULTI-n"+niter; if (boost_accum_pairs > 1.0) { Loading Loading
src/main/java/com/elphel/imagej/cuas/CuasMotion.java +186 −179 Original line number Diff line number Diff line Loading @@ -2674,6 +2674,7 @@ public class CuasMotion { double k = Math.PI/2/(half_range_boosted + 0.5); for (int i = 1; i <= half_range_boosted; i ++) { window_full[half_range_boosted + i] = smooth ? (Math.cos(i*k)):1.0; window_full[half_range_boosted - i] = smooth ? (Math.cos(i*k)):1.0; // By Claude on 05/11/2026 s0+=2 * window_full[half_range_boosted + i]; } for (int i = 0; i < window_full.length; i ++) { Loading Loading @@ -2754,7 +2755,7 @@ public class CuasMotion { // may be faster if process only where vector_field[nseq][ntile] is not null for (int nSeq = ai.getAndIncrement(); nSeq < frames_accum.length; nSeq = ai.getAndIncrement()) { for (int i = 0; i < frames_accum[nSeq].length; i++) { frames_accum[nSeq][i] *=-1; frames_accum[nSeq][i] *=-0.625; // By Claude on 05/11/2026: restore pre-fix amplitude (window fix doubled it) if (zero_fill && Double.isNaN(frames_accum[nSeq][i])){ frames_accum[nSeq][i] = 0f; } Loading Loading @@ -8242,6 +8243,9 @@ public class CuasMotion { cuasMotion.tilesX); // int tilesX) { parentCLT.saveImagePlusInModelDirectory(imp_ext); } // double [][][][] targets_new_multi = null; int num_new = 0; { // perform new accumulations of shifted non-conflicting tiles float [][] fpixels_accumulated = cuasMotion.shiftAndRenderAccumulate( clt_parameters, // CLTParameters clt_parameters, Loading Loading @@ -8351,7 +8355,6 @@ public class CuasMotion { } parentCLT.saveImagePlusInModelDirectory(imp_acc); // ImagePlus imp) } // no need to to evaluate scores now - can be done all at once when all non-centered will be replaced by centered, removed (almost) duplicates // evaluating scores, but it is not needed // new results are sorted by decreasing amplitude, there should be only one - test it. If not still use only the first Loading Loading @@ -8424,7 +8427,8 @@ public class CuasMotion { parentCLT.saveImagePlusInModelDirectory(imp_new_scores); // ImagePlus imp) } int num_new = addNewResults( //int num_new += addNewResults( target_sequence_multi, // final double [][][] target_sequence, // will only process non-nulls here targets_new_multi, // final double [][][] new_sequence, // add just one best here? Loading @@ -8435,6 +8439,9 @@ public class CuasMotion { if (debugLevel > -4) { System.out.println("Added "+num_new+" new tiles as good/bad at iteration "+niter+"."); } } if (save_filtered_low) { String title = model_prefix+"-ADDED_NEW_CENTERED_MULTI-n"+niter; if (boost_accum_pairs > 1.0) { Loading