@@ -5,6 +5,7 @@ using RegisterQD.Images
55using RegisterQD. CoordinateTransformations
66using RegisterQD. Rotations
77using RegisterQD. RegisterMismatch
8+ using RegisterQD: _abs2
89using Random
910
1011# import BlockRegistration, RegisterOptimize
@@ -23,7 +24,7 @@ using Test, TestImages
2324 itp = interpolate(newfixed, BSpline(Linear()))
2425 etp = extrapolate(itp, NaN )
2526 fixed = etp(Base. axes(moving). .. ) # often the warped array has one-too-many pixels in one or more dimensions due to extrapolation
26- thresh = 0.1 * sum(abs2 .(fixed[.! (isnan.(fixed))]))
27+ thresh = 0.1 * sum(_abs2 .(fixed[.! (isnan.(fixed))]))
2728 mxshift = (10 ,10 )
2829
2930 tfm, mm = qd_translate(fixed, moving, mxshift; maxevals= 1000 , thresh= thresh, rtol= 0 )
@@ -41,7 +42,7 @@ using Test, TestImages
4142 itp = interpolate(newfixed, BSpline(Linear()))
4243 etp = extrapolate(itp, NaN )
4344 fixed = etp(axes(moving). .. ) # often the warped array has one-too-many pixels in one or more dimensions due to extrapolation
44- thresh = 0.1 * sum(abs2 .(fixed[.! (isnan.(fixed))]))
45+ thresh = 0.1 * sum(_abs2 .(fixed[.! (isnan.(fixed))]))
4546 mxshift = (5 ,5 ,5 )
4647
4748 tfm, mm = qd_translate(fixed, moving, mxshift; maxevals= 1000 , thresh= thresh, rtol= 0 )
@@ -56,7 +57,7 @@ using Test, TestImages
5657 itp = interpolate(newfixed, BSpline(Linear()))
5758 etp = extrapolate(itp, NaN )
5859 fixed = etp(axes(moving). .. ) # often the warped array has one-too-many pixels in one or more dimensions due to extrapolation
59- thresh = 0.1 * sum(abs2 .(fixed[.! (isnan.(fixed))]))
60+ thresh = 0.1 * sum(_abs2 .(fixed[.! (isnan.(fixed))]))
6061 mxshift = (10 ,10 )
6162 mxrot = pi / 90
6263 minwidth_rot = [0.0002 ]
@@ -73,7 +74,7 @@ using Test, TestImages
7374 itp = interpolate(newfixed, BSpline(Linear()))
7475 etp = extrapolate(itp, NaN )
7576 fixed = etp(axes(moving). .. ) # often the warped array has one-too-many pixels in one or more dimensions due to extrapolation
76- thresh = 0.1 * sum(abs2 .(fixed[.! (isnan.(fixed))]))
77+ thresh = 0.1 * sum(_abs2 .(fixed[.! (isnan.(fixed))]))
7778 mxshift = (5 ,5 ,5 )
7879 mxrot = [pi / 90 ; pi / 90 ; pi / 90 ]
7980 minwidth_rot = fill(0.0002 , 3 )
@@ -95,7 +96,7 @@ using Test, TestImages
9596 itp = interpolate(newfixed, BSpline(Linear()))
9697 etp = extrapolate(itp, NaN )
9798 fixed = etp(axes(moving). .. ) # often the warped array has one-too-many pixels in one or more dimensions due to extrapolation
98- thresh = 0.5 * sum(abs2 .(fixed[.! (isnan.(fixed))]))
99+ thresh = 0.5 * sum(_abs2 .(fixed[.! (isnan.(fixed))]))
99100 mxshift = (5 ,5 )
100101 SD = SDiagonal(@SVector(ones(ndims(fixed))))
101102
@@ -118,7 +119,7 @@ using Test, TestImages
118119 # inds = intersect.(axes(moving), axes(newfixed))
119120 # fixed = newfixed[inds...]
120121 # moving = moving[inds...]
121- # thresh = 0.1 * (sum(abs2 .(fixed[.!(isnan.(fixed))]))+sum(abs2 .(moving[.!(isnan.(moving))])));
122+ # thresh = 0.1 * (sum(_abs2 .(fixed[.!(isnan.(fixed))]))+sum(_abs2 .(moving[.!(isnan.(moving))])));
122123 # mxshift = (10,10,10)
123124 # SD = eye(ndims(fixed));
124125
@@ -141,7 +142,7 @@ using Test, TestImages
141142 # inds = intersect.(axes(moving), axes(newfixed))
142143 # fixed = newfixed[inds...]
143144 # moving = moving[inds...]
144- # thresh = 0.5 * sum(abs2 .(fixed[.!(isnan.(fixed))]));
145+ # thresh = 0.5 * sum(_abs2 .(fixed[.!(isnan.(fixed))]));
145146 # mxshift = (5,5,5)
146147 # SD = eye(ndims(fixed));
147148 # @test RegisterOptimize.aff(vcat(tfm00.translation[:], tfm00.linear[:]), fixed, SD) == tfm0
0 commit comments