Commit c9316c55 authored by Andrey Filippov's avatar Andrey Filippov
Browse files

Tested code that Claude fixed, minor additional fix. Still not fully

operational because of filter5Targets().
parent 4b7711ef
Loading
Loading
Loading
Loading
+19 −3
Original line number Diff line number Diff line
@@ -8400,13 +8400,14 @@ public class CuasMotion {
					filter5);                 // boolean [][] filter5)
			
			// Anything remains? we'll see after extension
			/*
			double [][][] extended_scan = extendMotionScan(
					targets_nonoverlap, // final double [][][] motion_scan,
					null, // filter5,      // final boolean [][]  filtered, // centers, should be non-overlapped
					cuasMotion.tilesX,    // final int           tilesX)
					2,                    // final int           range, // 1 or 2
					null); // remain);              // final int     []    remain)

			 */
			if (save_filtered_low  && debug_more) {
				// targets_nonoverlap will contain motion vectors used fro the next fpixels_accumulated
				ImagePlus imp_novl = showTargetSequence(
@@ -8416,7 +8417,7 @@ public class CuasMotion {
						!batch_mode,          // boolean       show,
						cuasMotion.tilesX);   //  int           tilesX) {
				parentCLT.saveImagePlusInModelDirectory(imp_novl);

/*
				ImagePlus imp_ext = showTargetSequence(
						extended_scan,          // double [][][] vector_fields_sequence,
						slice_titles,         // String []     titles, // all slices*frames titles or just slice titles or null
@@ -8425,6 +8426,7 @@ public class CuasMotion {
						cuasMotion.tilesX);   //  int           tilesX) {
				parentCLT.saveImagePlusInModelDirectory(imp_ext);
				// show good and bad accumulated here too?
*/
			}

			// Andrey 05/05/2026 moved here (earlier) so shiftAndRenderAccumulate() will use updated motion vector
@@ -8446,7 +8448,21 @@ public class CuasMotion {
						corr_offset,         // int             corr_offset,
						debugLevel);         // int             debugLevel)
			}
			
			double [][][] extended_scan = extendMotionScan(
					targets_nonoverlap, // final double [][][] motion_scan,
					null, // filter5,      // final boolean [][]  filtered, // centers, should be non-overlapped
					cuasMotion.tilesX,    // final int           tilesX)
					2,                    // final int           range, // 1 or 2
					null); // remain);              // final int     []    remain)
			if (save_filtered_low  && debug_more) {
				ImagePlus imp_ext = showTargetSequence(
						extended_scan,          // double [][][] vector_fields_sequence,
						slice_titles,         // String []     titles, // all slices*frames titles or just slice titles or null
						model_prefix+"-EXTENDED-CENTERED-n"+niter,// String        title,
						!batch_mode,          // boolean       show,
						cuasMotion.tilesX);   //  int           tilesX) {
				parentCLT.saveImagePlusInModelDirectory(imp_ext);
			}
			// perform new accumulations of shifted non-conflicting tiles
			float [][] fpixels_accumulated = cuasMotion.shiftAndRenderAccumulate(
					clt_parameters,   // CLTParameters       clt_parameters,