Commit 643c20b0 authored by Andrey Filippov's avatar Andrey Filippov

CLAUDE: Add cuas_reuse_non_centered and cuas_reuse_centered config parameters

Replaces hardcoded `boolean reuse_non_centered = true` with a config parameter.
Adds a companion `cuas_reuse_centered` parameter: when true, attempts to load
ROUND_TWO_GOOD before starting computation and returns early if found, bypassing
both phases. Both default to true — missing files behave as if set to false.
Wired into dialog, properties (.corr-xml), and copy() in IntersceneMatchParameters.
Co-authored-by: 's avatarClaude <claude@elphel.com>
parent 9a4d969e
...@@ -8054,7 +8054,7 @@ public class CuasMotion { ...@@ -8054,7 +8054,7 @@ public class CuasMotion {
System.out.println("testCuasScanMotion(): wrong format for a pair of strength, fraction values."); System.out.println("testCuasScanMotion(): wrong format for a pair of strength, fraction values.");
} }
} }
boolean reuse_non_centered = true; // make a parameter boolean reuse_non_centered = clt_parameters.imp.cuas_reuse_non_centered; // By Claude on 05/24/2026
...@@ -8075,6 +8075,20 @@ public class CuasMotion { ...@@ -8075,6 +8075,20 @@ public class CuasMotion {
int [] passes = new int [num_corr_samples]; // debugging filter5 int [] passes = new int [num_corr_samples]; // debugging filter5
String model_prefix = parentCLT.getImageName()+getParametersSuffix(clt_parameters,null)+(cuasMotion.slow_targets? "-SLOW":"-FAST"); String model_prefix = parentCLT.getImageName()+getParametersSuffix(clt_parameters,null)+(cuasMotion.slow_targets? "-SLOW":"-FAST");
if (clt_parameters.imp.cuas_reuse_centered) { // By Claude on 05/24/2026
String x3d_path = parentCLT.getX3dDirectory();
String centered_path = x3d_path + Prefs.getFileSeparator() + model_prefix+"-ROUND_TWO_GOOD"+".tiff";
double [][][][] target_sequence_centered = readDoubleHyperHyperstack(centered_path);
if (target_sequence_centered != null) {
if (debugLevel > -4) {
System.out.println("locateAndFreezeTargetsMulti(): reusing phase 2 (centered) data from "+centered_path+", bypassing both phases.");
}
return target_sequence_centered; // bypass both phases // By Claude on 05/24/2026
} else if (debugLevel > -4) {
System.out.println("locateAndFreezeTargetsMulti(): phase 2 (centered) data not found: "+centered_path+", will compute.");
}
} // By Claude on 05/24/2026
// final double [][][][] target_sequence_multi = null; // final double [][][][] target_sequence_multi = null;
double [][][][] target_sequence_multi = null; double [][][][] target_sequence_multi = null;
int niter=0; // maybe start from 19 to match skipped non-center and have the same file names int niter=0; // maybe start from 19 to match skipped non-center and have the same file names
......
...@@ -909,6 +909,8 @@ min_str_neib_fpn 0.35 ...@@ -909,6 +909,8 @@ min_str_neib_fpn 0.35
public double cuas_lma_mink = 0.0; // Minimal K (overshoot) = 0.0 (<0.007) public double cuas_lma_mink = 0.0; // Minimal K (overshoot) = 0.0 (<0.007)
public double cuas_lma_maxk = 5.0; // Maximal K (overshoot) = 5.0 (>3.8) public double cuas_lma_maxk = 5.0; // Maximal K (overshoot) = 5.0 (>3.8)
public double cuas_lma_a2a = 0.5; // Minimal ratio of the maximal pixel to the amplitude public double cuas_lma_a2a = 0.5; // Minimal ratio of the maximal pixel to the amplitude
public boolean cuas_reuse_non_centered = true; // try to read phase 1 (non-centered) results from file // By Claude on 05/24/2026
public boolean cuas_reuse_centered = true; // try to read phase 2 (centered) results from file, bypass both phases // By Claude on 05/24/2026
public boolean cuas_slow_en = true; // enable slow (almost static) target detection // verify temporal offset with fast public boolean cuas_slow_en = true; // enable slow (almost static) target detection // verify temporal offset with fast
...@@ -2934,7 +2936,10 @@ min_str_neib_fpn 0.35 ...@@ -2934,7 +2936,10 @@ min_str_neib_fpn 0.35
"Minimal ratio of the maximal pixel near fitted maximum to the LMA amplitude."); "Minimal ratio of the maximal pixel near fitted maximum to the LMA amplitude.");
gd.addMessage("=== Reuse already calculated targets ==="); gd.addMessage("=== Reuse already calculated targets ===");
gd.addCheckbox ("Reuse phase 1 (non-centered) targets", this.cuas_reuse_non_centered, // By Claude on 05/24/2026
"Try to read previously saved phase 1 results (ROUND_ONE file) and skip non-centered computation.");
gd.addCheckbox ("Reuse phase 2 (centered) targets", this.cuas_reuse_centered, // By Claude on 05/24/2026
"Try to read previously saved phase 2 results (ROUND_TWO_GOOD file) and bypass both phases.");
gd.addMessage("=== Slow targets detection ==="); gd.addMessage("=== Slow targets detection ===");
gd.addCheckbox ("Enable slow targets detection", this.cuas_slow_en, gd.addCheckbox ("Enable slow targets detection", this.cuas_slow_en,
...@@ -4547,6 +4552,8 @@ min_str_neib_fpn 0.35 ...@@ -4547,6 +4552,8 @@ min_str_neib_fpn 0.35
this.cuas_lma_mink = gd.getNextNumber(); this.cuas_lma_mink = gd.getNextNumber();
this.cuas_lma_maxk = gd.getNextNumber(); this.cuas_lma_maxk = gd.getNextNumber();
this.cuas_lma_a2a = gd.getNextNumber(); this.cuas_lma_a2a = gd.getNextNumber();
this.cuas_reuse_non_centered = gd.getNextBoolean(); // By Claude on 05/24/2026
this.cuas_reuse_centered = gd.getNextBoolean(); // By Claude on 05/24/2026
this.cuas_slow_en = gd.getNextBoolean(); this.cuas_slow_en = gd.getNextBoolean();
this.cuas_slow_ra = gd.getNextNumber(); this.cuas_slow_ra = gd.getNextNumber();
...@@ -5872,6 +5879,8 @@ min_str_neib_fpn 0.35 ...@@ -5872,6 +5879,8 @@ min_str_neib_fpn 0.35
properties.setProperty(prefix+"cuas_lma_mink", this.cuas_lma_mink+""); // double properties.setProperty(prefix+"cuas_lma_mink", this.cuas_lma_mink+""); // double
properties.setProperty(prefix+"cuas_lma_maxk", this.cuas_lma_maxk+""); // double properties.setProperty(prefix+"cuas_lma_maxk", this.cuas_lma_maxk+""); // double
properties.setProperty(prefix+"cuas_lma_a2a", this.cuas_lma_a2a+""); // double properties.setProperty(prefix+"cuas_lma_a2a", this.cuas_lma_a2a+""); // double
properties.setProperty(prefix+"cuas_reuse_non_centered", this.cuas_reuse_non_centered+""); // boolean // By Claude on 05/24/2026
properties.setProperty(prefix+"cuas_reuse_centered", this.cuas_reuse_centered+""); // boolean // By Claude on 05/24/2026
properties.setProperty(prefix+"cuas_slow_en", this.cuas_slow_en+""); // boolean properties.setProperty(prefix+"cuas_slow_en", this.cuas_slow_en+""); // boolean
properties.setProperty(prefix+"cuas_slow_ra", this.cuas_slow_ra+""); // double properties.setProperty(prefix+"cuas_slow_ra", this.cuas_slow_ra+""); // double
...@@ -7139,6 +7148,8 @@ min_str_neib_fpn 0.35 ...@@ -7139,6 +7148,8 @@ min_str_neib_fpn 0.35
if (properties.getProperty(prefix+"cuas_lma_mink")!=null) this.cuas_lma_mink=Double.parseDouble(properties.getProperty(prefix+"cuas_lma_mink")); if (properties.getProperty(prefix+"cuas_lma_mink")!=null) this.cuas_lma_mink=Double.parseDouble(properties.getProperty(prefix+"cuas_lma_mink"));
if (properties.getProperty(prefix+"cuas_lma_maxk")!=null) this.cuas_lma_maxk=Double.parseDouble(properties.getProperty(prefix+"cuas_lma_maxk")); if (properties.getProperty(prefix+"cuas_lma_maxk")!=null) this.cuas_lma_maxk=Double.parseDouble(properties.getProperty(prefix+"cuas_lma_maxk"));
if (properties.getProperty(prefix+"cuas_lma_a2a")!=null) this.cuas_lma_a2a=Double.parseDouble(properties.getProperty(prefix+"cuas_lma_a2a")); if (properties.getProperty(prefix+"cuas_lma_a2a")!=null) this.cuas_lma_a2a=Double.parseDouble(properties.getProperty(prefix+"cuas_lma_a2a"));
if (properties.getProperty(prefix+"cuas_reuse_non_centered")!=null) this.cuas_reuse_non_centered=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_reuse_non_centered")); // By Claude on 05/24/2026
if (properties.getProperty(prefix+"cuas_reuse_centered")!=null) this.cuas_reuse_centered=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_reuse_centered")); // By Claude on 05/24/2026
if (properties.getProperty(prefix+"cuas_slow_en")!=null) this.cuas_slow_en=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_slow_en")); if (properties.getProperty(prefix+"cuas_slow_en")!=null) this.cuas_slow_en=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_slow_en"));
if (properties.getProperty(prefix+"cuas_slow_ra")!=null) this.cuas_slow_ra=Double.parseDouble(properties.getProperty(prefix+"cuas_slow_ra")); if (properties.getProperty(prefix+"cuas_slow_ra")!=null) this.cuas_slow_ra=Double.parseDouble(properties.getProperty(prefix+"cuas_slow_ra"));
...@@ -8419,6 +8430,8 @@ min_str_neib_fpn 0.35 ...@@ -8419,6 +8430,8 @@ min_str_neib_fpn 0.35
imp.cuas_lma_mink = this.cuas_lma_mink; imp.cuas_lma_mink = this.cuas_lma_mink;
imp.cuas_lma_maxk = this.cuas_lma_maxk; imp.cuas_lma_maxk = this.cuas_lma_maxk;
imp.cuas_lma_a2a = this.cuas_lma_a2a; imp.cuas_lma_a2a = this.cuas_lma_a2a;
imp.cuas_reuse_non_centered = this.cuas_reuse_non_centered; // By Claude on 05/24/2026
imp.cuas_reuse_centered = this.cuas_reuse_centered; // By Claude on 05/24/2026
imp.cuas_slow_en = this.cuas_slow_en; imp.cuas_slow_en = this.cuas_slow_en;
imp.cuas_slow_ra = this.cuas_slow_ra; imp.cuas_slow_ra = this.cuas_slow_ra;
......
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