Skip to content

Commit 28c4a44

Browse files
committed
Normalize spaces in two files
No functional consequence.
1 parent 86eb2c5 commit 28c4a44

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

test/initial_tfm.jl

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ EYE =Matrix(1.0*I, 3,3)
2828

2929
# insufficient parameters + no initiat_tfm causes large misalignment
3030

31-
tformtest1, mm1 = qd_rigid(testimage2, testimage1, mxshift, mxrot; print_interval=typemax(Int)) #
31+
tformtest1, mm1 = qd_rigid(testimage2, testimage1, mxshift, mxrot; print_interval=typemax(Int)) #
3232
@test !(mm1 < 1e-8)
3333
@test !isapprox(tformtest1, mytform, atol = 0.1)
3434

3535
#initial_tfm improves alignment
3636

37-
tformtest2, mm2 = qd_rigid(testimage2, testimage1, mxshift, mxrot; print_interval=typemax(Int), initial_tfm = mytform) #
37+
tformtest2, mm2 = qd_rigid(testimage2, testimage1, mxshift, mxrot; print_interval=typemax(Int), initial_tfm = mytform) #
3838
#with the initial_tfm being the true tfm, this should give back the true rotation
3939

4040
@test mm2 < 1e-8
@@ -60,13 +60,13 @@ end #Test initial_tfm improves rotational alignment for rigid
6060

6161
#no initial_tfm should fail due to total lack of overlap
6262
@test try
63-
tformtest3, mm3 = qd_rigid(testimage3, testimage4, mxshift, mxrot; print_interval=typemax(Int)) #
63+
tformtest3, mm3 = qd_rigid(testimage3, testimage4, mxshift, mxrot; print_interval=typemax(Int)) #
6464
false
6565
catch err
6666
true # this should break
6767
end
6868

69-
tformtest4, mm4 = qd_rigid(testimage3, testimage4, mxshift, mxrot; print_interval=typemax(Int), initial_tfm = init_tfm) #
69+
tformtest4, mm4 = qd_rigid(testimage3, testimage4, mxshift, mxrot; print_interval=typemax(Int), initial_tfm = init_tfm) #
7070

7171
@test mm4 < 1e-8 #this mismatch should be lower!
7272
@test isapprox(tformtest4.translation, [0, 10, 0])
@@ -89,18 +89,18 @@ end
8989

9090
# tests with equal spaces produces real rotations
9191
# TODO: the next test is machine-dependent, figure out why
92-
tformtest0, mm0 = qd_rigid(testimage2, testimage1, mxshift, mxrot2; fvalue=1e-5, rtol=0, print_interval=typemax(Int))
92+
tformtest0, mm0 = qd_rigid(testimage2, testimage1, mxshift, mxrot2; fvalue=1e-5, rtol=0, print_interval=typemax(Int))
9393

9494
@test mm0 < 1e-5
9595
@test isapprox(tformtest0, mytform, atol = 0.1)
9696
@test isrotation(tformtest0.linear)
9797

98-
tformtest01, mm01 = RegisterQD.qd_rigid_coarse(testimage2, testimage1, mxshift, [mxrot2...], minwidth_rot; SD=EYE, print_interval=typemax(Int))
98+
tformtest01, mm01 = RegisterQD.qd_rigid_coarse(testimage2, testimage1, mxshift, [mxrot2...], minwidth_rot; SD=EYE, print_interval=typemax(Int))
9999
@test isrotation(tformtest01.linear)
100100

101101
tformtest02 = nothing
102102
mm02 = nothing
103-
tformtest02, mm02 = RegisterQD.qd_rigid_fine(testimage2, testimage1, [mxrot2...]./2, minwidth_rot; SD=EYE, print_interval=typemax(Int))
103+
tformtest02, mm02 = RegisterQD.qd_rigid_fine(testimage2, testimage1, [mxrot2...]./2, minwidth_rot; SD=EYE, print_interval=typemax(Int))
104104
@test isrotation(tformtest02.linear)
105105

106106
#with skewed spacing produces real rotations.
@@ -109,50 +109,50 @@ end
109109
ps = (1, 1, 2)
110110
SD =SArray{Tuple{3,3}}(Diagonal(SVector(ps) ./ minimum(ps)))
111111

112-
tformtest5, mm5 = qd_rigid(testimage6, testimage5, mxshift, mxrot2; SD=SD, print_interval=typemax(Int))
112+
tformtest5, mm5 = qd_rigid(testimage6, testimage5, mxshift, mxrot2; SD=SD, print_interval=typemax(Int))
113113
@test mm5 <1e-4
114114
@test isapprox(tformtest5, mytform, atol = 1)
115115
@test isrotation(tformtest5.linear)
116116
@test !isrotation(SD*tformtest5.linear*inv(SD))
117117

118-
tformtest55, mm55 = qd_rigid(testimage6, testimage5, mxshift, mxrot2; SD=SD, print_interval=typemax(Int), initial_tfm = tformtest5)
118+
tformtest55, mm55 = qd_rigid(testimage6, testimage5, mxshift, mxrot2; SD=SD, print_interval=typemax(Int), initial_tfm = tformtest5)
119119
@test mm55 <1e-4
120120
@test isapprox(tformtest55, mytform, atol = 1)
121121
@test isrotation(tformtest55.linear)
122122
@test !isrotation(SD*tformtest55.linear*inv(SD))
123123

124124

125125
#coarse and fine produce real rotations
126-
tformtest6, mm6 = RegisterQD.qd_rigid_coarse(testimage6, testimage5, mxshift, mxrot2, minwidth_rot; SD=SD, print_interval=typemax(Int))
126+
tformtest6, mm6 = RegisterQD.qd_rigid_coarse(testimage6, testimage5, mxshift, mxrot2, minwidth_rot; SD=SD, print_interval=typemax(Int))
127127
@test mm6 <1e-4
128128
@test isrotation(tformtest6.linear)
129129
@test !isrotation(SD*tformtest6.linear*inv(SD))
130130

131-
tformtest66, mm66 = RegisterQD.qd_rigid_coarse(testimage6, testimage5, mxshift, mxrot2, minwidth_rot; SD=SD, print_interval=typemax(Int), initial_tfm = tformtest6)
131+
tformtest66, mm66 = RegisterQD.qd_rigid_coarse(testimage6, testimage5, mxshift, mxrot2, minwidth_rot; SD=SD, print_interval=typemax(Int), initial_tfm = tformtest6)
132132
@test mm66 <1e-4
133133
@test isrotation(tformtest66.linear)
134134
@test !isrotation(SD*tformtest66.linear*inv(SD))
135135

136-
tformtest7, mm7 = RegisterQD.qd_rigid_fine(testimage6, testimage5, [mxrot2...]./2, minwidth_rot; SD=SD, print_interval=typemax(Int))
136+
tformtest7, mm7 = RegisterQD.qd_rigid_fine(testimage6, testimage5, [mxrot2...]./2, minwidth_rot; SD=SD, print_interval=typemax(Int))
137137
@test mm7 <1e-4
138138
@test isrotation(tformtest7.linear)
139139
@test !isrotation(SD*tformtest7.linear*inv(SD))
140140

141-
tformtest77, mm77 = RegisterQD.qd_rigid_fine(testimage6, testimage5, [mxrot2...]./2, minwidth_rot; SD=SD, print_interval=typemax(Int), initial_tfm = tformtest7)
141+
tformtest77, mm77 = RegisterQD.qd_rigid_fine(testimage6, testimage5, [mxrot2...]./2, minwidth_rot; SD=SD, print_interval=typemax(Int), initial_tfm = tformtest7)
142142
@test mm77 <1e-4
143143
@test isrotation(tformtest77.linear)
144144
@test !isrotation(SD*tformtest77.linear*inv(SD))
145145
#fails due to specific error in qd_rigid_fine
146146

147147
# a non rigid initial_tfm does not return a rigid transformation and prints an error message (?)
148-
tformtest8, mm8 = qd_rigid(testimage6, testimage5, mxshift, mxrot2; SD=SD, print_interval=typemax(Int), initial_tfm = AffineMap(SD\tformtest5.linear*SD, SD\tformtest5.translation))
148+
tformtest8, mm8 = qd_rigid(testimage6, testimage5, mxshift, mxrot2; SD=SD, print_interval=typemax(Int), initial_tfm = AffineMap(SD\tformtest5.linear*SD, SD\tformtest5.translation))
149149
@test mm8 <1e-4
150150
@test isapprox(tformtest8, mytform, atol = 1)
151151
@test !isrotation(tformtest8.linear)
152152

153153
mktemp() do path, io
154154
redirect_stdout(io) do
155-
tformtest8, mm8 = qd_rigid(testimage6, testimage5, mxshift, mxrot2; SD=SD, print_interval=typemax(Int), initial_tfm = AffineMap(SD\tformtest5.linear*SD, SD\tformtest5.translation))
155+
tformtest8, mm8 = qd_rigid(testimage6, testimage5, mxshift, mxrot2; SD=SD, print_interval=typemax(Int), initial_tfm = AffineMap(SD\tformtest5.linear*SD, SD\tformtest5.translation))
156156
end
157157
flush(io)
158158
str = read(path, String)
@@ -178,13 +178,13 @@ end
178178
mm3 = nothing
179179

180180
@test try
181-
tformtest3, mm3 = qd_affine(testimage3, testimage4, mxshift; print_interval=typemax(Int)) #
181+
tformtest3, mm3 = qd_affine(testimage3, testimage4, mxshift; print_interval=typemax(Int)) #
182182
false
183183
catch err
184184
true # this should break
185185
end
186186

187-
tformtest4, mm4 = qd_affine(testimage3, testimage4, mxshift; print_interval = typemax(Int), initial_tfm = init_tfm, fvalue = 1e-5) #
187+
tformtest4, mm4 = qd_affine(testimage3, testimage4, mxshift; print_interval = typemax(Int), initial_tfm = init_tfm, fvalue = 1e-5) #
188188
@test mm4 < 1e-4#this mismatch should be lower!
189189
@test isapprox(tformtest4.translation, [0.0, 10.0, 0.0])
190190

@@ -201,13 +201,13 @@ end
201201
testimage2 = warp(testimage1, mytform, axes(testimage1))
202202

203203

204-
tformtest1, mm1 = qd_affine(testimage2, testimage1, mxshift; print_interval=typemax(Int)) #
204+
tformtest1, mm1 = qd_affine(testimage2, testimage1, mxshift; print_interval=typemax(Int)) #
205205
#as the max-rotation is set too low, this should give a bad mismatch, but should still work
206206
@test !(mm1 < 1e-8)
207207
@test !isapprox(tformtest1, mytform, atol = 0.1)
208208

209209

210-
tformtest2, mm2 = qd_affine(testimage2, testimage1, mxshift; print_interval=typemax(Int), initial_tfm = mytform, fvalue = 1e-5) #
210+
tformtest2, mm2 = qd_affine(testimage2, testimage1, mxshift; print_interval=typemax(Int), initial_tfm = mytform, fvalue = 1e-5) #
211211
#with the initial_tfm being the true tfm, this should give back the true rotation
212212

213213
@test mm2 < 1e-8

test/qd_standard.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ end
5050
tfm = Translation(@SVector([14.3, 17.6]))
5151
fixed, moving = fixedmov(img, tfm)
5252
mxshift = (100,100) #make sure this isn't too small
53-
tform, mm = qd_translate(fixed, moving, mxshift; maxevals=1000, rtol=0, fvalue=0.0003)
53+
tform, mm = qd_translate(fixed, moving, mxshift; maxevals=1000, rtol=0, fvalue=0.0003)
5454
tfmtest(tfm, tform)
5555

5656
#Rigid transform
@@ -60,13 +60,13 @@ end
6060
mxshift = (100,100) #make sure this isn't too small
6161
mxrot = (0.5,)
6262
minwidth_rot = fill(0.002, 3)
63-
tform, mm = qd_rigid(fixed, moving, mxshift, mxrot; SD=SD, maxevals=1000, rtol=0, fvalue=0.0002)
63+
tform, mm = qd_rigid(fixed, moving, mxshift, mxrot; SD=SD, maxevals=1000, rtol=0, fvalue=0.0002)
6464
tfmtest(tfm, tform)
6565
#with anisotropic sampling
6666
SD = Matrix(Diagonal([0.5; 1.0]))
6767
tfm = Translation(@SVector([14.3, 17.8]))LinearMap(SD\RotMatrix(0.3)*SD)
6868
fixed, moving = fixedmov(centered(img), tfm)
69-
tform, mm = qd_rigid(fixed, moving, mxshift, mxrot; SD=SD, maxevals=1000, rtol=0, fvalue=0.0002)
69+
tform, mm = qd_rigid(fixed, moving, mxshift, mxrot; SD=SD, maxevals=1000, rtol=0, fvalue=0.0002)
7070
tfmtest(tfm, arrayscale(tform, SD))
7171

7272
#Affine transform
@@ -77,7 +77,7 @@ end
7777
tfm = AffineMap(tfm.linear*scale, tfm.translation)
7878
mxshift = (100,100) #make sure this isn't too small
7979
fixed, moving = fixedmov(centered(img), tfm)
80-
tform, mm = qd_affine(fixed, moving, mxshift; SD = SD, maxevals=1000, rtol=0, fvalue=0.0002)
80+
tform, mm = qd_affine(fixed, moving, mxshift; SD = SD, maxevals=1000, rtol=0, fvalue=0.0002)
8181
tfmtest(tfm, tform)
8282

8383
#with anisotropic sampling
@@ -87,7 +87,7 @@ end
8787
tfm = AffineMap(tfm.linear*scale, tfm.translation)
8888
tfm = arrayscale(tfm, SD)
8989
fixed, moving = fixedmov(centered(img), tfm)
90-
tform, mm = qd_affine(fixed, moving, mxshift; SD = SD, maxevals=10000, rtol=0, fvalue=0.0002, ndmax = 0.25)
90+
tform, mm = qd_affine(fixed, moving, mxshift; SD = SD, maxevals=10000, rtol=0, fvalue=0.0002, ndmax = 0.25)
9191
tform2 = arrayscale(tform, SD)
9292
tfmtest(tfm, tform2)
9393
end #tests with standard images

0 commit comments

Comments
 (0)