1
1
package spim .algorithm ;
2
2
3
3
import ij .ImageStack ;
4
- import ij .plugin .filter .Convolver ;
5
- import ij .plugin .filter .GaussianBlur ;
6
- import ij .plugin .filter .RankFilters ;
7
4
import ij .process .*;
8
5
import org .apache .commons .math3 .geometry .euclidean .threed .Vector3D ;
9
6
@@ -21,14 +18,6 @@ public class DefaultAntiDrift extends AbstractAntiDrift
21
18
*/
22
19
private final double sigma ;
23
20
private final AntiDrift .Type type ;
24
- private final GaussianBlur gaussianBlur = new GaussianBlur ();
25
- private final Convolver convolver = new Convolver ();
26
- private final RankFilters filters = new RankFilters ();
27
- private final float [] kernel = new float []{-1 , -1 , -1 , -1 , -1 ,
28
- -1 , -1 , -1 , -1 , -1 ,
29
- -1 , -1 , 24 , -1 , -1 ,
30
- -1 , -1 , -1 , -1 , -1 ,
31
- -1 , -1 , -1 , -1 , -1 ,};
32
21
33
22
public DefaultAntiDrift (double sigmaValue )
34
23
{
@@ -60,16 +49,14 @@ public void reset()
60
49
@ Override public void addXYSlice ( ImageProcessor ip )
61
50
{
62
51
ImageProcessor copy = ip .duplicate ();
63
- gaussianBlur .blurGaussian ( copy , sigma );
64
- convolver .convolve ( copy , kernel , 5 , 5 );
65
- filters .rank ( copy , 2 , 2 );
66
52
67
53
switch (type ) {
68
54
case CenterOfMass :
69
55
if (stack == null ) stack = new ImageStack ( ip .getWidth (), ip .getHeight () );
70
56
stack .addSlice ( copy );
71
57
break ;
72
58
case PhaseCorrelation :
59
+ copy .blurGaussian ( sigma );
73
60
latest .addXYSlice ( copy );
74
61
break ;
75
62
}
0 commit comments