diff --git a/Project.toml b/Project.toml index b24b1f0..eb054c3 100644 --- a/Project.toml +++ b/Project.toml @@ -1,37 +1,42 @@ -name = "RegisterFit" -uuid = "36121b08-3789-5198-aff2-59a3443d9b59" -authors = ["Tim Holy "] -version = "0.2.0" - -[deps] -CenterIndexedArrays = "46a7138f-0d70-54e1-8ada-fb8296f91f24" -CoordinateTransformations = "150eb455-5306-5404-9cee-2592286d6298" -Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0" -Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59" -LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" -NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56" -Optim = "429524aa-4258-5aef-a3af-852621145aeb" -RegisterCore = "67712758-55e7-5c3c-8e85-dda1d7758434" -RegisterPenalty = "464fa2a9-b19c-5c59-8698-f58c971f971e" -RegisterUtilities = "d4862ba2-f42c-5aeb-af4f-96a8884a16c4" -StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" -Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" - -[compat] -CenterIndexedArrays = "0.0, 0.1, 0.2" -CoordinateTransformations = "0.5, 0.6" -Images = "0.24, 0.25" -Interpolations = "0.12, 0.13" -NLsolve = "4" -Optim = "0.22, 1" -RegisterCore = "0.0, 0.1, 0.2" -RegisterPenalty = "0.1, 0.2, 0.3" -RegisterUtilities = "0.0, 0.1" -StaticArrays = "0.10, 0.11, 0.12, 1" -julia = "1.6" - -[extras] -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[targets] -test = ["Test"] +name = "RegisterFit" +uuid = "36121b08-3789-5198-aff2-59a3443d9b59" +authors = ["Tim Holy "] +version = "0.2.0" + +[deps] +CenterIndexedArrays = "46a7138f-0d70-54e1-8ada-fb8296f91f24" +CoordinateTransformations = "150eb455-5306-5404-9cee-2592286d6298" +Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59" +LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56" +Optim = "429524aa-4258-5aef-a3af-852621145aeb" +RegisterCore = "67712758-55e7-5c3c-8e85-dda1d7758434" +RegisterPenalty = "464fa2a9-b19c-5c59-8698-f58c971f971e" +RegisterUtilities = "d4862ba2-f42c-5aeb-af4f-96a8884a16c4" +StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" +Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" + +[compat] +CenterIndexedArrays = "0.0, 0.1, 0.2" +CoordinateTransformations = "0.5, 0.6" +ImageBase = "0.1" +ImageTransformations = "0.10" +Interpolations = "0.12, 0.13, 0.14, 0.15" +LinearAlgebra = "1" +NLsolve = "4" +Optim = "0.22, 1" +RegisterCore = "0.0, 0.1, 0.2" +RegisterPenalty = "0.1, 0.2, 0.3" +RegisterUtilities = "0.0, 0.1" +StaticArrays = "0.10, 0.11, 0.12, 1" +Statistics = "1" +Test = "1" +julia = "1.6" + +[extras] +ImageBase = "c817782e-172a-44cc-b673-b171935fbb9e" +ImageTransformations = "02fcd773-0e25-5acc-982a-7f6622650795" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[targets] +test = ["ImageBase", "ImageTransformations", "Test"] diff --git a/test/runtests.jl b/test/runtests.jl index 454e116..d8db3c5 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,5 +1,5 @@ import RegisterFit -using Test, CoordinateTransformations, Interpolations, Images, LinearAlgebra +using Test, CoordinateTransformations, Interpolations, ImageBase, ImageTransformations, LinearAlgebra using RegisterCore using RegisterUtilities @@ -81,11 +81,7 @@ end @test abs(S[2,2]) < 1e-8 end - if Base.VERSION >= v"1.6" - F = Images.meanfinite(abs.(fixed); dims = (1,2))[1] - else - F = Images.meanfinite(abs.(fixed), (1,2))[1] - end + F = meanfinite(abs.(fixed); dims = (1,2))[1] df = zeros(2) movinge = extrapolate(interpolate(moving, BSpline(Linear())), NaN) @@ -93,14 +89,9 @@ end origin_src = center(fixed) for i = 1:2 # mov = TransformedArray(movinge, tfm[i]) - # df[i] = Images.meanfinite(abs.(fixed-AffineTransforms.transform(mov)), (1,2))[1] translation = tfm[i].translation - tfm[i].linear*origin_dest + origin_src tform = AffineMap(tfm[i].linear,translation) - if Base.VERSION >= v"1.6" - df[i] = Images.meanfinite(abs.(fixed-[movinge(tform([idx[1], idx[2]])...) for idx in CartesianIndices(fixed)]); dims = (1,2))[1] - else - df[i] = Images.meanfinite(abs.(fixed-[movinge(tform([idx[1], idx[2]])...) for idx in CartesianIndices(fixed)]), (1,2))[1] - end + df[i] = meanfinite(abs.(fixed-[movinge(tform([idx[1], idx[2]])...) for idx in CartesianIndices(fixed)]); dims = (1,2))[1] end @test minimum(df) < 1e-4*F end