From 5bbe81e2f9d24fc0cf59188830d4d592c78b81a7 Mon Sep 17 00:00:00 2001 From: Eugene Katrukha Date: Tue, 23 Apr 2024 16:24:57 +0200 Subject: [PATCH] zero iterations case --- pom.xml | 2 +- .../java/averagingND/IterativeAveraging.java | 23 ++++++++++++++----- src/main/java/averagingND/MiscUtils.java | 1 + .../java/averagingND/RegisterSingleND.java | 4 ++-- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index bbbf399..cd12e75 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ nl.uu.science.cellbiology AveragingND - 0.0.4-SNAPSHOT + 0.1.0-SNAPSHOT AveragingND Averaging of ND images using normalized cross-correlation. diff --git a/src/main/java/averagingND/IterativeAveraging.java b/src/main/java/averagingND/IterativeAveraging.java index 339bf28..cd798aa 100644 --- a/src/main/java/averagingND/IterativeAveraging.java +++ b/src/main/java/averagingND/IterativeAveraging.java @@ -301,7 +301,7 @@ public void run(String paramString) { sumAndCount = AverageWithoutZero.sumAndCountArray(imgs_shift); IntervalView currAverageImg; - if(bIntermediateAverage) + if(bIntermediateAverage && nIterN>0) { processIntermediate(0); } @@ -341,9 +341,21 @@ public void run(String paramString) { maxAverCCshifts.add(new long[nDimReg]); } + //initial iteration + int iterBeg = 0; + //for zero iterations we want to do one without shifts + if(nIterN == 0) + { + iterBeg=-1; + lim_fractions = null; + limInterval = new FinalInterval(new long [nDimReg], new long [nDimReg]); + //no need to save, since they are the same + bOutputInput = false; + } + long iterStartT, iterEndT; - for(iter=0;(iter & Type< T > > T computeMaxLocation( // initialize min and max with the first image value T type = cursor.next(); T max = type.copy(); + maxLocation.setPosition( cursor ); // loop over the rest of the data and determine min and max value while ( cursor.hasNext() ) diff --git a/src/main/java/averagingND/RegisterSingleND.java b/src/main/java/averagingND/RegisterSingleND.java index 27652cd..0e9a817 100644 --- a/src/main/java/averagingND/RegisterSingleND.java +++ b/src/main/java/averagingND/RegisterSingleND.java @@ -359,8 +359,8 @@ public static void main( final String[] args ) throws ImgIOException, Incompatib //IJ.open("/home/eugene/Desktop/projects/RegisterNDFFT/4d/HyperStack.tif"); //IJ.open("/home/eugene/Desktop/projects/RegisterNDFFT/4d/HyperStack-1.tif"); - IJ.open("/home/eugene/Desktop/projects/RegisterNDFFT/centered/full.tif"); - IJ.open("/home/eugene/Desktop/projects/RegisterNDFFT/centered/center.tif"); + IJ.open("/home/eugene/Desktop/projects/RegisterNDFFT/center/full.tif"); + IJ.open("/home/eugene/Desktop/projects/RegisterNDFFT/center/center.tif"); RegisterSingleND test = new RegisterSingleND();