From af607841dfbb84590290d50b0f3160af65365ad8 Mon Sep 17 00:00:00 2001 From: HongKee Moon Date: Fri, 6 May 2022 15:36:59 +0200 Subject: [PATCH] Revert "Used sigma = 2 for gaussian blur" This reverts commit ea6294787cb71769fe2738269fc8819954781546. --- .../java/spim/algorithm/DefaultAntiDrift.java | 15 +-------------- .../ui/view/component/MMAcquisitionEngine.java | 2 +- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/main/java/spim/algorithm/DefaultAntiDrift.java b/src/main/java/spim/algorithm/DefaultAntiDrift.java index bf984d53..476d0fad 100644 --- a/src/main/java/spim/algorithm/DefaultAntiDrift.java +++ b/src/main/java/spim/algorithm/DefaultAntiDrift.java @@ -1,9 +1,6 @@ package spim.algorithm; import ij.ImageStack; -import ij.plugin.filter.Convolver; -import ij.plugin.filter.GaussianBlur; -import ij.plugin.filter.RankFilters; import ij.process.*; import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; @@ -21,14 +18,6 @@ public class DefaultAntiDrift extends AbstractAntiDrift */ private final double sigma; private final AntiDrift.Type type; - private final GaussianBlur gaussianBlur = new GaussianBlur(); - private final Convolver convolver = new Convolver(); - private final RankFilters filters = new RankFilters(); - private final float[] kernel = new float[]{-1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, - -1, -1, 24, -1, -1, - -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1,}; public DefaultAntiDrift(double sigmaValue) { @@ -60,9 +49,6 @@ public void reset() @Override public void addXYSlice( ImageProcessor ip ) { ImageProcessor copy = ip.duplicate(); - gaussianBlur.blurGaussian( copy, sigma ); - convolver.convolve( copy, kernel, 5, 5 ); - filters.rank( copy, 2, 2 ); switch (type) { case CenterOfMass: @@ -70,6 +56,7 @@ public void reset() stack.addSlice( copy ); break; case PhaseCorrelation: + copy.blurGaussian( sigma ); latest.addXYSlice( copy ); break; } diff --git a/src/main/java/spim/ui/view/component/MMAcquisitionEngine.java b/src/main/java/spim/ui/view/component/MMAcquisitionEngine.java index 24fc7c86..18dc1e17 100644 --- a/src/main/java/spim/ui/view/component/MMAcquisitionEngine.java +++ b/src/main/java/spim/ui/view/component/MMAcquisitionEngine.java @@ -381,7 +381,7 @@ private void runNormalSmartImagingMMAcq(SPIMSetup setup, final Studio frame, Dat if(toogleGroupValue.equals("Centre of mass")) { driftCompMap.put(positionItem, new DefaultAntiDrift()); } else if(toogleGroupValue.equals("Phase correlation")) { - driftCompMap.put(positionItem, new DefaultAntiDrift(2)); + driftCompMap.put(positionItem, new DefaultAntiDrift(10)); } } }