Commit c09cca3b authored by Andrey Filippov's avatar Andrey Filippov

Starting dual-boost centered processing

parent a86749dc
...@@ -2674,6 +2674,7 @@ public class CuasMotion { ...@@ -2674,6 +2674,7 @@ public class CuasMotion {
double k = Math.PI/2/(half_range_boosted + 0.5); double k = Math.PI/2/(half_range_boosted + 0.5);
for (int i = 1; i <= half_range_boosted; i ++) { 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;
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]; s0+=2 * window_full[half_range_boosted + i];
} }
for (int i = 0; i < window_full.length; i ++) { for (int i = 0; i < window_full.length; i ++) {
...@@ -2754,7 +2755,7 @@ public class CuasMotion { ...@@ -2754,7 +2755,7 @@ public class CuasMotion {
// may be faster if process only where vector_field[nseq][ntile] is not null // 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 nSeq = ai.getAndIncrement(); nSeq < frames_accum.length; nSeq = ai.getAndIncrement()) {
for (int i = 0; i < frames_accum[nSeq].length; i++) { 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])){ if (zero_fill && Double.isNaN(frames_accum[nSeq][i])){
frames_accum[nSeq][i] = 0f; frames_accum[nSeq][i] = 0f;
} }
...@@ -8242,6 +8243,9 @@ public class CuasMotion { ...@@ -8242,6 +8243,9 @@ public class CuasMotion {
cuasMotion.tilesX); // int tilesX) { cuasMotion.tilesX); // int tilesX) {
parentCLT.saveImagePlusInModelDirectory(imp_ext); parentCLT.saveImagePlusInModelDirectory(imp_ext);
} }
// double [][][][] targets_new_multi = null;
int num_new = 0;
{
// perform new accumulations of shifted non-conflicting tiles // perform new accumulations of shifted non-conflicting tiles
float [][] fpixels_accumulated = cuasMotion.shiftAndRenderAccumulate( float [][] fpixels_accumulated = cuasMotion.shiftAndRenderAccumulate(
clt_parameters, // CLTParameters clt_parameters, clt_parameters, // CLTParameters clt_parameters,
...@@ -8351,7 +8355,6 @@ public class CuasMotion { ...@@ -8351,7 +8355,6 @@ public class CuasMotion {
} }
parentCLT.saveImagePlusInModelDirectory(imp_acc); // ImagePlus imp) 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 // 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 // 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 // new results are sorted by decreasing amplitude, there should be only one - test it. If not still use only the first
...@@ -8424,7 +8427,8 @@ public class CuasMotion { ...@@ -8424,7 +8427,8 @@ public class CuasMotion {
parentCLT.saveImagePlusInModelDirectory(imp_new_scores); // ImagePlus imp) 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 target_sequence_multi, // final double [][][] target_sequence, // will only process non-nulls here
targets_new_multi, // final double [][][] new_sequence, targets_new_multi, // final double [][][] new_sequence,
// add just one best here? // add just one best here?
...@@ -8435,6 +8439,9 @@ public class CuasMotion { ...@@ -8435,6 +8439,9 @@ public class CuasMotion {
if (debugLevel > -4) { if (debugLevel > -4) {
System.out.println("Added "+num_new+" new tiles as good/bad at iteration "+niter+"."); System.out.println("Added "+num_new+" new tiles as good/bad at iteration "+niter+".");
} }
}
if (save_filtered_low) { if (save_filtered_low) {
String title = model_prefix+"-ADDED_NEW_CENTERED_MULTI-n"+niter; String title = model_prefix+"-ADDED_NEW_CENTERED_MULTI-n"+niter;
if (boost_accum_pairs > 1.0) { if (boost_accum_pairs > 1.0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment