Skip to content

Commit

Permalink
Revert "Used sigma = 2 for gaussian blur"
Browse files Browse the repository at this point in the history
This reverts commit ea62947.
  • Loading branch information
HongKee Moon committed Jun 17, 2022
1 parent d032218 commit af60784
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
15 changes: 1 addition & 14 deletions src/main/java/spim/algorithm/DefaultAntiDrift.java
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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)
{
Expand Down Expand Up @@ -60,16 +49,14 @@ 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:
if(stack == null) stack = new ImageStack( ip.getWidth(), ip.getHeight() );
stack.addSlice( copy );
break;
case PhaseCorrelation:
copy.blurGaussian( sigma );
latest.addXYSlice( copy );
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
}
Expand Down

0 comments on commit af60784

Please sign in to comment.