From 2b3a570a5f564e91d93d8f2c01b1338937a84219 Mon Sep 17 00:00:00 2001 From: roflmaostc Date: Thu, 30 Nov 2023 15:34:42 +0100 Subject: [PATCH 1/9] Starting to rewrite RadonKA --- Project.toml | 1 - examples/Manifest.toml | 729 +++++++++++++++++++------------ examples/Project.toml | 2 + examples/example.jl | 35 +- examples/example_radon_iradon.jl | 106 +++++ src/RadonKA.jl | 31 +- src/iradon.jl | 159 ++++--- src/radon.jl | 128 +++--- src/utils.jl | 181 ++++++++ 9 files changed, 922 insertions(+), 450 deletions(-) create mode 100644 examples/example_radon_iradon.jl create mode 100644 src/utils.jl diff --git a/Project.toml b/Project.toml index 234f680..c7d47f2 100644 --- a/Project.toml +++ b/Project.toml @@ -8,7 +8,6 @@ Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341" IndexFunArrays = "613c443e-d742-454e-bfc6-1d7f8dd76566" -Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59" KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c" [compat] diff --git a/examples/Manifest.toml b/examples/Manifest.toml index 585fc7b..e0a7345 100644 --- a/examples/Manifest.toml +++ b/examples/Manifest.toml @@ -1,30 +1,31 @@ # This file is machine-generated - editing it directly is not advised -julia_version = "1.9.1" +julia_version = "1.9.4" manifest_format = "2.0" -project_hash = "465197700164fd74ff9fa3a72b02bfa7f8df2fe4" +project_hash = "93a2cea19f4df08f72fc7e57574ea1e89cd4ad22" [[deps.AbstractFFTs]] deps = ["LinearAlgebra"] -git-tree-sha1 = "16b6dbc4cf7caee4e1e75c49485ec67b667098a0" +git-tree-sha1 = "d92ad398961a3ed262d8bf04a1a2b8340f915fef" uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c" -version = "1.3.1" -weakdeps = ["ChainRulesCore"] +version = "1.5.0" +weakdeps = ["ChainRulesCore", "Test"] [deps.AbstractFFTs.extensions] AbstractFFTsChainRulesCoreExt = "ChainRulesCore" + AbstractFFTsTestExt = "Test" [[deps.AbstractPlutoDingetjes]] deps = ["Pkg"] -git-tree-sha1 = "8eaf9f1b4921132a4cff3f36a1d9ba923b14a481" +git-tree-sha1 = "793501dcd3fa7ce8d375a2c878dca2296232686e" uuid = "6e696c72-6542-2067-7265-42206c756150" -version = "1.1.4" +version = "1.2.2" [[deps.Adapt]] deps = ["LinearAlgebra", "Requires"] -git-tree-sha1 = "76289dc51920fdc6e0013c872ba9551d54961c24" +git-tree-sha1 = "02f731463748db57cc2ebfbd9fbc9ce8280d3433" uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" -version = "3.6.2" +version = "3.7.1" weakdeps = ["StaticArrays"] [deps.Adapt.extensions] @@ -51,9 +52,9 @@ version = "1.0.1" [[deps.AxisArrays]] deps = ["Dates", "IntervalSets", "IterTools", "RangeArrays"] -git-tree-sha1 = "1dd4d9f5beebac0c03446918741b1a03dc5e5788" +git-tree-sha1 = "16351be62963a67ac4083f748fdb3cca58bfd52f" uuid = "39de3d68-74b9-583c-8d2d-e117c070f3a9" -version = "0.4.6" +version = "0.4.7" [[deps.BFloat16s]] deps = ["LinearAlgebra", "Printf", "Random", "Test"] @@ -65,9 +66,9 @@ version = "0.4.2" uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" [[deps.BitFlags]] -git-tree-sha1 = "43b1a4a8f797c1cddadf60499a8a077d4af2cd2d" +git-tree-sha1 = "2dc09997850d68179b69dafb58ae806167a32b1b" uuid = "d1d4a3ce-64b1-5f1a-9ba4-7e7e69966f35" -version = "0.1.7" +version = "0.1.8" [[deps.Bzip2_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -81,16 +82,24 @@ uuid = "fa961155-64e5-5f13-b03f-caf6b980ea82" version = "0.4.2" [[deps.CUDA]] -deps = ["AbstractFFTs", "Adapt", "BFloat16s", "CEnum", "CUDA_Driver_jll", "CUDA_Runtime_Discovery", "CUDA_Runtime_jll", "CompilerSupportLibraries_jll", "ExprTools", "GPUArrays", "GPUCompiler", "KernelAbstractions", "LLVM", "LazyArtifacts", "Libdl", "LinearAlgebra", "Logging", "Preferences", "Printf", "Random", "Random123", "RandomNumbers", "Reexport", "Requires", "SparseArrays", "SpecialFunctions", "UnsafeAtomicsLLVM"] -git-tree-sha1 = "442d989978ed3ff4e174c928ee879dc09d1ef693" +deps = ["AbstractFFTs", "Adapt", "BFloat16s", "CEnum", "CUDA_Driver_jll", "CUDA_Runtime_Discovery", "CUDA_Runtime_jll", "Crayons", "DataFrames", "ExprTools", "GPUArrays", "GPUCompiler", "KernelAbstractions", "LLVM", "LLVMLoopInfo", "LazyArtifacts", "Libdl", "LinearAlgebra", "Logging", "NVTX", "Preferences", "PrettyTables", "Printf", "Random", "Random123", "RandomNumbers", "Reexport", "Requires", "SparseArrays", "Statistics", "UnsafeAtomicsLLVM"] +git-tree-sha1 = "76582ae19006b1186e87dadd781747f76cead72c" uuid = "052768ef-5323-5732-b1bb-66c8b64840ba" -version = "4.3.2" +version = "5.1.1" + + [deps.CUDA.extensions] + ChainRulesCoreExt = "ChainRulesCore" + SpecialFunctionsExt = "SpecialFunctions" + + [deps.CUDA.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" [[deps.CUDA_Driver_jll]] deps = ["Artifacts", "JLLWrappers", "LazyArtifacts", "Libdl", "Pkg"] -git-tree-sha1 = "498f45593f6ddc0adff64a9310bb6710e851781b" +git-tree-sha1 = "1e42ef1bdb45487ff28de16182c0df4920181dc3" uuid = "4ee394cb-3365-5eb0-8335-949819d2adfc" -version = "0.5.0+1" +version = "0.7.0+0" [[deps.CUDA_Runtime_Discovery]] deps = ["Libdl"] @@ -100,9 +109,9 @@ version = "0.2.2" [[deps.CUDA_Runtime_jll]] deps = ["Artifacts", "CUDA_Driver_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "TOML"] -git-tree-sha1 = "5248d9c45712e51e27ba9b30eebec65658c6ce29" +git-tree-sha1 = "9704e50c9158cf8896c2776b8dbc5edd136caf80" uuid = "76a88914-d11a-5bdc-97e0-2f5a05c973a2" -version = "0.6.0+0" +version = "0.10.1+0" [[deps.Cairo_jll]] deps = ["Artifacts", "Bzip2_jll", "CompilerSupportLibraries_jll", "Fontconfig_jll", "FreeType2_jll", "Glib_jll", "JLLWrappers", "LZO_jll", "Libdl", "Pixman_jll", "Pkg", "Xorg_libXext_jll", "Xorg_libXrender_jll", "Zlib_jll", "libpng_jll"] @@ -111,28 +120,32 @@ uuid = "83423d85-b0ee-5818-9007-b63ccbeb887a" version = "1.16.1+1" [[deps.ChainRulesCore]] -deps = ["Compat", "LinearAlgebra", "SparseArrays"] -git-tree-sha1 = "e30f2f4e20f7f186dc36529910beaedc60cfa644" +deps = ["Compat", "LinearAlgebra"] +git-tree-sha1 = "e0af648f0692ec1691b5d094b8724ba1346281cf" uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" -version = "1.16.0" +version = "1.18.0" +weakdeps = ["SparseArrays"] + + [deps.ChainRulesCore.extensions] + ChainRulesCoreSparseArraysExt = "SparseArrays" [[deps.CodeTracking]] deps = ["InteractiveUtils", "UUIDs"] -git-tree-sha1 = "d730914ef30a06732bdd9f763f6cc32e92ffbff1" +git-tree-sha1 = "c0216e792f518b39b22212127d4a84dc31e4e386" uuid = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2" -version = "1.3.1" +version = "1.3.5" [[deps.CodecZlib]] deps = ["TranscodingStreams", "Zlib_jll"] -git-tree-sha1 = "9c209fb7536406834aa938fb149964b985de6c83" +git-tree-sha1 = "cd67fc487743b2f0fd4380d4cbd3a24660d0eec8" uuid = "944b1d66-785c-5afd-91f1-9de20f533193" -version = "0.7.1" +version = "0.7.3" [[deps.ColorSchemes]] deps = ["ColorTypes", "ColorVectorSpace", "Colors", "FixedPointNumbers", "PrecompileTools", "Random"] -git-tree-sha1 = "be6ab11021cd29f0344d5c4357b163af05a48cba" +git-tree-sha1 = "67c1f244b991cad9b0aa4b7540fb758c2488b129" uuid = "35d6a980-a343-548e-a6ea-1d62b119f2f4" -version = "3.21.0" +version = "3.24.0" [[deps.ColorTypes]] deps = ["FixedPointNumbers", "Random"] @@ -141,10 +154,16 @@ uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f" version = "0.11.4" [[deps.ColorVectorSpace]] -deps = ["ColorTypes", "FixedPointNumbers", "LinearAlgebra", "SpecialFunctions", "Statistics", "TensorCore"] -git-tree-sha1 = "600cc5508d66b78aae350f7accdb58763ac18589" +deps = ["ColorTypes", "FixedPointNumbers", "LinearAlgebra", "Requires", "Statistics", "TensorCore"] +git-tree-sha1 = "a1f44953f2382ebb937d60dafbe2deea4bd23249" uuid = "c3611d14-8923-5661-9e6a-0046d554d3a4" -version = "0.9.10" +version = "0.10.0" + + [deps.ColorVectorSpace.extensions] + SpecialFunctionsExt = "SpecialFunctions" + + [deps.ColorVectorSpace.weakdeps] + SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" [[deps.Colors]] deps = ["ColorTypes", "FixedPointNumbers", "Reexport"] @@ -154,9 +173,9 @@ version = "0.12.10" [[deps.Compat]] deps = ["UUIDs"] -git-tree-sha1 = "7a60c856b9fa189eb34f5f8a6f6b5529b7942957" +git-tree-sha1 = "8a62af3e248a8c4bad6b32cbbe663ae02275e32c" uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "4.6.1" +version = "4.10.0" weakdeps = ["Dates", "LinearAlgebra"] [deps.Compat.extensions] @@ -165,46 +184,46 @@ weakdeps = ["Dates", "LinearAlgebra"] [[deps.CompilerSupportLibraries_jll]] deps = ["Artifacts", "Libdl"] uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" -version = "1.0.2+0" +version = "1.0.5+0" [[deps.ConcurrentUtilities]] deps = ["Serialization", "Sockets"] -git-tree-sha1 = "96d823b94ba8d187a6d8f0826e731195a74b90e9" +git-tree-sha1 = "8cfa272e8bdedfa88b6aefbbca7c19f1befac519" uuid = "f0e56b4a-5159-44fe-b623-3e5288b988bb" -version = "2.2.0" +version = "2.3.0" [[deps.Configurations]] deps = ["ExproniconLite", "OrderedCollections", "TOML"] -git-tree-sha1 = "62a7c76dbad02fdfdaa53608104edf760938c4ca" +git-tree-sha1 = "4358750bb58a3caefd5f37a4a0c5bfdbbf075252" uuid = "5218b696-f38b-4ac9-8b61-a12ec717816d" -version = "0.17.4" - -[[deps.ConstructionBase]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "738fec4d684a9a6ee9598a8bfee305b26831f28c" -uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9" -version = "1.5.2" -weakdeps = ["IntervalSets", "StaticArrays"] - - [deps.ConstructionBase.extensions] - ConstructionBaseIntervalSetsExt = "IntervalSets" - ConstructionBaseStaticArraysExt = "StaticArrays" +version = "0.17.6" [[deps.Contour]] git-tree-sha1 = "d05d9e7b7aedff4e5b51a029dced05cfb6125781" uuid = "d38c429a-6771-53c6-b99e-75d170b6e991" version = "0.6.2" +[[deps.Crayons]] +git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15" +uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f" +version = "4.1.1" + [[deps.DataAPI]] git-tree-sha1 = "8da84edb865b0b5b0100c0666a9bc9a0b71c553c" uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" version = "1.15.0" +[[deps.DataFrames]] +deps = ["Compat", "DataAPI", "DataStructures", "Future", "InlineStrings", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrecompileTools", "PrettyTables", "Printf", "REPL", "Random", "Reexport", "SentinelArrays", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"] +git-tree-sha1 = "04c738083f29f86e62c8afc341f0967d8717bdb8" +uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +version = "1.6.1" + [[deps.DataStructures]] deps = ["Compat", "InteractiveUtils", "OrderedCollections"] -git-tree-sha1 = "d1fff3a548102f48987a52a2e0d114fa97d730f0" +git-tree-sha1 = "3dbd312d370723b6bb43ba9d02fc36abade4518d" uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" -version = "0.18.13" +version = "0.18.15" [[deps.DataValueInterfaces]] git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" @@ -236,6 +255,18 @@ deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" version = "1.6.0" +[[deps.EpollShim_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "8e9441ee83492030ace98f9789a654a6d0b1f643" +uuid = "2702e6a9-849d-5ed8-8c21-79e8b8f9ee43" +version = "0.0.20230411+0" + +[[deps.ExceptionUnwrapping]] +deps = ["Test"] +git-tree-sha1 = "e90caa41f5a86296e014e148ee061bd6c3edec96" +uuid = "460bff9d-24e4-43bc-9d9f-a8973cb893f4" +version = "0.1.9" + [[deps.Expat_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] git-tree-sha1 = "4558ab818dcceaab612d1bb8c19cee87eda2b83c" @@ -243,15 +274,14 @@ uuid = "2e619515-83b5-522b-bb60-26c02a35a201" version = "2.5.0+0" [[deps.ExprTools]] -git-tree-sha1 = "c1d06d129da9f55715c6c212866f5b1bddc5fa00" +git-tree-sha1 = "27415f162e6028e81c72b82ef756bf321213b6ec" uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04" -version = "0.1.9" +version = "0.1.10" [[deps.ExproniconLite]] -deps = ["Pkg", "TOML"] -git-tree-sha1 = "c2eb763acf6e13e75595e0737a07a0bec0ce2147" +git-tree-sha1 = "fbc390c2f896031db5484bc152a7e805ecdfb01f" uuid = "55351af7-c7e9-48d6-89ff-24e801d99491" -version = "0.7.11" +version = "0.10.5" [[deps.FFMPEG]] deps = ["FFMPEG_jll"] @@ -260,10 +290,10 @@ uuid = "c87230d0-a227-11e9-1b43-d7ebe4e7570a" version = "0.4.1" [[deps.FFMPEG_jll]] -deps = ["Artifacts", "Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "JLLWrappers", "LAME_jll", "Libdl", "Ogg_jll", "OpenSSL_jll", "Opus_jll", "PCRE2_jll", "Pkg", "Zlib_jll", "libaom_jll", "libass_jll", "libfdk_aac_jll", "libvorbis_jll", "x264_jll", "x265_jll"] -git-tree-sha1 = "74faea50c1d007c85837327f6775bea60b5492dd" +deps = ["Artifacts", "Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "JLLWrappers", "LAME_jll", "Libdl", "Ogg_jll", "OpenSSL_jll", "Opus_jll", "PCRE2_jll", "Zlib_jll", "libaom_jll", "libass_jll", "libfdk_aac_jll", "libvorbis_jll", "x264_jll", "x265_jll"] +git-tree-sha1 = "466d45dc38e15794ec7d5d63ec03d776a9aff36e" uuid = "b22a6f82-2f65-5046-a5b2-351ab43fb4e5" -version = "4.4.2+2" +version = "4.4.4+1" [[deps.FFTW]] deps = ["AbstractFFTs", "FFTW_jll", "LinearAlgebra", "MKL_jll", "Preferences", "Reexport"] @@ -305,10 +335,10 @@ uuid = "59287772-0a20-5a39-b81b-1366585eb4c0" version = "0.4.2" [[deps.FreeType2_jll]] -deps = ["Artifacts", "Bzip2_jll", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] -git-tree-sha1 = "87eb71354d8ec1a96d4a7636bd57a7347dde3ef9" +deps = ["Artifacts", "Bzip2_jll", "JLLWrappers", "Libdl", "Zlib_jll"] +git-tree-sha1 = "d8db6a5a2fe1381c1ea4ef2cab7c69c2de7f9ea0" uuid = "d7e528f0-a631-5988-bf34-fe36492bcfd7" -version = "2.10.4+0" +version = "2.13.1+0" [[deps.FriBidi_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -316,11 +346,15 @@ git-tree-sha1 = "aa31987c2ba8704e23c6c8ba8a4f769d5d7e4f91" uuid = "559328eb-81f9-559d-9380-de523a88c83c" version = "1.0.10+0" +[[deps.Future]] +deps = ["Random"] +uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820" + [[deps.FuzzyCompletions]] deps = ["REPL"] -git-tree-sha1 = "e16dd964b4dfaebcded16b2af32f05e235b354be" +git-tree-sha1 = "c8d37d615586bea181063613dccc555499feb298" uuid = "fb4132e2-a121-4a70-b8a1-d5b831dcdcc2" -version = "0.5.1" +version = "0.5.3" [[deps.GLFW_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Libglvnd_jll", "Pkg", "Xorg_libXcursor_jll", "Xorg_libXi_jll", "Xorg_libXinerama_jll", "Xorg_libXrandr_jll"] @@ -330,9 +364,9 @@ version = "3.3.8+0" [[deps.GPUArrays]] deps = ["Adapt", "GPUArraysCore", "LLVM", "LinearAlgebra", "Printf", "Random", "Reexport", "Serialization", "Statistics"] -git-tree-sha1 = "a3351bc577a6b49297248aadc23a4add1097c2ac" +git-tree-sha1 = "85d7fb51afb3def5dcb85ad31c3707795c8bccc1" uuid = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7" -version = "8.7.1" +version = "9.1.0" [[deps.GPUArraysCore]] deps = ["Adapt"] @@ -342,21 +376,21 @@ version = "0.1.5" [[deps.GPUCompiler]] deps = ["ExprTools", "InteractiveUtils", "LLVM", "Libdl", "Logging", "Scratch", "TimerOutputs", "UUIDs"] -git-tree-sha1 = "cb090aea21c6ca78d59672a7e7d13bd56d09de64" +git-tree-sha1 = "a846f297ce9d09ccba02ead0cae70690e072a119" uuid = "61eb1bfa-7361-4325-ad38-22787b887f55" -version = "0.20.3" +version = "0.25.0" [[deps.GR]] deps = ["Artifacts", "Base64", "DelimitedFiles", "Downloads", "GR_jll", "HTTP", "JSON", "Libdl", "LinearAlgebra", "Pkg", "Preferences", "Printf", "Random", "Serialization", "Sockets", "TOML", "Tar", "Test", "UUIDs", "p7zip_jll"] -git-tree-sha1 = "8b8a2fd4536ece6e554168c21860b6820a8a83db" +git-tree-sha1 = "27442171f28c952804dede8ff72828a96f2bfc1f" uuid = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71" -version = "0.72.7" +version = "0.72.10" [[deps.GR_jll]] -deps = ["Artifacts", "Bzip2_jll", "Cairo_jll", "FFMPEG_jll", "Fontconfig_jll", "GLFW_jll", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Libtiff_jll", "Pixman_jll", "Qt5Base_jll", "Zlib_jll", "libpng_jll"] -git-tree-sha1 = "19fad9cd9ae44847fe842558a744748084a722d1" +deps = ["Artifacts", "Bzip2_jll", "Cairo_jll", "FFMPEG_jll", "Fontconfig_jll", "FreeType2_jll", "GLFW_jll", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Libtiff_jll", "Pixman_jll", "Qt6Base_jll", "Zlib_jll", "libpng_jll"] +git-tree-sha1 = "025d171a2847f616becc0f84c8dc62fe18f0f6dd" uuid = "d2c73de3-f751-5644-a686-071e5b155ba9" -version = "0.72.7+0" +version = "0.72.10+0" [[deps.Gettext_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "XML2_jll"] @@ -365,16 +399,10 @@ uuid = "78b55507-aeef-58d4-861c-77aaff3498b1" version = "0.21.0+0" [[deps.Glib_jll]] -deps = ["Artifacts", "Gettext_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Libiconv_jll", "Libmount_jll", "PCRE2_jll", "Pkg", "Zlib_jll"] -git-tree-sha1 = "d3b3624125c1474292d0d8ed0f65554ac37ddb23" +deps = ["Artifacts", "Gettext_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Libiconv_jll", "Libmount_jll", "PCRE2_jll", "Zlib_jll"] +git-tree-sha1 = "e94c92c7bf4819685eb80186d51c43e71d4afa17" uuid = "7746bdde-850d-59dc-9ae8-88ece973131d" -version = "2.74.0+2" - -[[deps.Graphics]] -deps = ["Colors", "LinearAlgebra", "NaNMath"] -git-tree-sha1 = "d61890399bc535850c4bf08e4e0d3a7ad0f21cbd" -uuid = "a2bd30eb-e257-5431-a919-1863eab51364" -version = "1.1.2" +version = "2.76.5+0" [[deps.Graphite2_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -388,10 +416,10 @@ uuid = "42e2da0e-8278-4e71-bc24-59509adca0fe" version = "1.0.2" [[deps.HTTP]] -deps = ["Base64", "CodecZlib", "ConcurrentUtilities", "Dates", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "OpenSSL", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"] -git-tree-sha1 = "5e77dbf117412d4f164a464d610ee6050cc75272" +deps = ["Base64", "CodecZlib", "ConcurrentUtilities", "Dates", "ExceptionUnwrapping", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "OpenSSL", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"] +git-tree-sha1 = "abbbb9ec3afd783a7cbd82ef01dcd088ea051398" uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" -version = "1.9.6" +version = "1.10.1" [[deps.HarfBuzz_jll]] deps = ["Artifacts", "Cairo_jll", "Fontconfig_jll", "FreeType2_jll", "Glib_jll", "Graphite2_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Pkg"] @@ -407,9 +435,9 @@ version = "0.0.4" [[deps.HypertextLiteral]] deps = ["Tricks"] -git-tree-sha1 = "c47c5fa4c5308f27ccaac35504858d8914e102f9" +git-tree-sha1 = "7134810b1afce04bbc1045ca1985fbe81ce17653" uuid = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2" -version = "0.9.4" +version = "0.9.5" [[deps.IOCapture]] deps = ["Logging", "Random"] @@ -419,39 +447,39 @@ version = "0.2.3" [[deps.ImageAxes]] deps = ["AxisArrays", "ImageBase", "ImageCore", "Reexport", "SimpleTraits"] -git-tree-sha1 = "c54b581a83008dc7f292e205f4c409ab5caa0f04" +git-tree-sha1 = "2e4520d67b0cef90865b3ef727594d2a58e0e1f8" uuid = "2803e5a7-5153-5ecf-9a86-9b4c37f5f5ac" -version = "0.6.10" +version = "0.6.11" [[deps.ImageBase]] deps = ["ImageCore", "Reexport"] -git-tree-sha1 = "b51bb8cae22c66d0f6357e3bcb6363145ef20835" +git-tree-sha1 = "eb49b82c172811fd2c86759fa0553a2221feb909" uuid = "c817782e-172a-44cc-b673-b171935fbb9e" -version = "0.1.5" +version = "0.1.7" [[deps.ImageCore]] -deps = ["AbstractFFTs", "ColorVectorSpace", "Colors", "FixedPointNumbers", "Graphics", "MappedArrays", "MosaicViews", "OffsetArrays", "PaddedViews", "Reexport"] -git-tree-sha1 = "acf614720ef026d38400b3817614c45882d75500" +deps = ["AbstractFFTs", "ColorVectorSpace", "Colors", "FixedPointNumbers", "MappedArrays", "MosaicViews", "OffsetArrays", "PaddedViews", "PrecompileTools", "Reexport"] +git-tree-sha1 = "fc5d1d3443a124fde6e92d0260cd9e064eba69f8" uuid = "a09fc81d-aa75-5fe9-8630-4744c3626534" -version = "0.9.4" +version = "0.10.1" [[deps.ImageIO]] deps = ["FileIO", "IndirectArrays", "JpegTurbo", "LazyModules", "Netpbm", "OpenEXR", "PNGFiles", "QOI", "Sixel", "TiffImages", "UUIDs"] -git-tree-sha1 = "342f789fd041a55166764c351da1710db97ce0e0" +git-tree-sha1 = "bca20b2f5d00c4fbc192c3212da8fa79f4688009" uuid = "82e4d734-157c-48bb-816b-45c225c6df19" -version = "0.6.6" +version = "0.6.7" [[deps.ImageMetadata]] deps = ["AxisArrays", "ImageAxes", "ImageBase", "ImageCore"] -git-tree-sha1 = "36cbaebed194b292590cba2593da27b34763804a" +git-tree-sha1 = "355e2b974f2e3212a75dfb60519de21361ad3cb7" uuid = "bc367c6b-8a6b-528e-b4bd-a4b897500b49" -version = "0.9.8" +version = "0.9.9" [[deps.ImageShow]] deps = ["Base64", "ColorSchemes", "FileIO", "ImageBase", "ImageCore", "OffsetArrays", "StackViews"] -git-tree-sha1 = "ce28c68c900eed3cdbfa418be66ed053e54d4f56" +git-tree-sha1 = "3b5344bcdbdc11ad58f3b1956709b5b9345355de" uuid = "4e3cecfd-b093-5904-9786-8bbb286a6a31" -version = "0.3.7" +version = "0.3.8" [[deps.Imath_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] @@ -471,15 +499,21 @@ uuid = "9b13fd28-a010-5f03-acff-a1bbcff69959" version = "1.0.0" [[deps.Inflate]] -git-tree-sha1 = "5cd07aab533df5170988219191dfad0519391428" +git-tree-sha1 = "ea8031dea4aff6bd41f1df8f2fdfb25b33626381" uuid = "d25df0c9-e2be-5dd7-82c8-3ad0b3e990b9" -version = "0.1.3" +version = "0.1.4" + +[[deps.InlineStrings]] +deps = ["Parsers"] +git-tree-sha1 = "9cc2baf75c6d09f9da536ddf58eb2f29dedaf461" +uuid = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48" +version = "1.4.0" [[deps.IntelOpenMP_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "0cb9352ef2e01574eeebdb102948a58740dcaf83" +git-tree-sha1 = "ad37c091f7d7daf900963171600d7c1c5c3ede32" uuid = "1d5cc7b8-4909-519e-a0f8-d0f5ad9712d0" -version = "2023.1.0+0" +version = "2023.2.0+0" [[deps.InteractiveUtils]] deps = ["Markdown"] @@ -487,15 +521,28 @@ uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" [[deps.Interpolations]] deps = ["Adapt", "AxisAlgorithms", "ChainRulesCore", "LinearAlgebra", "OffsetArrays", "Random", "Ratios", "Requires", "SharedArrays", "SparseArrays", "StaticArrays", "WoodburyMatrices"] -git-tree-sha1 = "721ec2cf720536ad005cb38f50dbba7b02419a15" +git-tree-sha1 = "274ad8005db8b4ef6cc46d1392927083405813c2" uuid = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59" -version = "0.14.7" +version = "0.15.0" +weakdeps = ["Unitful"] + + [deps.Interpolations.extensions] + InterpolationsUnitfulExt = "Unitful" [[deps.IntervalSets]] -deps = ["Dates", "Random", "Statistics"] -git-tree-sha1 = "16c0cc91853084cb5f58a78bd209513900206ce6" +deps = ["Dates", "Random"] +git-tree-sha1 = "3d8866c029dd6b16e69e0d4a939c4dfcb98fac47" uuid = "8197267c-284f-5f27-9208-e0e47529a953" -version = "0.7.4" +version = "0.7.8" +weakdeps = ["Statistics"] + + [deps.IntervalSets.extensions] + IntervalSetsStatisticsExt = "Statistics" + +[[deps.InvertedIndices]] +git-tree-sha1 = "0dc7b50b8d436461be01300fd8cd45aa0274b038" +uuid = "41ab1584-1d38-5bbf-9106-f11c6c58b48f" +version = "1.3.0" [[deps.IrrationalConstants]] git-tree-sha1 = "630b497eafcc20001bba38a4651b327dcfc491d2" @@ -514,15 +561,15 @@ version = "1.0.0" [[deps.JLFzf]] deps = ["Pipe", "REPL", "Random", "fzf_jll"] -git-tree-sha1 = "f377670cda23b6b7c1c0b3893e37451c5c1a2185" +git-tree-sha1 = "a53ebe394b71470c7f97c2e7e170d51df21b17af" uuid = "1019f520-868f-41f5-a6de-eb00f4b6a39c" -version = "0.1.5" +version = "0.1.7" [[deps.JLLWrappers]] -deps = ["Preferences"] -git-tree-sha1 = "abc9885a7ca2052a736a600f7fa66209f96506e1" +deps = ["Artifacts", "Preferences"] +git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca" uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" -version = "1.4.1" +version = "1.5.0" [[deps.JSON]] deps = ["Dates", "Mmap", "Parsers", "Unicode"] @@ -532,9 +579,9 @@ version = "0.21.4" [[deps.JpegTurbo]] deps = ["CEnum", "FileIO", "ImageCore", "JpegTurbo_jll", "TOML"] -git-tree-sha1 = "106b6aa272f294ba47e96bd3acbabdc0407b5c60" +git-tree-sha1 = "d65930fa2bc96b07d7691c652d701dcbe7d9cf0b" uuid = "b835a17e-a41a-41e7-81f0-2f016b05efe0" -version = "0.1.2" +version = "0.1.4" [[deps.JpegTurbo_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] @@ -544,15 +591,27 @@ version = "2.1.91+0" [[deps.JuliaInterpreter]] deps = ["CodeTracking", "InteractiveUtils", "Random", "UUIDs"] -git-tree-sha1 = "6a125e6a4cb391e0b9adbd1afa9e771c2179f8ef" +git-tree-sha1 = "e49bce680c109bc86e3e75ebcb15040d6ad9e1d3" uuid = "aa1ae85d-cabe-5617-a682-6adf51b2e16a" -version = "0.9.23" +version = "0.9.27" + +[[deps.JuliaNVTXCallbacks_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "af433a10f3942e882d3c671aacb203e006a5808f" +uuid = "9c1d0b0a-7046-5b2e-a33f-ea22f176ac7e" +version = "0.2.1+0" [[deps.KernelAbstractions]] -deps = ["Adapt", "Atomix", "InteractiveUtils", "LinearAlgebra", "MacroTools", "PrecompileTools", "SparseArrays", "StaticArrays", "UUIDs", "UnsafeAtomics", "UnsafeAtomicsLLVM"] -git-tree-sha1 = "bd2a7271f9884dc0ffc057974c374aaaa531b36a" +deps = ["Adapt", "Atomix", "InteractiveUtils", "LinearAlgebra", "MacroTools", "PrecompileTools", "Requires", "SparseArrays", "StaticArrays", "UUIDs", "UnsafeAtomics", "UnsafeAtomicsLLVM"] +git-tree-sha1 = "b0737cbbe1c8da6f1139d1c23e35e7cea129c0af" uuid = "63c18a36-062a-441e-b654-da1e3ab1ce7c" -version = "0.9.5" +version = "0.9.13" + + [deps.KernelAbstractions.extensions] + EnzymeExt = "EnzymeCore" + + [deps.KernelAbstractions.weakdeps] + EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869" [[deps.LAME_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -567,16 +626,25 @@ uuid = "88015f11-f218-50d7-93a8-a6af411a945d" version = "3.0.0+1" [[deps.LLVM]] -deps = ["CEnum", "LLVMExtra_jll", "Libdl", "Printf", "Unicode"] -git-tree-sha1 = "5007c1421563108110bbd57f63d8ad4565808818" +deps = ["CEnum", "LLVMExtra_jll", "Libdl", "Preferences", "Printf", "Requires", "Unicode"] +git-tree-sha1 = "c879e47398a7ab671c782e02b51a4456794a7fa3" uuid = "929cbde3-209d-540e-8aea-75f648917ca0" -version = "5.2.0" +version = "6.4.0" +weakdeps = ["BFloat16s"] + + [deps.LLVM.extensions] + BFloat16sExt = "BFloat16s" [[deps.LLVMExtra_jll]] deps = ["Artifacts", "JLLWrappers", "LazyArtifacts", "Libdl", "TOML"] -git-tree-sha1 = "1222116d7313cdefecf3d45a2bc1a89c4e7c9217" +git-tree-sha1 = "98eaee04d96d973e79c25d49167668c5c8fb50e2" uuid = "dad2f222-ce93-54a1-a47d-0025e8a3acab" -version = "0.0.22+0" +version = "0.0.27+1" + +[[deps.LLVMLoopInfo]] +git-tree-sha1 = "2e5c102cfc41f48ae4740c7eca7743cc7e7b75ea" +uuid = "8b046642-f1f6-4319-8d3c-209ddc03c586" +version = "1.0.0" [[deps.LLVMOpenMP_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -591,9 +659,9 @@ uuid = "dd4b983a-f0e5-5f8d-a1b7-129d4a5fb1ac" version = "2.10.1+0" [[deps.LaTeXStrings]] -git-tree-sha1 = "f2355693d6778a178ade15952b7ac47a4ff97996" +git-tree-sha1 = "50901ebc375ed41dbf8058da26f9de442febbbec" uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" -version = "1.3.0" +version = "1.3.1" [[deps.Latexify]] deps = ["Formatting", "InteractiveUtils", "LaTeXStrings", "MacroTools", "Markdown", "OrderedCollections", "Printf", "Requires"] @@ -610,9 +678,9 @@ version = "0.16.1" SymEngine = "123dc426-2d89-5057-bbad-38513e3affd8" [[deps.LazilyInitializedFields]] -git-tree-sha1 = "410fe4739a4b092f2ffe36fcb0dcc3ab12648ce1" +git-tree-sha1 = "8f7f3cabab0fd1800699663533b6d5cb3fc0e612" uuid = "0e77f7df-68c5-4e49-93ce-4cd80f5598bf" -version = "1.2.1" +version = "1.2.2" [[deps.LazyArtifacts]] deps = ["Artifacts", "Pkg"] @@ -626,12 +694,12 @@ version = "0.3.1" [[deps.LibCURL]] deps = ["LibCURL_jll", "MozillaCACerts_jll"] uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" -version = "0.6.3" +version = "0.6.4" [[deps.LibCURL_jll]] deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" -version = "7.84.0+0" +version = "8.4.0+0" [[deps.LibGit2]] deps = ["Base64", "NetworkOptions", "Printf", "SHA"] @@ -640,7 +708,7 @@ uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" [[deps.LibSSH2_jll]] deps = ["Artifacts", "Libdl", "MbedTLS_jll"] uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" -version = "1.10.2+0" +version = "1.11.0+1" [[deps.Libdl]] uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" @@ -670,10 +738,10 @@ uuid = "7add5ba3-2f88-524e-9cd5-f83b8a55f7b8" version = "1.42.0+0" [[deps.Libiconv_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "c7cb1f5d892775ba13767a87c7ada0b980ea0a71" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "f9557a255370125b405568f9767d6d195822a175" uuid = "94ce4f54-9a6c-5748-9c1c-f9c7231a4531" -version = "1.16.1+2" +version = "1.17.0+0" [[deps.Libmount_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -682,10 +750,10 @@ uuid = "4b2f31a3-9ecc-558c-b454-b3730dcb73e9" version = "2.35.0+0" [[deps.Libtiff_jll]] -deps = ["Artifacts", "JLLWrappers", "JpegTurbo_jll", "LERC_jll", "Libdl", "Pkg", "Zlib_jll", "Zstd_jll"] -git-tree-sha1 = "3eb79b0ca5764d4799c06699573fd8f533259713" +deps = ["Artifacts", "JLLWrappers", "JpegTurbo_jll", "LERC_jll", "Libdl", "XZ_jll", "Zlib_jll", "Zstd_jll"] +git-tree-sha1 = "2da088d113af58221c52828a80378e16be7d037a" uuid = "89763e89-9b03-5906-acba-b20f662cd828" -version = "4.4.0+0" +version = "4.5.1+1" [[deps.Libuuid_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -699,9 +767,9 @@ uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" [[deps.LogExpFunctions]] deps = ["DocStringExtensions", "IrrationalConstants", "LinearAlgebra"] -git-tree-sha1 = "c3ce8e7420b3a6e071e0fe4745f5d4300e37b13f" +git-tree-sha1 = "7d6dd4e9212aebaeed356de34ccf262a3cd415aa" uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" -version = "0.3.24" +version = "0.3.26" [deps.LogExpFunctions.extensions] LogExpFunctionsChainRulesCoreExt = "ChainRulesCore" @@ -718,15 +786,15 @@ uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" [[deps.LoggingExtras]] deps = ["Dates", "Logging"] -git-tree-sha1 = "cedb76b37bc5a6c702ade66be44f831fa23c681e" +git-tree-sha1 = "c1dd6d7978c12545b4179fb6153b9250c96b0075" uuid = "e6f89c97-d47a-5376-807f-9c37f3926c36" -version = "1.0.0" +version = "1.0.3" [[deps.LoweredCodeUtils]] deps = ["JuliaInterpreter"] -git-tree-sha1 = "60168780555f3e663c536500aa790b6368adc02a" +git-tree-sha1 = "c165f205e030208760ebd75b5e1f7706761d9218" uuid = "6f1432cf-f94c-5a45-995e-cdbf5db27b0b" -version = "2.3.0" +version = "2.3.1" [[deps.MIMEs]] git-tree-sha1 = "65f28ad4b594aebe22157d6fac869786a255b7eb" @@ -735,15 +803,21 @@ version = "0.1.4" [[deps.MKL_jll]] deps = ["Artifacts", "IntelOpenMP_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "Pkg"] -git-tree-sha1 = "154d7aaa82d24db6d8f7e4ffcfe596f40bff214b" +git-tree-sha1 = "eb006abbd7041c28e0d16260e50a24f8f9104913" uuid = "856f044c-d86e-5d09-b602-aeab76dc8ba7" -version = "2023.1.0+0" +version = "2023.2.0+0" [[deps.MacroTools]] deps = ["Markdown", "Random"] -git-tree-sha1 = "42324d08725e200c23d4dfb549e0d5d89dede2d2" +git-tree-sha1 = "9ee1618cbf5240e6d4e0371d6f24065083f60c48" uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" -version = "0.5.10" +version = "0.5.11" + +[[deps.Malt]] +deps = ["Distributed", "Logging", "RelocatableFolders", "Serialization", "Sockets"] +git-tree-sha1 = "18cf4151e390fce29ca846b92b06baf9bc6e002e" +uuid = "36869731-bdee-424d-aa32-cab38c994e3b" +version = "1.1.1" [[deps.MappedArrays]] git-tree-sha1 = "2dab0221fe2b0f2cb6754eaa743cc266339f527e" @@ -755,10 +829,10 @@ deps = ["Base64"] uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" [[deps.MbedTLS]] -deps = ["Dates", "MbedTLS_jll", "MozillaCACerts_jll", "Random", "Sockets"] -git-tree-sha1 = "03a9b9718f5682ecb107ac9f7308991db4ce395b" +deps = ["Dates", "MbedTLS_jll", "MozillaCACerts_jll", "NetworkOptions", "Random", "Sockets"] +git-tree-sha1 = "c067a280ddc25f196b5e7df3877c6b226d390aaf" uuid = "739be429-bea8-5141-9913-cc70e7f3736d" -version = "1.1.7" +version = "1.1.9" [[deps.MbedTLS_jll]] deps = ["Artifacts", "Libdl"] @@ -795,6 +869,18 @@ git-tree-sha1 = "fc8c15ca848b902015bd4a745d350f02cf791c2a" uuid = "99f44e22-a591-53d1-9472-aa23ef4bd671" version = "1.2.0" +[[deps.NVTX]] +deps = ["Colors", "JuliaNVTXCallbacks_jll", "Libdl", "NVTX_jll"] +git-tree-sha1 = "8bc9ce4233be3c63f8dcd78ccaf1b63a9c0baa34" +uuid = "5da4648a-3479-48b8-97b9-01cb529c0a1f" +version = "0.3.3" + +[[deps.NVTX_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "ce3269ed42816bf18d500c9f63418d4b0d9f5a3b" +uuid = "e98f9f5b-d649-5603-91fd-7774390e6439" +version = "3.1.0+2" + [[deps.NaNMath]] deps = ["OpenLibm_jll"] git-tree-sha1 = "0877504529a3e5c3343c6f8b4c0381e57e4387e4" @@ -803,9 +889,9 @@ version = "1.0.2" [[deps.Netpbm]] deps = ["FileIO", "ImageCore", "ImageMetadata"] -git-tree-sha1 = "5ae7ca23e13855b3aba94550f26146c01d259267" +git-tree-sha1 = "d92b107dbb887293622df7697a2223f9f8176fcd" uuid = "f09324ee-3d7c-5217-9330-fc30815ba969" -version = "1.1.0" +version = "1.1.1" [[deps.NetworkOptions]] uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" @@ -813,9 +899,9 @@ version = "1.2.0" [[deps.OffsetArrays]] deps = ["Adapt"] -git-tree-sha1 = "82d7c9e310fe55aa54996e6f7f94674e2a38fcb4" +git-tree-sha1 = "2ac17d29c523ce1cd38e27785a7d23024853a4bb" uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" -version = "1.12.9" +version = "1.12.10" [[deps.Ogg_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -853,15 +939,9 @@ version = "1.4.1" [[deps.OpenSSL_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "1aa4b74f80b01c6bc2b89992b861b5f210e665b5" +git-tree-sha1 = "cc6e1927ac521b659af340e0ca45828a3ffc748f" uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" -version = "1.1.21+0" - -[[deps.OpenSpecFun_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1" -uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" -version = "0.5.5+0" +version = "3.0.12+0" [[deps.Opus_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -870,9 +950,9 @@ uuid = "91d4177d-7536-5919-b921-800302f37372" version = "1.3.2+0" [[deps.OrderedCollections]] -git-tree-sha1 = "d321bf2de576bf25ec4d3e4360faca399afca282" +git-tree-sha1 = "dfdf5519f235516220579f949664f1bf44e741c5" uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" -version = "1.6.0" +version = "1.6.3" [[deps.PCRE2_jll]] deps = ["Artifacts", "Libdl"] @@ -881,9 +961,9 @@ version = "10.42.0+0" [[deps.PNGFiles]] deps = ["Base64", "CEnum", "ImageCore", "IndirectArrays", "OffsetArrays", "libpng_jll"] -git-tree-sha1 = "f809158b27eba0c18c269cf2a2be6ed751d3e81d" +git-tree-sha1 = "eed372b0fa15624273a9cdb188b1b88476e6a233" uuid = "f57f5aa1-a3ce-4bc8-8ab9-96f992907883" -version = "0.3.17" +version = "0.4.2" [[deps.PaddedViews]] deps = ["OffsetArrays"] @@ -893,9 +973,9 @@ version = "0.5.12" [[deps.Parsers]] deps = ["Dates", "PrecompileTools", "UUIDs"] -git-tree-sha1 = "5a6ab2f64388fd1175effdf73fe5933ef1e0bac0" +git-tree-sha1 = "a935806434c9d4c506ba941871b327b96d41f2bf" uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "2.7.0" +version = "2.8.0" [[deps.Pipe]] git-tree-sha1 = "6842804e7867b115ca9de748a0cf6b364523c16d" @@ -911,13 +991,13 @@ version = "0.42.2+0" [[deps.Pkg]] deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" -version = "1.9.0" +version = "1.9.2" [[deps.PkgVersion]] deps = ["Pkg"] -git-tree-sha1 = "f6cf8e7944e50901594838951729a1861e668cb8" +git-tree-sha1 = "f9501cc0430a26bc3d156ae1b5b0c1b47af4d6da" uuid = "eebad327-c553-4316-9ea0-9fa01ccd7688" -version = "0.3.2" +version = "0.3.3" [[deps.PlotThemes]] deps = ["PlotUtils", "Statistics"] @@ -933,9 +1013,9 @@ version = "1.3.5" [[deps.Plots]] deps = ["Base64", "Contour", "Dates", "Downloads", "FFMPEG", "FixedPointNumbers", "GR", "JLFzf", "JSON", "LaTeXStrings", "Latexify", "LinearAlgebra", "Measures", "NaNMath", "Pkg", "PlotThemes", "PlotUtils", "PrecompileTools", "Preferences", "Printf", "REPL", "Random", "RecipesBase", "RecipesPipeline", "Reexport", "RelocatableFolders", "Requires", "Scratch", "Showoff", "SparseArrays", "Statistics", "StatsBase", "UUIDs", "UnicodeFun", "UnitfulLatexify", "Unzip"] -git-tree-sha1 = "75ca67b2c6512ad2d0c767a7cfc55e75075f8bbc" +git-tree-sha1 = "ccee59c6e48e6f2edf8a5b64dc817b6729f99eb5" uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" -version = "1.38.16" +version = "1.39.0" [deps.Plots.extensions] FileIOExt = "FileIO" @@ -952,16 +1032,28 @@ version = "1.38.16" Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" [[deps.Pluto]] -deps = ["Base64", "Configurations", "Dates", "Distributed", "FileWatching", "FuzzyCompletions", "HTTP", "HypertextLiteral", "InteractiveUtils", "Logging", "LoggingExtras", "MIMEs", "Markdown", "MsgPack", "Pkg", "PrecompileSignatures", "PrecompileTools", "REPL", "RegistryInstances", "RelocatableFolders", "Sockets", "TOML", "Tables", "URIs", "UUIDs"] -git-tree-sha1 = "c4c4dac5c1332ab510e145eea59382847c51a6fb" +deps = ["Base64", "Configurations", "Dates", "Downloads", "FileWatching", "FuzzyCompletions", "HTTP", "HypertextLiteral", "InteractiveUtils", "Logging", "LoggingExtras", "MIMEs", "Malt", "Markdown", "MsgPack", "Pkg", "PrecompileSignatures", "PrecompileTools", "REPL", "RegistryInstances", "RelocatableFolders", "Scratch", "Sockets", "TOML", "Tables", "URIs", "UUIDs"] +git-tree-sha1 = "0b61bd2572c7c797a0e0c78c40b8cee740996ebb" uuid = "c3e4b0f8-55cb-11ea-2926-15256bba5781" -version = "0.19.26" +version = "0.19.32" + +[[deps.PlutoTest]] +deps = ["HypertextLiteral", "InteractiveUtils", "Markdown", "Test"] +git-tree-sha1 = "17aa9b81106e661cffa1c4c36c17ee1c50a86eda" +uuid = "cb4044da-4d16-4ffa-a6a3-8cad7f73ebdc" +version = "0.2.2" [[deps.PlutoUI]] deps = ["AbstractPlutoDingetjes", "Base64", "ColorTypes", "Dates", "FixedPointNumbers", "Hyperscript", "HypertextLiteral", "IOCapture", "InteractiveUtils", "JSON", "Logging", "MIMEs", "Markdown", "Random", "Reexport", "URIs", "UUIDs"] -git-tree-sha1 = "b478a748be27bd2f2c73a7690da219d0844db305" +git-tree-sha1 = "bd7c69c7f7173097e7b5e1be07cee2b8b7447f51" uuid = "7f904dfe-b85e-4ff6-b463-dae2292396a8" -version = "0.7.51" +version = "0.7.54" + +[[deps.PooledArrays]] +deps = ["DataAPI", "Future"] +git-tree-sha1 = "36d8b4b899628fb92c2749eb488d884a926614d3" +uuid = "2dfb63ee-cc39-5dd5-95bd-886bf059d720" +version = "1.4.3" [[deps.PrecompileSignatures]] git-tree-sha1 = "18ef344185f25ee9d51d80e179f8dad33dc48eb1" @@ -970,15 +1062,21 @@ version = "3.0.3" [[deps.PrecompileTools]] deps = ["Preferences"] -git-tree-sha1 = "9673d39decc5feece56ef3940e5dafba15ba0f81" +git-tree-sha1 = "03b4c25b43cb84cee5c90aa9b5ea0a78fd848d2f" uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" -version = "1.1.2" +version = "1.2.0" [[deps.Preferences]] deps = ["TOML"] -git-tree-sha1 = "7eb1686b4f04b82f96ed7a4ea5890a4f0c7a09f1" +git-tree-sha1 = "00805cd429dcb4870060ff49ef443486c262e38e" uuid = "21216c6a-2e73-6563-6e65-726566657250" -version = "1.4.0" +version = "1.4.1" + +[[deps.PrettyTables]] +deps = ["Crayons", "LaTeXStrings", "Markdown", "PrecompileTools", "Printf", "Reexport", "StringManipulation", "Tables"] +git-tree-sha1 = "88b895d13d53b5577fd53379d913b9ab9ac82660" +uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" +version = "2.3.1" [[deps.Printf]] deps = ["Unicode"] @@ -986,9 +1084,9 @@ uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" [[deps.ProgressMeter]] deps = ["Distributed", "Printf"] -git-tree-sha1 = "d7a7aef8f8f2d537104f170139553b14dfe39fe9" +git-tree-sha1 = "00099623ffee15972c16111bcf84c58a0051257c" uuid = "92933f4c-e287-5a05-a399-4b506db050ca" -version = "1.7.2" +version = "1.9.0" [[deps.QOI]] deps = ["ColorTypes", "FileIO", "FixedPointNumbers"] @@ -996,18 +1094,18 @@ git-tree-sha1 = "18e8f4d1426e965c7b532ddd260599e1510d26ce" uuid = "4b34888f-f399-49d4-9bb3-47ed5cae4e65" version = "1.0.0" -[[deps.Qt5Base_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "Fontconfig_jll", "Glib_jll", "JLLWrappers", "Libdl", "Libglvnd_jll", "OpenSSL_jll", "Pkg", "Xorg_libXext_jll", "Xorg_libxcb_jll", "Xorg_xcb_util_image_jll", "Xorg_xcb_util_keysyms_jll", "Xorg_xcb_util_renderutil_jll", "Xorg_xcb_util_wm_jll", "Zlib_jll", "xkbcommon_jll"] -git-tree-sha1 = "0c03844e2231e12fda4d0086fd7cbe4098ee8dc5" -uuid = "ea2cea3b-5b76-57ae-a6ef-0a8af62496e1" -version = "5.15.3+2" +[[deps.Qt6Base_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "Fontconfig_jll", "Glib_jll", "JLLWrappers", "Libdl", "Libglvnd_jll", "OpenSSL_jll", "Vulkan_Loader_jll", "Xorg_libSM_jll", "Xorg_libXext_jll", "Xorg_libXrender_jll", "Xorg_libxcb_jll", "Xorg_xcb_util_cursor_jll", "Xorg_xcb_util_image_jll", "Xorg_xcb_util_keysyms_jll", "Xorg_xcb_util_renderutil_jll", "Xorg_xcb_util_wm_jll", "Zlib_jll", "libinput_jll", "xkbcommon_jll"] +git-tree-sha1 = "37b7bb7aabf9a085e0044307e1717436117f2b3b" +uuid = "c0090381-4147-56d7-9ebc-da0b1113ec56" +version = "6.5.3+1" [[deps.REPL]] deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.RadonKA]] -deps = ["Adapt", "CUDA", "FFTW", "IndexFunArrays", "Interpolations", "KernelAbstractions"] +deps = ["Adapt", "CUDA", "FFTW", "IndexFunArrays", "KernelAbstractions"] path = ".." uuid = "86de8297-835b-47df-b249-c04e8db91db5" version = "0.1.0" @@ -1068,9 +1166,9 @@ version = "0.1.0" [[deps.RelocatableFolders]] deps = ["SHA", "Scratch"] -git-tree-sha1 = "90bc7a7c96410424509e4263e277e43250c05691" +git-tree-sha1 = "ffdaf70d81cf6ff22c2b6e733c900c3321cab864" uuid = "05181044-ff0b-4ac5-8273-598c1e38db00" -version = "1.0.0" +version = "1.0.1" [[deps.Requires]] deps = ["UUIDs"] @@ -1080,9 +1178,9 @@ version = "1.3.0" [[deps.Revise]] deps = ["CodeTracking", "Distributed", "FileWatching", "JuliaInterpreter", "LibGit2", "LoweredCodeUtils", "OrderedCollections", "Pkg", "REPL", "Requires", "UUIDs", "Unicode"] -git-tree-sha1 = "1e597b93700fa4045d7189afa7c004e0584ea548" +git-tree-sha1 = "6990168abf3fe9a6e34ebb0e05aaaddf6572189e" uuid = "295af30f-e4ad-537b-8983-00126c2a3abe" -version = "3.5.3" +version = "3.5.10" [[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" @@ -1090,9 +1188,15 @@ version = "0.7.0" [[deps.Scratch]] deps = ["Dates"] -git-tree-sha1 = "30449ee12237627992a99d5e30ae63e4d78cd24a" +git-tree-sha1 = "3bac05bc7e74a75fd9cba4295cde4045d9fe2386" uuid = "6c6a2e73-6563-6170-7368-637461726353" -version = "1.2.0" +version = "1.2.1" + +[[deps.SentinelArrays]] +deps = ["Dates", "Random"] +git-tree-sha1 = "0e7508ff27ba32f26cd459474ca2ede1bc10991f" +uuid = "91c51154-3ec4-41a3-a24f-3f23e20d615c" +version = "1.4.1" [[deps.Serialization]] uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" @@ -1120,33 +1224,23 @@ version = "0.9.4" [[deps.Sixel]] deps = ["Dates", "FileIO", "ImageCore", "IndirectArrays", "OffsetArrays", "REPL", "libsixel_jll"] -git-tree-sha1 = "8fb59825be681d451c246a795117f317ecbcaa28" +git-tree-sha1 = "2da10356e31327c7096832eb9cd86307a50b1eb6" uuid = "45858cf5-a6b0-47a3-bbea-62219f50df47" -version = "0.1.2" +version = "0.1.3" [[deps.Sockets]] uuid = "6462fe0b-24de-5631-8697-dd941f90decc" [[deps.SortingAlgorithms]] deps = ["DataStructures"] -git-tree-sha1 = "c60ec5c62180f27efea3ba2908480f8055e17cee" +git-tree-sha1 = "5165dfb9fd131cf0c6957a3a7605dede376e7b63" uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c" -version = "1.1.1" +version = "1.2.0" [[deps.SparseArrays]] deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"] uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" -[[deps.SpecialFunctions]] -deps = ["IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] -git-tree-sha1 = "ef28127915f4229c971eb43f3fc075dd3fe91880" -uuid = "276daf66-3868-5448-9aa4-cd146d93841b" -version = "2.2.0" -weakdeps = ["ChainRulesCore"] - - [deps.SpecialFunctions.extensions] - SpecialFunctionsChainRulesCoreExt = "ChainRulesCore" - [[deps.StackViews]] deps = ["OffsetArrays"] git-tree-sha1 = "46e589465204cd0c08b4bd97385e4fa79a0c770c" @@ -1154,15 +1248,19 @@ uuid = "cae243ae-269e-4f55-b966-ac2d0dc13c15" version = "0.1.1" [[deps.StaticArrays]] -deps = ["LinearAlgebra", "Random", "StaticArraysCore", "Statistics"] -git-tree-sha1 = "832afbae2a45b4ae7e831f86965469a24d1d8a83" +deps = ["LinearAlgebra", "PrecompileTools", "Random", "StaticArraysCore"] +git-tree-sha1 = "5ef59aea6f18c25168842bded46b16662141ab87" uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.5.26" +version = "1.7.0" +weakdeps = ["Statistics"] + + [deps.StaticArrays.extensions] + StaticArraysStatisticsExt = "Statistics" [[deps.StaticArraysCore]] -git-tree-sha1 = "6b7ba252635a5eff6a0b0664a41ee140a1c9e72a" +git-tree-sha1 = "36b3d696ce6366023a0ea192b4cd442268995a0d" uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" -version = "1.4.0" +version = "1.4.2" [[deps.Statistics]] deps = ["LinearAlgebra", "SparseArrays"] @@ -1171,15 +1269,21 @@ version = "1.9.0" [[deps.StatsAPI]] deps = ["LinearAlgebra"] -git-tree-sha1 = "45a7769a04a3cf80da1c1c7c60caf932e6f4c9f7" +git-tree-sha1 = "1ff449ad350c9c4cbc756624d6f8a8c3ef56d3ed" uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0" -version = "1.6.0" +version = "1.7.0" [[deps.StatsBase]] deps = ["DataAPI", "DataStructures", "LinearAlgebra", "LogExpFunctions", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "StatsAPI"] -git-tree-sha1 = "75ebe04c5bed70b91614d684259b661c9e6274a4" +git-tree-sha1 = "1d77abd07f617c4868c33d4f5b9e1dbb2643c9cf" uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" -version = "0.34.0" +version = "0.34.2" + +[[deps.StringManipulation]] +deps = ["PrecompileTools"] +git-tree-sha1 = "a04cabe79c5f01f4d723cc6704070ada0b9d46d5" +uuid = "892a3eda-7b42-436c-8928-eab12a02cf0e" +version = "0.3.4" [[deps.SuiteSparse_jll]] deps = ["Artifacts", "Libdl", "Pkg", "libblastrampoline_jll"] @@ -1198,10 +1302,10 @@ uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c" version = "1.0.1" [[deps.Tables]] -deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits", "Test"] -git-tree-sha1 = "1544b926975372da01227b382066ab70e574a3ec" +deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits"] +git-tree-sha1 = "cb76cf677714c095e535e3501ac7954732aeea2d" uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" -version = "1.10.1" +version = "1.11.1" [[deps.Tar]] deps = ["ArgTools", "SHA"] @@ -1220,9 +1324,9 @@ uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [[deps.TiffImages]] deps = ["ColorTypes", "DataStructures", "DocStringExtensions", "FileIO", "FixedPointNumbers", "IndirectArrays", "Inflate", "Mmap", "OffsetArrays", "PkgVersion", "ProgressMeter", "UUIDs"] -git-tree-sha1 = "8621f5c499a8aa4aa970b1ae381aae0ef1576966" +git-tree-sha1 = "34cc045dd0aaa59b8bbe86c644679bc57f1d5bd0" uuid = "731e570b-9d59-4bfa-96dc-6df516fadf69" -version = "0.6.4" +version = "0.6.8" [[deps.TimerOutputs]] deps = ["ExprTools", "Printf"] @@ -1231,20 +1335,23 @@ uuid = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f" version = "0.5.23" [[deps.TranscodingStreams]] -deps = ["Random", "Test"] -git-tree-sha1 = "9a6ae7ed916312b41236fcef7e0af564ef934769" +git-tree-sha1 = "1fbeaaca45801b4ba17c251dd8603ef24801dd84" uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" -version = "0.9.13" +version = "0.10.2" +weakdeps = ["Random", "Test"] + + [deps.TranscodingStreams.extensions] + TestExt = ["Test", "Random"] [[deps.Tricks]] -git-tree-sha1 = "aadb748be58b492045b4f56166b5188aa63ce549" +git-tree-sha1 = "eae1bb484cd63b36999ee58be2de6c178105112f" uuid = "410a4b4d-49e4-4fbc-ab6d-cb71b17b3775" -version = "0.1.7" +version = "0.1.8" [[deps.URIs]] -git-tree-sha1 = "074f993b0ca030848b897beff716d93aca60f06a" +git-tree-sha1 = "67db6cc7b3821e19ebe75791a9dd19c9b1188f2b" uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4" -version = "1.4.2" +version = "1.5.1" [[deps.UUIDs]] deps = ["Random", "SHA"] @@ -1260,15 +1367,17 @@ uuid = "1cfade01-22cf-5700-b092-accc4b62d6e1" version = "0.4.1" [[deps.Unitful]] -deps = ["ConstructionBase", "Dates", "LinearAlgebra", "Random"] -git-tree-sha1 = "ba4aa36b2d5c98d6ed1f149da916b3ba46527b2b" +deps = ["Dates", "LinearAlgebra", "Random"] +git-tree-sha1 = "3c793be6df9dd77a0cf49d80984ef9ff996948fa" uuid = "1986cc42-f94f-5a68-af5c-568840ba703d" -version = "1.14.0" +version = "1.19.0" [deps.Unitful.extensions] + ConstructionBaseUnitfulExt = "ConstructionBase" InverseFunctionsUnitfulExt = "InverseFunctions" [deps.Unitful.weakdeps] + ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9" InverseFunctions = "3587e190-3f89-42d0-90ee-14403ec27112" [[deps.UnitfulLatexify]] @@ -1284,20 +1393,26 @@ version = "0.2.1" [[deps.UnsafeAtomicsLLVM]] deps = ["LLVM", "UnsafeAtomics"] -git-tree-sha1 = "ea37e6066bf194ab78f4e747f5245261f17a7175" +git-tree-sha1 = "323e3d0acf5e78a56dfae7bd8928c989b4f3083e" uuid = "d80eeb9a-aca5-4d75-85e5-170c8b632249" -version = "0.1.2" +version = "0.1.3" [[deps.Unzip]] git-tree-sha1 = "ca0969166a028236229f63514992fc073799bb78" uuid = "41fe7b60-77ed-43a1-b4f0-825fd5a5650d" version = "0.2.0" +[[deps.Vulkan_Loader_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Wayland_jll", "Xorg_libX11_jll", "Xorg_libXrandr_jll", "xkbcommon_jll"] +git-tree-sha1 = "2f0486047a07670caad3a81a075d2e518acc5c59" +uuid = "a44049a8-05dd-5a78-86c9-5fde0876e88c" +version = "1.3.243+0" + [[deps.Wayland_jll]] -deps = ["Artifacts", "Expat_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Pkg", "XML2_jll"] -git-tree-sha1 = "ed8d92d9774b077c53e1da50fd81a36af3744c1c" +deps = ["Artifacts", "EpollShim_jll", "Expat_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Pkg", "XML2_jll"] +git-tree-sha1 = "7558e29847e99bc3f04d6569e82d0f5c54460703" uuid = "a2964d1f-97da-50d4-b82a-358c7fce9d89" -version = "1.21.0+0" +version = "1.21.0+1" [[deps.Wayland_protocols_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -1307,15 +1422,15 @@ version = "1.25.0+0" [[deps.WoodburyMatrices]] deps = ["LinearAlgebra", "SparseArrays"] -git-tree-sha1 = "de67fa59e33ad156a590055375a30b23c40299d3" +git-tree-sha1 = "5f24e158cf4cee437052371455fe361f526da062" uuid = "efce3f68-66dc-5838-9240-27a6d6f5f9b6" -version = "0.5.5" +version = "0.5.6" [[deps.XML2_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "Zlib_jll"] -git-tree-sha1 = "93c41695bc1c08c46c5899f4fe06d6ead504bb73" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Zlib_jll"] +git-tree-sha1 = "da69178aacc095066bad1f69d2f59a60a1dd8ad1" uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a" -version = "2.10.3+0" +version = "2.12.0+0" [[deps.XSLT_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Libgcrypt_jll", "Libgpg_error_jll", "Libiconv_jll", "Pkg", "XML2_jll", "Zlib_jll"] @@ -1323,17 +1438,35 @@ git-tree-sha1 = "91844873c4085240b95e795f692c4cec4d805f8a" uuid = "aed1982a-8fda-507f-9586-7b0439959a61" version = "1.1.34+0" +[[deps.XZ_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "522b8414d40c4cbbab8dee346ac3a09f9768f25d" +uuid = "ffd25f8a-64ca-5728-b0f7-c24cf3aae800" +version = "5.4.5+0" + +[[deps.Xorg_libICE_jll]] +deps = ["Libdl", "Pkg"] +git-tree-sha1 = "e5becd4411063bdcac16be8b66fc2f9f6f1e8fe5" +uuid = "f67eecfb-183a-506d-b269-f58e52b52d7c" +version = "1.0.10+1" + +[[deps.Xorg_libSM_jll]] +deps = ["Libdl", "Pkg", "Xorg_libICE_jll"] +git-tree-sha1 = "4a9d9e4c180e1e8119b5ffc224a7b59d3a7f7e18" +uuid = "c834827a-8449-5923-a945-d239c165b7dd" +version = "1.2.3+0" + [[deps.Xorg_libX11_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libxcb_jll", "Xorg_xtrans_jll"] -git-tree-sha1 = "5be649d550f3f4b95308bf0183b82e2582876527" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_libxcb_jll", "Xorg_xtrans_jll"] +git-tree-sha1 = "afead5aba5aa507ad5a3bf01f58f82c8d1403495" uuid = "4f6342f7-b3d2-589e-9d20-edeb45f2b2bc" -version = "1.6.9+4" +version = "1.8.6+0" [[deps.Xorg_libXau_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "4e490d5c960c314f33885790ed410ff3a94ce67e" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "6035850dcc70518ca32f012e46015b9beeda49d8" uuid = "0c0b7dd1-d40b-584c-a123-a41640f87eec" -version = "1.0.9+4" +version = "1.0.11+0" [[deps.Xorg_libXcursor_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXfixes_jll", "Xorg_libXrender_jll"] @@ -1342,10 +1475,10 @@ uuid = "935fb764-8cf2-53bf-bb30-45bb1f8bf724" version = "1.2.0+4" [[deps.Xorg_libXdmcp_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "4fe47bd2247248125c428978740e18a681372dd4" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "34d526d318358a859d7de23da945578e8e8727b7" uuid = "a3789734-cfe1-5b06-b2d0-1dd0d9d62d05" -version = "1.1.3+4" +version = "1.1.4+0" [[deps.Xorg_libXext_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"] @@ -1384,22 +1517,28 @@ uuid = "ea2f1a96-1ddc-540d-b46f-429655e07cfa" version = "0.9.10+4" [[deps.Xorg_libpthread_stubs_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "6783737e45d3c59a4a4c4091f5f88cdcf0908cbb" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "8fdda4c692503d44d04a0603d9ac0982054635f9" uuid = "14d82f49-176c-5ed1-bb49-ad3f5cbd8c74" -version = "0.1.0+3" +version = "0.1.1+0" [[deps.Xorg_libxcb_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "XSLT_jll", "Xorg_libXau_jll", "Xorg_libXdmcp_jll", "Xorg_libpthread_stubs_jll"] -git-tree-sha1 = "daf17f441228e7a3833846cd048892861cff16d6" +deps = ["Artifacts", "JLLWrappers", "Libdl", "XSLT_jll", "Xorg_libXau_jll", "Xorg_libXdmcp_jll", "Xorg_libpthread_stubs_jll"] +git-tree-sha1 = "b4bfde5d5b652e22b9c790ad00af08b6d042b97d" uuid = "c7cfdc94-dc32-55de-ac96-5a1b8d977c5b" -version = "1.13.0+3" +version = "1.15.0+0" [[deps.Xorg_libxkbfile_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"] -git-tree-sha1 = "926af861744212db0eb001d9e40b5d16292080b2" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_libX11_jll"] +git-tree-sha1 = "730eeca102434283c50ccf7d1ecdadf521a765a4" uuid = "cc61e674-0454-545c-8b26-ed2c68acab7a" -version = "1.1.0+4" +version = "1.1.2+0" + +[[deps.Xorg_xcb_util_cursor_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_xcb_util_image_jll", "Xorg_xcb_util_jll", "Xorg_xcb_util_renderutil_jll"] +git-tree-sha1 = "04341cb870f29dcd5e39055f895c39d016e18ccd" +uuid = "e920d4aa-a673-5f3a-b3d7-f755a4d47c43" +version = "0.1.4+0" [[deps.Xorg_xcb_util_image_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] @@ -1432,22 +1571,22 @@ uuid = "c22f9ab0-d5fe-5066-847c-f4bb1cd4e361" version = "0.4.1+1" [[deps.Xorg_xkbcomp_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libxkbfile_jll"] -git-tree-sha1 = "4bcbf660f6c2e714f87e960a171b119d06ee163b" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_libxkbfile_jll"] +git-tree-sha1 = "330f955bc41bb8f5270a369c473fc4a5a4e4d3cb" uuid = "35661453-b289-5fab-8a00-3d9160c6a3a4" -version = "1.4.2+4" +version = "1.4.6+0" [[deps.Xorg_xkeyboard_config_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xkbcomp_jll"] -git-tree-sha1 = "5c8424f8a67c3f2209646d4425f3d415fee5931d" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_xkbcomp_jll"] +git-tree-sha1 = "691634e5453ad362044e2ad653e79f3ee3bb98c3" uuid = "33bec58e-1273-512f-9401-5d533626f822" -version = "2.27.0+4" +version = "2.39.0+0" [[deps.Xorg_xtrans_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "79c31e7844f6ecf779705fbc12146eb190b7d845" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "e92a1a012a10506618f10b7047e478403a046c77" uuid = "c5fb5394-a638-5e4d-96e5-b29de1b5cf10" -version = "1.4.0+3" +version = "1.5.0+0" [[deps.Zlib_jll]] deps = ["Libdl"] @@ -1460,11 +1599,23 @@ git-tree-sha1 = "49ce682769cd5de6c72dcf1b94ed7790cd08974c" uuid = "3161d3a3-bdf6-5164-811a-617609db77b4" version = "1.5.5+0" +[[deps.eudev_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "gperf_jll"] +git-tree-sha1 = "431b678a28ebb559d224c0b6b6d01afce87c51ba" +uuid = "35ca27e7-8b34-5b7f-bca9-bdc33f59eb06" +version = "3.2.9+0" + [[deps.fzf_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "868e669ccb12ba16eaf50cb2957ee2ff61261c56" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "a68c9655fbe6dfcab3d972808f1aafec151ce3f8" uuid = "214eeab7-80f7-51ab-84ad-2988db7cef09" -version = "0.29.0+0" +version = "0.43.0+0" + +[[deps.gperf_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "3516a5630f741c9eecb3720b1ec9d8edc3ecc033" +uuid = "1a1c6b14-54f6-533d-8383-74cd7377aa70" +version = "3.1.1+0" [[deps.libaom_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -1483,12 +1634,24 @@ deps = ["Artifacts", "Libdl"] uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" version = "5.8.0+0" +[[deps.libevdev_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "141fe65dc3efabb0b1d5ba74e91f6ad26f84cc22" +uuid = "2db6ffa8-e38f-5e21-84af-90c45d0032cc" +version = "1.11.0+0" + [[deps.libfdk_aac_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] git-tree-sha1 = "daacc84a041563f965be61859a36e17c4e4fcd55" uuid = "f638f0a6-7fb0-5443-88ba-1cc74229b280" version = "2.0.2+0" +[[deps.libinput_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "eudev_jll", "libevdev_jll", "mtdev_jll"] +git-tree-sha1 = "ad50e5b90f222cfe78aa3d5183a20a12de1322ce" +uuid = "36db933b-70db-51c0-b978-0f229ee0e533" +version = "1.18.0+0" + [[deps.libpng_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] git-tree-sha1 = "94d180a6d2b5e55e447e2d27a29ed04fe79eb30c" @@ -1507,10 +1670,16 @@ git-tree-sha1 = "b910cb81ef3fe6e78bf6acee440bda86fd6ae00c" uuid = "f27f6e37-5d2b-51aa-960f-b287f2bc3b7a" version = "1.3.7+1" +[[deps.mtdev_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "814e154bdb7be91d78b6802843f76b6ece642f11" +uuid = "009596ad-96f7-51b1-9f1b-5ce2d5e8a71e" +version = "1.1.6+0" + [[deps.nghttp2_jll]] deps = ["Artifacts", "Libdl"] uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" -version = "1.48.0+0" +version = "1.52.0+1" [[deps.p7zip_jll]] deps = ["Artifacts", "Libdl"] @@ -1531,6 +1700,6 @@ version = "3.5.0+0" [[deps.xkbcommon_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Wayland_jll", "Wayland_protocols_jll", "Xorg_libxcb_jll", "Xorg_xkeyboard_config_jll"] -git-tree-sha1 = "9ebfc140cc56e8c2156a15ceac2f0302e327ac0a" +git-tree-sha1 = "9c304562909ab2bab0262639bd4f444d7bc2be37" uuid = "d8fb68d0-12a3-5cfd-a85a-d49703b185fd" -version = "1.4.1+0" +version = "1.4.1+1" diff --git a/examples/Project.toml b/examples/Project.toml index e268faa..2331e46 100644 --- a/examples/Project.toml +++ b/examples/Project.toml @@ -4,8 +4,10 @@ ImageIO = "82e4d734-157c-48bb-816b-45c225c6df19" ImageShow = "4e3cecfd-b093-5904-9786-8bbb286a6a31" IndexFunArrays = "613c443e-d742-454e-bfc6-1d7f8dd76566" Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59" +KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" Pluto = "c3e4b0f8-55cb-11ea-2926-15256bba5781" +PlutoTest = "cb4044da-4d16-4ffa-a6a3-8cad7f73ebdc" PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8" RadonKA = "86de8297-835b-47df-b249-c04e8db91db5" Revise = "295af30f-e4ad-537b-8983-00126c2a3abe" diff --git a/examples/example.jl b/examples/example.jl index af01cae..91ec114 100644 --- a/examples/example.jl +++ b/examples/example.jl @@ -1,5 +1,5 @@ ### A Pluto.jl notebook ### -# v0.19.26 +# v0.19.32 using Markdown using InteractiveUtils @@ -38,16 +38,20 @@ md"# Simple Image" # ╔═╡ 1c9d828d-eb69-4792-9fdb-9698939ba69f begin - img = zeros(Float32, (768, 768, 3)) + #img = zeros(Float32, (512, 512, 1)) - img .+= box(img, (60,30, 300), offset=(300, 250, 10)) - img .+= box(img, (100,300, 300), offset=(150, 250, 10)) + #img .+= box(img, (60,30, 300), offset=(300, 250, 10)) + #img .+= box(img, (100,300, 300), offset=(150, 250, 10))# - img .+= rr2(img, offset=(300, 350, 10)) .< 60^2 - img .-= rr2(img, offset=(300, 350, 10)) .< 40^2 - img .+= rr2(img, offset=(300, 350, 10)) .< 20^2 +# img .+= rr2(img, offset=(300, 350, 10)) .< 60^2 +# img .-= rr2(img, offset=(300, 350, 10)) .< 40^2 +# img .+= rr2(img, offset=(300, 350, 10)) .< 20^2 - #img .+= box(img, (20,10), offset=(140, 100)) + #img .+= box(img, (20,10, 3), offset=(320, 320, 1)) + + img = box(Float32, (512, 512, 1), (40, 40, 1), offset=(55, 80, 1)) |> collect + + img .+= 0.0f0 .+ (rr2(Float32, (512, 512), offset=(150, 120)) .< 50 .^2) end; # ╔═╡ 105f9f3e-9af8-415c-b191-2c03da508c01 @@ -60,22 +64,28 @@ simshow(img[:, :, depth]) md"# Radon Transform" # ╔═╡ 937e9211-e37d-4424-82d3-7542d9ce934d -θs = range(0f0, Float32(π), 1000) +θs = range(0f0, Float32(2π), 361) # ╔═╡ c3fa0010-b173-482d-b1f8-84683ed4927f -@time sinogram = radon(img, θs, 0.003f0); +@time sinogram = radon(img, θs, nothing); + +# ╔═╡ 7ca0d6b9-880c-4d3f-b609-954ad251cf93 +size(sinogram) # ╔═╡ b79839d8-c0c7-4534-9140-ee1efc624f88 img_c = CuArray(img); # ╔═╡ e5daf24c-c814-45bc-b00c-d0a0080ed60c -CUDA.@time CUDA.@sync sinogram_c = radon(img_c, θs, 0.003f0, backend=CUDABackend()); +begin + CUDA.@time CUDA.@sync sinogram_c = radon(img_c, θs, backend=CUDABackend()); + sinogram_c = sinogram_c + circshift(sinogram_c, (0, 1)) + circshift(sinogram_c, (0, 2)) +circshift(sinogram_c, (0, 3))+ circshift(sinogram_c, (0, -1)) + circshift(sinogram_c, (0, -2))+ circshift(sinogram_c, (0, -3)) +end; # ╔═╡ 4e039f6a-dfa8-4fe2-8680-2ec2646e6788 @bind depth2 Slider(1:size(img, 3), show_value=true) # ╔═╡ 80c0c8da-87ec-4d2f-b389-198e0ddb49ac -simshow(sinogram[:, :, depth2]) +simshow(Array(sinogram_c)[:, :, depth2]) # ╔═╡ f88a45d5-181b-4afd-94f3-0584ce14af1f md"# Iradon Transform" @@ -131,6 +141,7 @@ simshow(Array(img_filtered_c)[:, :, depth3]) # ╟─db6f96e5-cbad-40f6-abda-09f64ce988ff # ╠═937e9211-e37d-4424-82d3-7542d9ce934d # ╠═c3fa0010-b173-482d-b1f8-84683ed4927f +# ╠═7ca0d6b9-880c-4d3f-b609-954ad251cf93 # ╠═b79839d8-c0c7-4534-9140-ee1efc624f88 # ╠═e5daf24c-c814-45bc-b00c-d0a0080ed60c # ╟─4e039f6a-dfa8-4fe2-8680-2ec2646e6788 diff --git a/examples/example_radon_iradon.jl b/examples/example_radon_iradon.jl new file mode 100644 index 0000000..36b4860 --- /dev/null +++ b/examples/example_radon_iradon.jl @@ -0,0 +1,106 @@ +### A Pluto.jl notebook ### +# v0.19.32 + +using Markdown +using InteractiveUtils + +# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error). +macro bind(def, element) + quote + local iv = try Base.loaded_modules[Base.PkgId(Base.UUID("6e696c72-6542-2067-7265-42206c756150"), "AbstractPlutoDingetjes")].Bonds.initial_value catch; b -> missing; end + local el = $(esc(element)) + global $(esc(def)) = Core.applicable(Base.get, el) ? Base.get(el) : iv(el) + el + end +end + +# ╔═╡ 4eb3148e-8f8b-11ee-3cfe-854d3bd5cc80 +begin + using Pkg + Pkg.activate(".") + using Revise +end + +# ╔═╡ 4ee97893-5e8f-42cf-9ecd-c63c9db76869 +using RadonKA + +# ╔═╡ 1311e853-c4cd-42bb-8bf3-5e0d564bf9c5 +using IndexFunArrays, ImageShow, Plots, ImageIO, PlutoUI, PlutoTest + +# ╔═╡ 03bccb92-b47f-477a-9bdb-74cc404da690 +using KernelAbstractions, CUDA, CUDA.CUDAKernels + +# ╔═╡ d25c1381-baf1-429b-8150-622b8f731d83 +md"# Example Image" + +# ╔═╡ 54208d78-cf55-41d7-b4bf-6d1ab4927bbb +begin + N = 320 + N_z = 100 + img = box(Float32, (N, N, N_z), (N ÷4, N ÷ 4, 20), offset=(N ÷ 2 + 50, N ÷ 2 -100, N_z ÷ 2)) |> collect + + img .+= 0.0f0 .+ (rr2(Float32, (N, N, N_z)) .< 100 .^2) + + #img = box(Float32, (100, 100), (3, 3), offset=(51, 51)) |> collect +end; + +# ╔═╡ 1393d029-66be-40aa-a2f9-f31317222575 +img_c = CuArray(img); + +# ╔═╡ 8be220a4-293d-411d-bbce-e39b64780814 +md"# Radon Transform" + +# ╔═╡ b8618268-0892-4abc-ae26-e25e41d07968 +angles = range(0f0, 2f0π, 360) + +# ╔═╡ d2cc6fc6-135b-4c4a-8453-9c5bf9e4a24f +@time sinogram = radon(img, angles); + +# ╔═╡ dc14103d-993c-402f-a8b5-a35843f3f4ac +CUDA.@time CUDA.@sync sinogram_c = radon(img_c, CuArray(angles), + backend=CUDABackend()); + +# ╔═╡ 783f05e0-2640-4ecd-8c19-1c15a99ee294 +@bind i_z Slider(1:size(sinogram, 3), show_value=true) + +# ╔═╡ 01b4b8f8-37d5-425f-975e-ebb3890d8624 +simshow(img[:, :, i_z]) + +# ╔═╡ db2676fd-3305-408f-93b4-08a3d04fdd02 +@test sinogram ≈ Array(sinogram_c) + +# ╔═╡ 1a931e03-6a29-4c3e-b66f-bc1b5936a6f4 +simshow(sinogram[:, :, i_z]) + +# ╔═╡ 3d584d94-b88f-4738-a470-7db1fb3fb996 +simshow(Array(sinogram_c[:, :, i_z])) + +# ╔═╡ edbf1577-0fd4-4261-bd04-499bc1a0debd +md"# IRadon Transform" + +# ╔═╡ ed54c930-4f34-4f3d-9180-514dc59fde15 + + +# ╔═╡ 365ee0e7-3545-4345-8b0c-8338a59c53b3 + + +# ╔═╡ Cell order: +# ╠═4eb3148e-8f8b-11ee-3cfe-854d3bd5cc80 +# ╠═4ee97893-5e8f-42cf-9ecd-c63c9db76869 +# ╠═1311e853-c4cd-42bb-8bf3-5e0d564bf9c5 +# ╠═03bccb92-b47f-477a-9bdb-74cc404da690 +# ╟─d25c1381-baf1-429b-8150-622b8f731d83 +# ╠═54208d78-cf55-41d7-b4bf-6d1ab4927bbb +# ╠═1393d029-66be-40aa-a2f9-f31317222575 +# ╠═01b4b8f8-37d5-425f-975e-ebb3890d8624 +# ╟─8be220a4-293d-411d-bbce-e39b64780814 +# ╠═b8618268-0892-4abc-ae26-e25e41d07968 +# ╠═d2cc6fc6-135b-4c4a-8453-9c5bf9e4a24f +# ╠═dc14103d-993c-402f-a8b5-a35843f3f4ac +# ╟─783f05e0-2640-4ecd-8c19-1c15a99ee294 +# ╠═db2676fd-3305-408f-93b4-08a3d04fdd02 +# ╠═1a931e03-6a29-4c3e-b66f-bc1b5936a6f4 +# ╠═3d584d94-b88f-4738-a470-7db1fb3fb996 +# ╠═edbf1577-0fd4-4261-bd04-499bc1a0debd +# ╠═ed54c930-4f34-4f3d-9180-514dc59fde15 +# ╠═365ee0e7-3545-4345-8b0c-8338a59c53b3 diff --git a/src/RadonKA.jl b/src/RadonKA.jl index c58a833..5eceec0 100644 --- a/src/RadonKA.jl +++ b/src/RadonKA.jl @@ -1,39 +1,12 @@ module RadonKA -using KernelAbstractions, CUDA, CUDA.CUDAKernels, Adapt, Interpolations +using KernelAbstractions, CUDA, CUDA.CUDAKernels using IndexFunArrays using FFTW +include("utils.jl") include("radon.jl") include("iradon.jl") -# TODO -# * try allocating sin(θ) and cos(θ) since we only need those - - - -function distance_to_boundary(x, y, θ, R) - # avoid division by zero - if iszero(x) && iszero(y) - return R - end - - d = sqrt(x^2 + y^2) - α = acos(x/d) - β = y <= 0 ? π - θ - α : π - θ + α - - function quadratic_solve(a,b,c) -# if b^2 - 4 * a * c < 0 -# @show x,y,θ -# end - return (- b + sqrt(b^2 - 4 * a * c)) / 2 / a - end - - - res = quadratic_solve(1, -2 * d * cos(β), d^2 - R^2) - - return res -end - end diff --git a/src/iradon.jl b/src/iradon.jl index c71fb97..5e58a2a 100644 --- a/src/iradon.jl +++ b/src/iradon.jl @@ -1,80 +1,111 @@ export iradon -function filtered_backprojection(sinogram::AbstractArray{T, 3}, θs, μ=nothing; backend=CPU()) where T - filter = similar(sinogram, (size(sinogram, 1),)) - filter .= rr(T, (size(sinogram, 1), )) - p = plan_fft(sinogram, (1,)) - sinogram = real(inv(p) * (p * sinogram .* ifftshift(filter))) - return iradon(sinogram, θs, μ, backend=backend) -end +""" + radon(I, θs; backend=CPU()) -function iradon(sinogram::AbstractArray{T}, θs, μ=nothing; backend=CPU()) where T - sz = (size(sinogram, 1), size(sinogram, 1), size(sinogram, 3)) - @assert iseven(sz[1]) "Array needs to have a even number along x and y" - @assert μ === nothing || typeof(μ) == T "Either choose μ=nothing or with a Float type being equal to $(T)" +Calculates the parallel radon transform of the three dimensional AbstractArray `I`. +The first two dimensions are y and x. The third dimension is z, the rotational axis. - kernel! = iradon_kernel!(backend) +`θs` is a vector or range storing the angles in radians. - sinogram_itp = let - if sinogram isa CuArray - sinogram_itp = interpolate(sinogram, (BSpline(Linear()), NoInterp(), NoInterp())) - sinogram_itp = adapt(CuArray{eltype(sinogram)}, sinogram_itp); - else - sinogram_itp = interpolate(sinogram, (BSpline(Linear()), NoInterp(), NoInterp())) - end - end - - # center coordinate - cc = sz[1] ÷ 2 + 1 - # radius of the object, no rays outside of the radius are considered - R = (sz[1] - 1) ÷ 2 - +`backend` can be either `CPU()` for multithreaded CPU execution or +`CUDABackend()` for CUDA execution. + + +Please note: the implementation is not quite optimize for cache efficiency and +it is a very naive algorithm. But still, it is quite fast. +""" +function radon(img::AbstractArray{T, 3}, angles::AbstractArray{T, 1}; + backend=CPU()) where T + @assert iseven(size(img, 1)) && iseven(size(img, 2)) + # this is the actual size we are using for calculation + N = size(img, 1) - 1 + N_angles = size(angles, 1) + + # the only significant allocation + sinogram = similar(img, (N, N_angles, size(img, 3))) + fill!(sinogram, 0) - # output - I_s = similar(sinogram, (sz[1], sz[2], sz[3])) - fill!(I_s, 0) - # maybe sz[1] - 1 - kernel!(I_s, sinogram_itp, θs, cc, R, μ, ndrange=(sz[1], sz[2], sz[3])) - + # radius of the cylinder we are projecting through + radius = size(img, 1) ÷ 2 - 1 + # mid point, it is actually N ÷ 2 + 1 + # but because of how adress the indices, we need 1.5 instead of +1 + mid = size(img, 1) ÷ 2 + T(1.5) + # the y_dists samplings, in principle we can add this as function parameter + y_dists = similar(img, (size(img, 1) - 1, )) + y_dists .= -radius:radius - #@show maximum(I_s) - #I_s ./= maximum(I_s) + #@show typeof(sinogram), typeof(img), typeof(y_dists), typeof(angles) + kernel! = radon_kernel!(backend) + kernel!(sinogram::AbstractArray{T}, img, y_dists, angles, mid, radius, + ndrange=(N_angles,N, size(img, 3))) - return I_s + return sinogram end +""" + radon_kernel!(sinogram, img, + y_dists, angles, mid, radius) + +""" +@kernel function radon_kernel!(sinogram::AbstractArray{T}, + img, y_dists, angles, mid, radius) where T + # r is the index of the angles + # k is the index of the detector spatial coordinate + # i_z is the index for the z dimension + r, k, i_z = @index(Global, NTuple) + + angle = angles[r] + sinα, cosα = sincos(angle) + + # x0, y0, x1, y1 beginning and end point of each ray + a, b, c, d = next_ray_on_circle(img, angle, y_dists[k], mid, radius, sinα, cosα) + + # different comparisons depending which direction the ray is propagating + cac = a <= c ? (a,c) -> a<=c : (a,c) -> a>=c + cbd = b <= d ? (b,d) -> b<=d : (b,d) -> b>=d -@kernel function iradon_kernel!(I_s::AbstractArray{T}, sinogram_itp, - θs, cc, R, μ) where T - i_y, i_x, i_z = @index(Global, NTuple) - - - y = i_y - cc - x = i_x - cc - - r2 = x^2 + y^2 - - # only consider everything inside the radius - if r2 <= R^2 - tmp = zero(T) - - if μ === nothing - for iθ = 1:length(θs) - θ = θs[iθ] - xn = +cos(θ) * y + x * sin(θ) + cc - 1 - tmp += sinogram_itp(xn, iθ, i_z) - end - else - for iθ = 1:length(θs) - θ = θs[iθ] - xn = +cos(θ) * y + x * sin(θ) + cc - 1 - d = abs(distance_to_boundary(x, -y, θ, R)) - tmp += sinogram_itp(xn, iθ, i_z) * exp(-μ * d) - end - end - I_s[i_y, i_x, i_z] = tmp + l = 1 + # acculumators of the intensity + tmp = zero(T) + while cac(a, c) && cbd(b, d) + a_old, b_old = a, b + # would be good to move this branch outside of the while loop + # but maybe branch prediction is doing a good job here + if a ≈ c && b ≈ d + break + end + + # find the next intersection for the ray + @inline a, b = find_next_intersection(a,b,c,d) + l += 1 + + # find the cell it is cutting through + @inline cell_i, cell_j = find_cell((a_old, b_old), + (a, b)) + + # distance travelled through that cell + distance = sqrt((a_old - a) ^2 + + (b_old - b) ^2) + # cell value times distance travelled through + @inbounds tmp += distance * img[cell_i, cell_j, i_z] end + @inbounds sinogram[k, r, i_z] = tmp +end + + + + + +function filtered_backprojection(sinogram::AbstractArray{T, 3}, θs, μ=nothing; backend=CPU()) where T + filter = similar(sinogram, (size(sinogram, 1),)) + filter .= rr(T, (size(sinogram, 1), )) + + p = plan_fft(sinogram, (1,)) + sinogram = real(inv(p) * (p * sinogram .* ifftshift(filter))) + return iradon(sinogram, θs, μ, backend=backend) end + diff --git a/src/radon.jl b/src/radon.jl index 4107d25..d44c3a3 100644 --- a/src/radon.jl +++ b/src/radon.jl @@ -15,80 +15,80 @@ The first two dimensions are y and x. The third dimension is z, the rotational a Please note: the implementation is not quite optimize for cache efficiency and it is a very naive algorithm. But still, it is quite fast. """ -function radon(I::AbstractArray{T, 3}, θs, μ=nothing; backend=CPU()) where T - sz = size(I) - @assert sz[1] == sz[2] - @assert iseven(sz[1]) "Array needs to have a even number along x and y" - @assert μ === nothing || typeof(μ) == T "Either choose μ=nothing or with a Float type being equal to $(T)" - +function radon(img::AbstractArray{T, 3}, angles::AbstractArray{T, 1}; + backend=CPU()) where T + @assert iseven(size(img, 1)) && iseven(size(img, 2)) + # this is the actual size we are using for calculation + N = size(img, 1) - 1 + N_angles = size(angles, 1) + + # the only significant allocation + sinogram = similar(img, (N, N_angles, size(img, 3))) + fill!(sinogram, 0) + + # radius of the cylinder we are projecting through + radius = size(img, 1) ÷ 2 - 1 + # mid point, it is actually N ÷ 2 + 1 + # but because of how adress the indices, we need 1.5 instead of +1 + mid = size(img, 1) ÷ 2 + T(1.5) + # the y_dists samplings, in principle we can add this as function parameter + y_dists = similar(img, (size(img, 1) - 1, )) + y_dists .= -radius:radius + + #@show typeof(sinogram), typeof(img), typeof(y_dists), typeof(angles) kernel! = radon_kernel!(backend) - - I_itp = let - if I isa CuArray - I_itp = interpolate(I, (BSpline(Linear()), BSpline(Linear()), NoInterp())) - I_itp = adapt(CuArray{eltype(I)}, I_itp); - else - I_itp = interpolate(I, (BSpline(Linear()), BSpline(Linear()), NoInterp())) - end - end - - # center coordinate - cc = sz[1] ÷ 2 + 1 - # radius of the object, no rays outside of the radius are considered - R = (sz[1] - 3) ÷ 2 + kernel!(sinogram::AbstractArray{T}, img, y_dists, angles, mid, radius, + ndrange=(N_angles,N, size(img, 3))) - # all rays, in index steps - rays_y = -R:one(T):R - - prop = 0:2*R - - sinogram = similar(I, size(I, 1), length(θs), size(I, 3)) - fill!(sinogram, 0) - - kernel!(sinogram, I_itp, θs, rays_y, prop, cc, R, μ, ndrange=(length(rays_y), length(θs), sz[3])) - - return sinogram end -@kernel function radon_kernel!(sinogram::AbstractArray{T}, I_itp, - θs, rays_y, prop, cc, R, μ) where T - i_rays_y, iθ, i_z = @index(Global, NTuple) +""" + radon_kernel!(sinogram, img, + y_dists, angles, mid, radius) + +""" +@kernel function radon_kernel!(sinogram::AbstractArray{T}, + img, y_dists, angles, mid, radius) where T + # r is the index of the angles + # k is the index of the detector spatial coordinate + # i_z is the index for the z dimension + r, k, i_z = @index(Global, NTuple) - θ = θs[iθ] - sθ = -sin(θ) - cθ = cos(θ) + angle = angles[r] + sinα, cosα = sincos(angle) - y_ray = rays_y[i_rays_y] + # x0, y0, x1, y1 beginning and end point of each ray + a, b, c, d = next_ray_on_circle(img, angle, y_dists[k], mid, radius, sinα, cosα) - # x is the coordinate being on the circle - x_s = R * cos(asin(T(y_ray) / R)) - x = cc + x_s * cθ - y_ray * sθ - y = cc + x_s * sθ + y_ray * cθ - #factor = exp(T(-0.01)) - #value = sinogram[round(Int, y_ray) + cc - 1 , i_z, iθ] + # different comparisons depending which direction the ray is propagating + cac = a <= c ? (a,c) -> a<=c : (a,c) -> a>=c + cbd = b <= d ? (b,d) -> b<=d : (b,d) -> b>=d + l = 1 + # acculumators of the intensity tmp = zero(T) + while cac(a, c) && cbd(b, d) + a_old, b_old = a, b + # would be good to move this branch outside of the while loop + # but maybe branch prediction is doing a good job here + if a ≈ c && b ≈ d + break + end - if μ === nothing - for i_prop = 1:round(Int, (2 * x_s) / prop[end] * length(prop)) - prop_dist = prop[i_prop] - Δy = - sθ * prop_dist - Δx = - cθ * prop_dist - tmp += I_itp(y + Δy, x + Δx, i_z) - end - else - for i_prop = 1:round(Int, (2 * x_s) / prop[end] * length(prop)) - prop_dist = prop[i_prop] - Δy = - sθ * prop_dist - Δx = - cθ * prop_dist - d = abs(distance_to_boundary(x + Δx - cc, -(y + Δy - cc), θ, R)) - h = I_itp(y + Δy, x + Δx, i_z) - tmp += h * exp(-μ * d) - end - end - - sinogram[round(Int, y_ray) + cc - 1, iθ, i_z] = tmp -end + # find the next intersection for the ray + @inline a, b = find_next_intersection(a,b,c,d) + l += 1 + # find the cell it is cutting through + @inline cell_i, cell_j = find_cell((a_old, b_old), + (a, b)) + # distance travelled through that cell + distance = sqrt((a_old - a) ^2 + + (b_old - b) ^2) + # cell value times distance travelled through + @inbounds tmp += distance * img[cell_i, cell_j, i_z] + end + @inbounds sinogram[k, r, i_z] = tmp +end diff --git a/src/utils.jl b/src/utils.jl new file mode 100644 index 0000000..2732e01 --- /dev/null +++ b/src/utils.jl @@ -0,0 +1,181 @@ +function find_next_intersection(x₀::T, y₀::T, x₁::T, y₁::T) where T + + f(t) = (x₀, y₀) .+ t .* (x₁ - x₀, y₁ - y₀) + + if x₁ >= x₀ + if (ceil(x₀) - x₀) != 0 + ts_x = (ceil(x₀) - x₀) / (x₁ - x₀) + else + ts_x = (ceil(x₀) - x₀ + 1) / (x₁ - x₀) + end + else + if (floor(x₀) - x₀) != 0 + ts_x = (floor(x₀) - x₀) / (x₁ - x₀) + else + ts_x = (floor(x₀) - x₀ - 1) / (x₁ - x₀) + end + end + + if y₁ >= y₀ + if (ceil(y₀) - y₀) != 0 + ts_y = (ceil(y₀) .- y₀) ./ (y₁ .- y₀) + else + ts_y = (ceil(y₀) .- y₀ + 1) ./ (y₁ .- y₀) + end + else + if (floor(y₀) - y₀) != 0 + ts_y = (floor(y₀) - y₀) / (y₁ - y₀) + else + ts_y = (floor(y₀) - y₀ - 1) / (y₁ - y₀) + end + end + + # some weird edge cases + if ts_y < ts_x && ts_y != T(Inf) + return f(ts_y) + else + return f(ts_x) + end +end + + +# based on this: https://cs.stackexchange.com/questions/132887/determining-the-intersections-of-a-line-segment-and-grid +function find_intersections(x₀::T, y₀::T, x₁::T, y₁::T) where T + if x₀ ≈ x₁ && y₀ ≈ y₁ + return Array{T, 2}(undef, 2, 0) + end + + f(t) = (x₀, y₀) .+ t .* (x₁ - x₀, y₁ - y₀) + + # avoid division by zero + if x₁ != x₀ + if x₁ >= x₀ + ts_x = ((ceil(x₀):floor(x₁)) .- x₀) ./ (x₁ .- x₀) + else + ts_x = ((floor(x₀):-1:ceil(x₁)) .- x₀) ./ (x₁ .- x₀) + end + else + ts_x = T[] + end + + if y₁ != y₀ + if y₁ >= y₀ + ts_y = ((ceil(y₀):floor(y₁)) .- y₀) ./ (y₁ .- y₀) + else + ts_y = ((floor(y₀):-1:ceil(y₁)) .- y₀) ./ (y₁ .- y₀) + end + else + ts_y = T[] + end + + i, j = 1, 1 + points = Array{T, 2}(undef, 2, length(ts_x) + length(ts_y)) + + # do a sorted merge of the twlists + while i ≤ length(ts_x) && j ≤ length(ts_y) + if ts_x[i] < ts_y[j] + points[:, i + j - 1] .= f(ts_x[i]) + i += 1 + else + points[:, i + j - 1] .= f(ts_y[j]) + j += 1 + end + end + + # if one of the lists has leftovers, add them + while j ≤ length(ts_y) + points[:, i + j - 1] .= f(ts_y[j]) + j += 1 + end + + while i ≤ length(ts_x) + points[:, i + j - 1] .= f(ts_x[i]) + i += 1 + end + + # some points occur multiple times, filter them out + if points[:, begin] == points[:, begin + 1] + startoffset = 1 + else + startoffset = 0 + end + + if points[:, end] == points[:, end - 1] + endoffset = 1 + else + endoffset = 0 + end + + return points[:, begin + startoffset : end - endoffset] +end + + +""" + find_cell(a, b) + +Find the correct intersected cell. +`a` and `b` are a Vector of length 2 + +Cells are identified by the coordinates in the lower left +corner of the cell. + + +|---------------------------| +| | | | +|(3,1) |(3,2) |(3,3) | +|--------|---------|--------| +| | | | +|(2,1) |(2,2) |(2,3) | +|--------|---------|--------| +| | | | +|(1,1) |(1,2) |(1,3) | +|--------|---------|--------| +""" +@inline function find_cell(a, b) + T = eltype(a) + x = floor(Int, (b[1] + a[1]) / 2) + y = floor(Int, (b[2] + a[2]) / 2) + return x, y +end + + +function next_ray_on_circle(img, angle, y_dist, mid, radius, sinα, cosα) + x_dist = sqrt(radius^2 - y_dist^2) + x_dist_end = -x_dist + y_dist_end = y_dist + + x_dist_rot = mid + cosα * x_dist - sinα * y_dist + y_dist_rot = mid + sinα * x_dist + cosα * y_dist + + x_dist_end_rot = mid + cosα * x_dist_end - sinα * y_dist_end + y_dist_end_rot = mid + sinα * x_dist_end + cosα * y_dist_end + return x_dist_rot, y_dist_rot, x_dist_end_rot, y_dist_end_rot +end + + +function rays_on_circle(img, angle) + radius = size(img, 1) ÷ 2 - 1 + mid = size(img, 1) ÷ 2 + 1.5f0 + + y_dists = similar(img, (size(img, 1) - 1)) + y_dists .= -radius:radius + y_dists_end = copy(y_dists) + + x_dists = similar(img, (size(img, 1) - 1)) + x_dists .= .- sqrt.(radius .^2 .- y_dists .^2) + x_dists_end = .- x_dists + + # reduce memory + # rotate the correct coordinates around center + buffer = copy(x_dists) + buffer .= cos.(angle) .* x_dists .- sin.(angle) .* y_dists + y_dists .= mid .+ sin.(angle) .* x_dists .+ cos.(angle) .* y_dists + x_dists .= mid .+ buffer + + buffer .= cos.(angle) .* x_dists_end .- sin.(angle) .* y_dists_end + y_dists_end .= mid .+ sin.(angle) .* x_dists_end .+ cos.(angle) .* y_dists_end + x_dists_end .= mid .+ buffer + + return x_dists, y_dists, x_dists_end, y_dists_end +end + From c9d1e663c404a963f290f6e3eb362f7316fc4c84 Mon Sep 17 00:00:00 2001 From: roflmaostc Date: Thu, 30 Nov 2023 15:51:51 +0100 Subject: [PATCH 2/9] Non threadsafe iradon --- examples/example_radon_iradon.jl | 27 ++++++++++++++++++++++++- src/iradon.jl | 34 ++++++++++++-------------------- 2 files changed, 39 insertions(+), 22 deletions(-) diff --git a/examples/example_radon_iradon.jl b/examples/example_radon_iradon.jl index 36b4860..cee256c 100644 --- a/examples/example_radon_iradon.jl +++ b/examples/example_radon_iradon.jl @@ -75,14 +75,33 @@ simshow(sinogram[:, :, i_z]) # ╔═╡ 3d584d94-b88f-4738-a470-7db1fb3fb996 simshow(Array(sinogram_c[:, :, i_z])) +# ╔═╡ 375a0179-8592-4d02-9686-d6a85a3eb048 +size(sinogram) + # ╔═╡ edbf1577-0fd4-4261-bd04-499bc1a0debd md"# IRadon Transform" # ╔═╡ ed54c930-4f34-4f3d-9180-514dc59fde15 +@time backproject = iradon(sinogram, angles); + +# ╔═╡ 037e9d64-505e-40f9-b710-20f57d29bd17 +CUDA.@time CUDA.@sync backproject_c = iradon(sinogram_c, CuArray(angles), + backend=CUDABackend()); +# ╔═╡ 72d63cbe-67d6-4a9c-80fa-d22743709105 +@bind i_z2 Slider(1:size(sinogram, 3), show_value=true) # ╔═╡ 365ee0e7-3545-4345-8b0c-8338a59c53b3 +simshow(backproject[:, :, i_z2]) + +# ╔═╡ b06bb885-175c-4cac-8346-f69f7172a9aa +simshow(Array(backproject_c[:, :, i_z2])) + +# ╔═╡ 447b163b-cc06-4427-b734-e0498df35260 +sum(backproject) +# ╔═╡ 267d7684-4a1b-402d-96ae-c3e26b957e0b +sum(backproject_c) # ╔═╡ Cell order: # ╠═4eb3148e-8f8b-11ee-3cfe-854d3bd5cc80 @@ -97,10 +116,16 @@ md"# IRadon Transform" # ╠═b8618268-0892-4abc-ae26-e25e41d07968 # ╠═d2cc6fc6-135b-4c4a-8453-9c5bf9e4a24f # ╠═dc14103d-993c-402f-a8b5-a35843f3f4ac -# ╟─783f05e0-2640-4ecd-8c19-1c15a99ee294 +# ╠═783f05e0-2640-4ecd-8c19-1c15a99ee294 # ╠═db2676fd-3305-408f-93b4-08a3d04fdd02 # ╠═1a931e03-6a29-4c3e-b66f-bc1b5936a6f4 # ╠═3d584d94-b88f-4738-a470-7db1fb3fb996 +# ╠═375a0179-8592-4d02-9686-d6a85a3eb048 # ╠═edbf1577-0fd4-4261-bd04-499bc1a0debd # ╠═ed54c930-4f34-4f3d-9180-514dc59fde15 +# ╠═037e9d64-505e-40f9-b710-20f57d29bd17 +# ╠═72d63cbe-67d6-4a9c-80fa-d22743709105 # ╠═365ee0e7-3545-4345-8b0c-8338a59c53b3 +# ╠═b06bb885-175c-4cac-8346-f69f7172a9aa +# ╠═447b163b-cc06-4427-b734-e0498df35260 +# ╠═267d7684-4a1b-402d-96ae-c3e26b957e0b diff --git a/src/iradon.jl b/src/iradon.jl index 5e58a2a..4278ee6 100644 --- a/src/iradon.jl +++ b/src/iradon.jl @@ -4,30 +4,23 @@ export iradon """ - radon(I, θs; backend=CPU()) - -Calculates the parallel radon transform of the three dimensional AbstractArray `I`. -The first two dimensions are y and x. The third dimension is z, the rotational axis. - -`θs` is a vector or range storing the angles in radians. + iradon(sinogram, θs; backend=CPU()) `backend` can be either `CPU()` for multithreaded CPU execution or `CUDABackend()` for CUDA execution. -Please note: the implementation is not quite optimize for cache efficiency and -it is a very naive algorithm. But still, it is quite fast. """ -function radon(img::AbstractArray{T, 3}, angles::AbstractArray{T, 1}; - backend=CPU()) where T - @assert iseven(size(img, 1)) && iseven(size(img, 2)) +function iradon(sinogram::AbstractArray{T, 3}, angles::AbstractArray{T, 1}; + backend=CPU()) where T + #@assert isodd(size(sinogram, 1)) && size(sinogram, 2) == length(angles) # this is the actual size we are using for calculation - N = size(img, 1) - 1 + N = size(sinogram, 1) N_angles = size(angles, 1) # the only significant allocation - sinogram = similar(img, (N, N_angles, size(img, 3))) - fill!(sinogram, 0) + img = similar(sinogram, (N + 1, N_angles, size(sinogram, 3))) + fill!(img, 0) # radius of the cylinder we are projecting through radius = size(img, 1) ÷ 2 - 1 @@ -39,19 +32,19 @@ function radon(img::AbstractArray{T, 3}, angles::AbstractArray{T, 1}; y_dists .= -radius:radius #@show typeof(sinogram), typeof(img), typeof(y_dists), typeof(angles) - kernel! = radon_kernel!(backend) + kernel! = iradon_kernel!(backend) kernel!(sinogram::AbstractArray{T}, img, y_dists, angles, mid, radius, - ndrange=(N_angles,N, size(img, 3))) + ndrange=(N_angles, N, size(img, 3))) - return sinogram + return img end """ - radon_kernel!(sinogram, img, + iradon_kernel!(sinogram, img, y_dists, angles, mid, radius) """ -@kernel function radon_kernel!(sinogram::AbstractArray{T}, +@kernel function iradon_kernel!(sinogram::AbstractArray{T}, img, y_dists, angles, mid, radius) where T # r is the index of the angles # k is the index of the detector spatial coordinate @@ -91,9 +84,8 @@ end distance = sqrt((a_old - a) ^2 + (b_old - b) ^2) # cell value times distance travelled through - @inbounds tmp += distance * img[cell_i, cell_j, i_z] + @inbounds img[cell_i, cell_j, i_z] += distance * sinogram[k, r, i_z] end - @inbounds sinogram[k, r, i_z] = tmp end From 6a29b32df71f64fc57fcd5c299df696fdc2c3291 Mon Sep 17 00:00:00 2001 From: roflmaostc Date: Thu, 30 Nov 2023 16:10:47 +0100 Subject: [PATCH 3/9] Iradon is broken, need to change it --- src/iradon.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iradon.jl b/src/iradon.jl index 4278ee6..c9a6931 100644 --- a/src/iradon.jl +++ b/src/iradon.jl @@ -19,7 +19,7 @@ function iradon(sinogram::AbstractArray{T, 3}, angles::AbstractArray{T, 1}; N_angles = size(angles, 1) # the only significant allocation - img = similar(sinogram, (N + 1, N_angles, size(sinogram, 3))) + img = similar(sinogram, (N + 1, N + 1, size(sinogram, 3))) fill!(img, 0) # radius of the cylinder we are projecting through From f082375b3cf58e5927bd1cfb93f9c17194df9a64 Mon Sep 17 00:00:00 2001 From: roflmaostc Date: Thu, 30 Nov 2023 19:16:21 +0100 Subject: [PATCH 4/9] Basic working, but still wrong --- examples/example_radon_iradon.jl | 59 +++++++++++++++++++++++---- src/iradon.jl | 70 ++++++++++++++------------------ 2 files changed, 82 insertions(+), 47 deletions(-) diff --git a/examples/example_radon_iradon.jl b/examples/example_radon_iradon.jl index cee256c..5e3577a 100644 --- a/examples/example_radon_iradon.jl +++ b/examples/example_radon_iradon.jl @@ -36,10 +36,13 @@ md"# Example Image" # ╔═╡ 54208d78-cf55-41d7-b4bf-6d1ab4927bbb begin N = 320 - N_z = 100 - img = box(Float32, (N, N, N_z), (N ÷4, N ÷ 4, 20), offset=(N ÷ 2 + 50, N ÷ 2 -100, N_z ÷ 2)) |> collect + N_z = 1 + #img = box(Float32, (N, N, N_z), (N ÷4, N ÷ 4, 20), offset=(N ÷ 2 + 60, N ÷ 2 -50, N_z ÷ 2)) |> collect + + #img = box(Float32, (N, N, N_z), (1, 1, 1)) |> collect + img = box(Float32, (N, N, N_z), (N ÷4, N ÷ 4, 20), offset=(N ÷ 2 - 50, N ÷ 2 + 50, N_z ÷ 2)) |> collect - img .+= 0.0f0 .+ (rr2(Float32, (N, N, N_z)) .< 100 .^2) + #img .+= 0.0f0 .+ (rr2(Float32, (N, N, N_z)) .< 100 .^2) #img = box(Float32, (100, 100), (3, 3), offset=(51, 51)) |> collect end; @@ -51,7 +54,7 @@ img_c = CuArray(img); md"# Radon Transform" # ╔═╡ b8618268-0892-4abc-ae26-e25e41d07968 -angles = range(0f0, 2f0π, 360) +angles = range(0f0, 2f0π, 361) # ╔═╡ d2cc6fc6-135b-4c4a-8453-9c5bf9e4a24f @time sinogram = radon(img, angles); @@ -81,28 +84,61 @@ size(sinogram) # ╔═╡ edbf1577-0fd4-4261-bd04-499bc1a0debd md"# IRadon Transform" +# ╔═╡ 61f17d9e-ed0a-4176-9466-464527c1b10e +@bind angle_cut1 Slider(1:361, show_value=true) + +# ╔═╡ 7bbc33af-7082-42e4-ad5f-1d4273e87fbf +rad2deg.(Float32.(angles)) + +# ╔═╡ 7d08ba55-4490-400f-8497-5cbfb3f257c7 +@bind angle_cut2 Slider(angle_cut1:361, show_value=true) + # ╔═╡ ed54c930-4f34-4f3d-9180-514dc59fde15 -@time backproject = iradon(sinogram, angles); +@time backproject = iradon(sinogram[:, angle_cut1:angle_cut2, :], angles[angle_cut1:angle_cut2]); # ╔═╡ 037e9d64-505e-40f9-b710-20f57d29bd17 -CUDA.@time CUDA.@sync backproject_c = iradon(sinogram_c, CuArray(angles), +# ╠═╡ disabled = true +#=╠═╡ +#CUDA.@time CUDA.@sync backproject_c = iradon(sinogram_c, CuArray(angles), backend=CUDABackend()); + ╠═╡ =# # ╔═╡ 72d63cbe-67d6-4a9c-80fa-d22743709105 @bind i_z2 Slider(1:size(sinogram, 3), show_value=true) # ╔═╡ 365ee0e7-3545-4345-8b0c-8338a59c53b3 -simshow(backproject[:, :, i_z2]) +simshow(backproject[:, :, i_z2] .+ 0 .* img[:, :, i_z2]) + +# ╔═╡ 4c5038bd-d346-4070-822b-bc3e5331d99c +begin + plot(backproject[2, :, i_z2]) + plot!(vcat([0.0], sinogram[:, 91, i_z2])) + plot!(vcat([0.0], sinogram[:, 1, i_z2])) + +end + +# ╔═╡ 3c85e03a-a126-40f7-bcc2-0e928190f757 +vcat([0.0], sinogram[:, 1, i_z2]) # ╔═╡ b06bb885-175c-4cac-8346-f69f7172a9aa simshow(Array(backproject_c[:, :, i_z2])) +# ╔═╡ 30f1016a-5b66-48ec-93f5-8c1f1129207e +Revise.errors() + # ╔═╡ 447b163b-cc06-4427-b734-e0498df35260 sum(backproject) # ╔═╡ 267d7684-4a1b-402d-96ae-c3e26b957e0b sum(backproject_c) +# ╔═╡ ec342e4e-4ce2-4d26-91f8-4d06a4fad46e +begin + arr = zeros(2,2) + arr[1,1] = 1 + simshow(arr) +end + # ╔═╡ Cell order: # ╠═4eb3148e-8f8b-11ee-3cfe-854d3bd5cc80 # ╠═4ee97893-5e8f-42cf-9ecd-c63c9db76869 @@ -121,11 +157,18 @@ sum(backproject_c) # ╠═1a931e03-6a29-4c3e-b66f-bc1b5936a6f4 # ╠═3d584d94-b88f-4738-a470-7db1fb3fb996 # ╠═375a0179-8592-4d02-9686-d6a85a3eb048 -# ╠═edbf1577-0fd4-4261-bd04-499bc1a0debd +# ╟─edbf1577-0fd4-4261-bd04-499bc1a0debd +# ╠═61f17d9e-ed0a-4176-9466-464527c1b10e +# ╠═7bbc33af-7082-42e4-ad5f-1d4273e87fbf +# ╠═7d08ba55-4490-400f-8497-5cbfb3f257c7 # ╠═ed54c930-4f34-4f3d-9180-514dc59fde15 # ╠═037e9d64-505e-40f9-b710-20f57d29bd17 # ╠═72d63cbe-67d6-4a9c-80fa-d22743709105 # ╠═365ee0e7-3545-4345-8b0c-8338a59c53b3 +# ╠═4c5038bd-d346-4070-822b-bc3e5331d99c +# ╠═3c85e03a-a126-40f7-bcc2-0e928190f757 # ╠═b06bb885-175c-4cac-8346-f69f7172a9aa +# ╠═30f1016a-5b66-48ec-93f5-8c1f1129207e # ╠═447b163b-cc06-4427-b734-e0498df35260 # ╠═267d7684-4a1b-402d-96ae-c3e26b957e0b +# ╠═ec342e4e-4ce2-4d26-91f8-4d06a4fad46e diff --git a/src/iradon.jl b/src/iradon.jl index c9a6931..761738b 100644 --- a/src/iradon.jl +++ b/src/iradon.jl @@ -26,7 +26,7 @@ function iradon(sinogram::AbstractArray{T, 3}, angles::AbstractArray{T, 1}; radius = size(img, 1) ÷ 2 - 1 # mid point, it is actually N ÷ 2 + 1 # but because of how adress the indices, we need 1.5 instead of +1 - mid = size(img, 1) ÷ 2 + T(1.5) + mid = size(img, 1) ÷ 2 + 1#T(1) # the y_dists samplings, in principle we can add this as function parameter y_dists = similar(img, (size(img, 1) - 1, )) y_dists .= -radius:radius @@ -34,7 +34,7 @@ function iradon(sinogram::AbstractArray{T, 3}, angles::AbstractArray{T, 1}; #@show typeof(sinogram), typeof(img), typeof(y_dists), typeof(angles) kernel! = iradon_kernel!(backend) kernel!(sinogram::AbstractArray{T}, img, y_dists, angles, mid, radius, - ndrange=(N_angles, N, size(img, 3))) + ndrange=(N, N, size(img, 3))) return img end @@ -49,43 +49,35 @@ end # r is the index of the angles # k is the index of the detector spatial coordinate # i_z is the index for the z dimension - r, k, i_z = @index(Global, NTuple) - - angle = angles[r] - sinα, cosα = sincos(angle) - - # x0, y0, x1, y1 beginning and end point of each ray - a, b, c, d = next_ray_on_circle(img, angle, y_dists[k], mid, radius, sinα, cosα) - - # different comparisons depending which direction the ray is propagating - cac = a <= c ? (a,c) -> a<=c : (a,c) -> a>=c - cbd = b <= d ? (b,d) -> b<=d : (b,d) -> b>=d - - l = 1 - # acculumators of the intensity - tmp = zero(T) - while cac(a, c) && cbd(b, d) - a_old, b_old = a, b - # would be good to move this branch outside of the while loop - # but maybe branch prediction is doing a good job here - if a ≈ c && b ≈ d - break - end - - # find the next intersection for the ray - @inline a, b = find_next_intersection(a,b,c,d) - l += 1 - - # find the cell it is cutting through - @inline cell_i, cell_j = find_cell((a_old, b_old), - (a, b)) - - # distance travelled through that cell - distance = sqrt((a_old - a) ^2 + - (b_old - b) ^2) - # cell value times distance travelled through - @inbounds img[cell_i, cell_j, i_z] += distance * sinogram[k, r, i_z] - end + i_i, i_j, i_z = @index(Global, NTuple) + + if (i_i - mid)^2 + (i_j - mid)^2 ≥ radius^2 + + else + l = 1 + # acculumators of the intensity + tmp = zero(T) + + for i_angle in 1:length(angles) + angle = angles[i_angle] +# if 0 ≤ angle ≤ π / 2 + # we need to find out which ray potentially intersects those positions + contact_x = sin(angle) + contact_y = -cos(angle) + dir_x = cos(angle) + dir_y = sin(angle) + if 0 ≤ angle < π / 2 + y_intersect = mid + floor(Int, (dir_x * (i_i - mid - contact_x * radius) + dir_y * (i_j - mid - contact_y * radius))) + elseif π/2 ≤ angle + y_intersect = mid + floor(Int, (dir_x * (i_i - mid - contact_x * radius) + dir_y * (i_j - mid - contact_y * radius))) + end + + #println(angle, " ", y_intersect) + + tmp += sinogram[y_intersect, i_angle, i_z] + end + img[1 + i_j, 1 + i_i, i_z] = tmp + end end From fe7ad64cbfd5c27a3205689b2c19956ee589b950 Mon Sep 17 00:00:00 2001 From: roflmaostc Date: Thu, 30 Nov 2023 19:34:20 +0100 Subject: [PATCH 5/9] More progress but needs more work for proper handling of the coordinates --- examples/example_radon_iradon.jl | 10 +++++----- src/iradon.jl | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/example_radon_iradon.jl b/examples/example_radon_iradon.jl index 5e3577a..2523301 100644 --- a/examples/example_radon_iradon.jl +++ b/examples/example_radon_iradon.jl @@ -39,8 +39,8 @@ begin N_z = 1 #img = box(Float32, (N, N, N_z), (N ÷4, N ÷ 4, 20), offset=(N ÷ 2 + 60, N ÷ 2 -50, N_z ÷ 2)) |> collect - #img = box(Float32, (N, N, N_z), (1, 1, 1)) |> collect - img = box(Float32, (N, N, N_z), (N ÷4, N ÷ 4, 20), offset=(N ÷ 2 - 50, N ÷ 2 + 50, N_z ÷ 2)) |> collect + img = box(Float32, (N, N, N_z), (1, 1, 1)) |> collect + #img = box(Float32, (N, N, N_z), (N ÷2, N ÷ 2, 20), offset=(N ÷ 2 - 50, N ÷ 2 + 50, N_z ÷ 2)) |> collect #img .+= 0.0f0 .+ (rr2(Float32, (N, N, N_z)) .< 100 .^2) @@ -111,9 +111,9 @@ simshow(backproject[:, :, i_z2] .+ 0 .* img[:, :, i_z2]) # ╔═╡ 4c5038bd-d346-4070-822b-bc3e5331d99c begin - plot(backproject[2, :, i_z2]) - plot!(vcat([0.0], sinogram[:, 91, i_z2])) - plot!(vcat([0.0], sinogram[:, 1, i_z2])) + plot(backproject[end, :, i_z2]) + #plot!(vcat([0.0], sinogram[:, 91, i_z2])) + #plot!(vcat([0.0], sinogram[:, 1, i_z2])) end diff --git a/src/iradon.jl b/src/iradon.jl index 761738b..d49f708 100644 --- a/src/iradon.jl +++ b/src/iradon.jl @@ -51,7 +51,7 @@ end # i_z is the index for the z dimension i_i, i_j, i_z = @index(Global, NTuple) - if (i_i - mid)^2 + (i_j - mid)^2 ≥ radius^2 + if (i_i - mid)^2 + (i_j - mid)^2 > radius^2 else l = 1 @@ -66,9 +66,9 @@ end contact_y = -cos(angle) dir_x = cos(angle) dir_y = sin(angle) - if 0 ≤ angle < π / 2 + if 0 ≤ angle < π y_intersect = mid + floor(Int, (dir_x * (i_i - mid - contact_x * radius) + dir_y * (i_j - mid - contact_y * radius))) - elseif π/2 ≤ angle + elseif π <= angle y_intersect = mid + floor(Int, (dir_x * (i_i - mid - contact_x * radius) + dir_y * (i_j - mid - contact_y * radius))) end @@ -76,7 +76,7 @@ end tmp += sinogram[y_intersect, i_angle, i_z] end - img[1 + i_j, 1 + i_i, i_z] = tmp + img[i_j,i_i, i_z] = tmp end end From 1ea00f90321a4ec476dc1ad062caea525813a643 Mon Sep 17 00:00:00 2001 From: roflmaostc Date: Fri, 1 Dec 2023 11:41:33 +0100 Subject: [PATCH 6/9] Add atomix for atomic threadsafe operations --- Project.toml | 1 + examples/Manifest.toml | 4 +- examples/Project.toml | 1 + examples/example_radon_iradon.jl | 45 +++++++++++++++--- src/RadonKA.jl | 1 + src/iradon.jl | 80 ++++++++++++++++++++++++++++++++ 6 files changed, 123 insertions(+), 9 deletions(-) diff --git a/Project.toml b/Project.toml index c7d47f2..d744e9d 100644 --- a/Project.toml +++ b/Project.toml @@ -5,6 +5,7 @@ version = "0.1.0" [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" +Atomix = "a9b6321e-bd34-4604-b9c9-b65b8de01458" CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341" IndexFunArrays = "613c443e-d742-454e-bfc6-1d7f8dd76566" diff --git a/examples/Manifest.toml b/examples/Manifest.toml index e0a7345..668d45e 100644 --- a/examples/Manifest.toml +++ b/examples/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.9.4" manifest_format = "2.0" -project_hash = "93a2cea19f4df08f72fc7e57574ea1e89cd4ad22" +project_hash = "299b3be6422f1603b5efe6219b0baa42967a5831" [[deps.AbstractFFTs]] deps = ["LinearAlgebra"] @@ -1105,7 +1105,7 @@ deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.RadonKA]] -deps = ["Adapt", "CUDA", "FFTW", "IndexFunArrays", "KernelAbstractions"] +deps = ["Adapt", "Atomix", "CUDA", "FFTW", "IndexFunArrays", "KernelAbstractions"] path = ".." uuid = "86de8297-835b-47df-b249-c04e8db91db5" version = "0.1.0" diff --git a/examples/Project.toml b/examples/Project.toml index 2331e46..a4354a7 100644 --- a/examples/Project.toml +++ b/examples/Project.toml @@ -1,4 +1,5 @@ [deps] +Atomix = "a9b6321e-bd34-4604-b9c9-b65b8de01458" CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" ImageIO = "82e4d734-157c-48bb-816b-45c225c6df19" ImageShow = "4e3cecfd-b093-5904-9786-8bbb286a6a31" diff --git a/examples/example_radon_iradon.jl b/examples/example_radon_iradon.jl index 2523301..97482a8 100644 --- a/examples/example_radon_iradon.jl +++ b/examples/example_radon_iradon.jl @@ -21,28 +21,34 @@ begin using Revise end -# ╔═╡ 4ee97893-5e8f-42cf-9ecd-c63c9db76869 -using RadonKA - # ╔═╡ 1311e853-c4cd-42bb-8bf3-5e0d564bf9c5 using IndexFunArrays, ImageShow, Plots, ImageIO, PlutoUI, PlutoTest # ╔═╡ 03bccb92-b47f-477a-9bdb-74cc404da690 using KernelAbstractions, CUDA, CUDA.CUDAKernels +# ╔═╡ b336e55e-0be4-422f-b48a-0a2242cb0915 +using RadonKA + +# ╔═╡ 4ee97893-5e8f-42cf-9ecd-c63c9db76869 +# ╠═╡ disabled = true +#=╠═╡ +using RadonKA + ╠═╡ =# + # ╔═╡ d25c1381-baf1-429b-8150-622b8f731d83 md"# Example Image" # ╔═╡ 54208d78-cf55-41d7-b4bf-6d1ab4927bbb begin N = 320 - N_z = 1 + N_z = 100 #img = box(Float32, (N, N, N_z), (N ÷4, N ÷ 4, 20), offset=(N ÷ 2 + 60, N ÷ 2 -50, N_z ÷ 2)) |> collect - img = box(Float32, (N, N, N_z), (1, 1, 1)) |> collect - #img = box(Float32, (N, N, N_z), (N ÷2, N ÷ 2, 20), offset=(N ÷ 2 - 50, N ÷ 2 + 50, N_z ÷ 2)) |> collect + #img = box(Float32, (N, N, N_z), (1, 1, 1)) |> collect + img = box(Float32, (N, N, N_z), (N ÷2, N ÷ 2, 50), offset=(N ÷ 2 - 50, N ÷ 2 + 50, N_z ÷ 2)) |> collect - #img .+= 0.0f0 .+ (rr2(Float32, (N, N, N_z)) .< 100 .^2) + img .+= 0.0f0 .+ (rr2(Float32, (N, N, N_z)) .< 100 .^2) #img = box(Float32, (100, 100), (3, 3), offset=(51, 51)) |> collect end; @@ -139,6 +145,24 @@ begin simshow(arr) end +# ╔═╡ e24bb409-bd5d-4eca-8cdc-884daece26fa + + +# ╔═╡ 7e27da5a-1b04-4d4c-8c62-eaffa7f4f9ce +@time backproject2 = RadonKA.iradon2(sinogram, angles); + +# ╔═╡ 93a7ab4a-b2dc-4fc2-bf69-66e6d615103f +CUDA.@time CUDA.@sync backproject2_cu = RadonKA.iradon2(sinogram_c[:, 1:2, :], CuArray(angles[1:2]), backend=CUDABackend()); + +# ╔═╡ 52a86ed8-4504-4d9e-9ea6-6aeaf8540406 +@bind i_z3 Slider(1:size(sinogram, 3), show_value=true) + +# ╔═╡ 9d7c41db-adb5-4da2-98ae-96e967c1056e +simshow(Array(backproject2_cu[:, :, i_z3])) + +# ╔═╡ c9b84c39-7a74-4893-bbb6-5241a121df04 +Revise.errors() + # ╔═╡ Cell order: # ╠═4eb3148e-8f8b-11ee-3cfe-854d3bd5cc80 # ╠═4ee97893-5e8f-42cf-9ecd-c63c9db76869 @@ -172,3 +196,10 @@ end # ╠═447b163b-cc06-4427-b734-e0498df35260 # ╠═267d7684-4a1b-402d-96ae-c3e26b957e0b # ╠═ec342e4e-4ce2-4d26-91f8-4d06a4fad46e +# ╠═e24bb409-bd5d-4eca-8cdc-884daece26fa +# ╠═7e27da5a-1b04-4d4c-8c62-eaffa7f4f9ce +# ╠═93a7ab4a-b2dc-4fc2-bf69-66e6d615103f +# ╠═52a86ed8-4504-4d9e-9ea6-6aeaf8540406 +# ╠═9d7c41db-adb5-4da2-98ae-96e967c1056e +# ╠═c9b84c39-7a74-4893-bbb6-5241a121df04 +# ╠═b336e55e-0be4-422f-b48a-0a2242cb0915 diff --git a/src/RadonKA.jl b/src/RadonKA.jl index 5eceec0..5a8ea6f 100644 --- a/src/RadonKA.jl +++ b/src/RadonKA.jl @@ -3,6 +3,7 @@ module RadonKA using KernelAbstractions, CUDA, CUDA.CUDAKernels using IndexFunArrays using FFTW +using Atomix include("utils.jl") include("radon.jl") diff --git a/src/iradon.jl b/src/iradon.jl index d49f708..494fd7a 100644 --- a/src/iradon.jl +++ b/src/iradon.jl @@ -93,3 +93,83 @@ function filtered_backprojection(sinogram::AbstractArray{T, 3}, θs, μ=nothing; return iradon(sinogram, θs, μ, backend=backend) end + + + +function iradon2(sinogram::AbstractArray{T, 3}, angles::AbstractArray{T, 1}; + backend=CPU()) where T + #@assert isodd(size(sinogram, 1)) && size(sinogram, 2) == length(angles) + # this is the actual size we are using for calculation + N = size(sinogram, 1) + N_angles = size(angles, 1) + + # the only significant allocation + img = similar(sinogram, (N + 1, N_angles, size(sinogram, 3))) + fill!(img, 0) + + # radius of the cylinder we are projecting through + radius = size(img, 1) ÷ 2 - 1 + # mid point, it is actually N ÷ 2 + 1 + # but because of how adress the indices, we need 1.5 instead of +1 + mid = size(img, 1) ÷ 2 + T(1.5) + # the y_dists samplings, in principle we can add this as function parameter + y_dists = similar(img, (size(img, 1) - 1, )) + y_dists .= -radius:radius + + #@show typeof(sinogram), typeof(img), typeof(y_dists), typeof(angles) + kernel! = iradon_kernel2!(backend) + kernel!(sinogram::AbstractArray{T}, img, y_dists, angles, mid, radius, + ndrange=(N_angles, N, size(img, 3))) + + return img +end + +""" + iradon_kernel!(sinogram, img, + y_dists, angles, mid, radius) + +""" +@kernel function iradon_kernel2!(sinogram::AbstractArray{T}, + img, y_dists, angles, mid, radius) where T + # r is the index of the angles + # k is the index of the detector spatial coordinate + # i_z is the index for the z dimension + r, k, i_z = @index(Global, NTuple) + + angle = angles[r] + sinα, cosα = sincos(angle) + + # x0, y0, x1, y1 beginning and end point of each ray + a, b, c, d = next_ray_on_circle(img, angle, y_dists[k], mid, radius, sinα, cosα) + + # different comparisons depending which direction the ray is propagating + cac = a <= c ? (a,c) -> a<=c : (a,c) -> a>=c + cbd = b <= d ? (b,d) -> b<=d : (b,d) -> b>=d + + l = 1 + # acculumators of the intensity + tmp = zero(T) + while cac(a, c) && cbd(b, d) + a_old, b_old = a, b + # would be good to move this branch outside of the while loop + # but maybe branch prediction is doing a good job here + if a ≈ c && b ≈ d + break + end + + # find the next intersection for the ray + @inline a, b = find_next_intersection(a,b,c,d) + l += 1 + + # find the cell it is cutting through + @inline cell_i, cell_j = find_cell((a_old, b_old), + (a, b)) + + # distance travelled through that cell + distance = sqrt((a_old - a) ^2 + + (b_old - b) ^2) + # cell value times distance travelled through + Atomix.@atomic img[cell_i, cell_j, i_z] += distance * sinogram[k, r, i_z] + end +end + From 2e1052edc0cca4577dbde2b890081ebf6076ebc9 Mon Sep 17 00:00:00 2001 From: roflmaostc Date: Fri, 1 Dec 2023 11:48:59 +0100 Subject: [PATCH 7/9] Commit with two iradons, discard the other oen --- examples/example_radon_iradon.jl | 23 ++++++++++------------- src/iradon.jl | 2 +- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/examples/example_radon_iradon.jl b/examples/example_radon_iradon.jl index 97482a8..a831b12 100644 --- a/examples/example_radon_iradon.jl +++ b/examples/example_radon_iradon.jl @@ -21,21 +21,15 @@ begin using Revise end +# ╔═╡ b336e55e-0be4-422f-b48a-0a2242cb0915 +using RadonKA + # ╔═╡ 1311e853-c4cd-42bb-8bf3-5e0d564bf9c5 using IndexFunArrays, ImageShow, Plots, ImageIO, PlutoUI, PlutoTest # ╔═╡ 03bccb92-b47f-477a-9bdb-74cc404da690 using KernelAbstractions, CUDA, CUDA.CUDAKernels -# ╔═╡ b336e55e-0be4-422f-b48a-0a2242cb0915 -using RadonKA - -# ╔═╡ 4ee97893-5e8f-42cf-9ecd-c63c9db76869 -# ╠═╡ disabled = true -#=╠═╡ -using RadonKA - ╠═╡ =# - # ╔═╡ d25c1381-baf1-429b-8150-622b8f731d83 md"# Example Image" @@ -152,7 +146,10 @@ end @time backproject2 = RadonKA.iradon2(sinogram, angles); # ╔═╡ 93a7ab4a-b2dc-4fc2-bf69-66e6d615103f -CUDA.@time CUDA.@sync backproject2_cu = RadonKA.iradon2(sinogram_c[:, 1:2, :], CuArray(angles[1:2]), backend=CUDABackend()); +CUDA.@time CUDA.@sync backproject2_cu = RadonKA.iradon2(sinogram_c[:, :, :], CuArray(angles[:]), backend=CUDABackend()); + +# ╔═╡ a29be556-174a-4ec5-962d-9fdf203d51aa + # ╔═╡ 52a86ed8-4504-4d9e-9ea6-6aeaf8540406 @bind i_z3 Slider(1:size(sinogram, 3), show_value=true) @@ -165,7 +162,7 @@ Revise.errors() # ╔═╡ Cell order: # ╠═4eb3148e-8f8b-11ee-3cfe-854d3bd5cc80 -# ╠═4ee97893-5e8f-42cf-9ecd-c63c9db76869 +# ╠═b336e55e-0be4-422f-b48a-0a2242cb0915 # ╠═1311e853-c4cd-42bb-8bf3-5e0d564bf9c5 # ╠═03bccb92-b47f-477a-9bdb-74cc404da690 # ╟─d25c1381-baf1-429b-8150-622b8f731d83 @@ -199,7 +196,7 @@ Revise.errors() # ╠═e24bb409-bd5d-4eca-8cdc-884daece26fa # ╠═7e27da5a-1b04-4d4c-8c62-eaffa7f4f9ce # ╠═93a7ab4a-b2dc-4fc2-bf69-66e6d615103f -# ╠═52a86ed8-4504-4d9e-9ea6-6aeaf8540406 +# ╠═a29be556-174a-4ec5-962d-9fdf203d51aa +# ╟─52a86ed8-4504-4d9e-9ea6-6aeaf8540406 # ╠═9d7c41db-adb5-4da2-98ae-96e967c1056e # ╠═c9b84c39-7a74-4893-bbb6-5241a121df04 -# ╠═b336e55e-0be4-422f-b48a-0a2242cb0915 diff --git a/src/iradon.jl b/src/iradon.jl index 494fd7a..2a32099 100644 --- a/src/iradon.jl +++ b/src/iradon.jl @@ -104,7 +104,7 @@ function iradon2(sinogram::AbstractArray{T, 3}, angles::AbstractArray{T, 1}; N_angles = size(angles, 1) # the only significant allocation - img = similar(sinogram, (N + 1, N_angles, size(sinogram, 3))) + img = similar(sinogram, (N + 1, N + 1, size(sinogram, 3))) fill!(img, 0) # radius of the cylinder we are projecting through From 79346bfb7b6ea414336489a3b58c35a43fae2d8a Mon Sep 17 00:00:00 2001 From: roflmaostc Date: Fri, 1 Dec 2023 14:11:18 +0100 Subject: [PATCH 8/9] Fix radon with atomicx --- examples/example_radon_iradon.jl | 119 +++++++++---------------------- src/iradon.jl | 91 ++--------------------- 2 files changed, 37 insertions(+), 173 deletions(-) diff --git a/examples/example_radon_iradon.jl b/examples/example_radon_iradon.jl index a831b12..fc26ade 100644 --- a/examples/example_radon_iradon.jl +++ b/examples/example_radon_iradon.jl @@ -37,12 +37,12 @@ md"# Example Image" begin N = 320 N_z = 100 - #img = box(Float32, (N, N, N_z), (N ÷4, N ÷ 4, 20), offset=(N ÷ 2 + 60, N ÷ 2 -50, N_z ÷ 2)) |> collect + img = box(Float32, (N, N, N_z), (N ÷4, N ÷ 4, 20), offset=(N ÷ 2 + 60, N ÷ 2 -50, N_z ÷ 2)) |> collect #img = box(Float32, (N, N, N_z), (1, 1, 1)) |> collect - img = box(Float32, (N, N, N_z), (N ÷2, N ÷ 2, 50), offset=(N ÷ 2 - 50, N ÷ 2 + 50, N_z ÷ 2)) |> collect + #img = box(Float32, (N, N, N_z), (N ÷2, N ÷ 2, 50), offset=(N ÷ 2 - 50, N ÷ 2 + 50, N_z ÷ 2)) |> collect - img .+= 0.0f0 .+ (rr2(Float32, (N, N, N_z)) .< 100 .^2) + img .+= 0.0f0 .+ (rr2(Float32, (N, N, N_z), offset=(180, 210, N_z÷2)) .< 30 .^2) #img = box(Float32, (100, 100), (3, 3), offset=(51, 51)) |> collect end; @@ -54,7 +54,7 @@ img_c = CuArray(img); md"# Radon Transform" # ╔═╡ b8618268-0892-4abc-ae26-e25e41d07968 -angles = range(0f0, 2f0π, 361) +angles = range(0f0, 2f0π, 361)[begin:end-1] # ╔═╡ d2cc6fc6-135b-4c4a-8453-9c5bf9e4a24f @time sinogram = radon(img, angles); @@ -84,81 +84,38 @@ size(sinogram) # ╔═╡ edbf1577-0fd4-4261-bd04-499bc1a0debd md"# IRadon Transform" -# ╔═╡ 61f17d9e-ed0a-4176-9466-464527c1b10e -@bind angle_cut1 Slider(1:361, show_value=true) - -# ╔═╡ 7bbc33af-7082-42e4-ad5f-1d4273e87fbf -rad2deg.(Float32.(angles)) - -# ╔═╡ 7d08ba55-4490-400f-8497-5cbfb3f257c7 -@bind angle_cut2 Slider(angle_cut1:361, show_value=true) - -# ╔═╡ ed54c930-4f34-4f3d-9180-514dc59fde15 -@time backproject = iradon(sinogram[:, angle_cut1:angle_cut2, :], angles[angle_cut1:angle_cut2]); - -# ╔═╡ 037e9d64-505e-40f9-b710-20f57d29bd17 -# ╠═╡ disabled = true -#=╠═╡ -#CUDA.@time CUDA.@sync backproject_c = iradon(sinogram_c, CuArray(angles), - backend=CUDABackend()); - ╠═╡ =# - -# ╔═╡ 72d63cbe-67d6-4a9c-80fa-d22743709105 -@bind i_z2 Slider(1:size(sinogram, 3), show_value=true) - -# ╔═╡ 365ee0e7-3545-4345-8b0c-8338a59c53b3 -simshow(backproject[:, :, i_z2] .+ 0 .* img[:, :, i_z2]) - -# ╔═╡ 4c5038bd-d346-4070-822b-bc3e5331d99c -begin - plot(backproject[end, :, i_z2]) - #plot!(vcat([0.0], sinogram[:, 91, i_z2])) - #plot!(vcat([0.0], sinogram[:, 1, i_z2])) - -end - -# ╔═╡ 3c85e03a-a126-40f7-bcc2-0e928190f757 -vcat([0.0], sinogram[:, 1, i_z2]) +# ╔═╡ 7e27da5a-1b04-4d4c-8c62-eaffa7f4f9ce +@time backproject = RadonKA.iradon(sinogram, angles); -# ╔═╡ b06bb885-175c-4cac-8346-f69f7172a9aa -simshow(Array(backproject_c[:, :, i_z2])) +# ╔═╡ 0d2ccb21-a041-4fc4-b8b8-6bdc543e89e6 +rad2deg(angles[90]) -# ╔═╡ 30f1016a-5b66-48ec-93f5-8c1f1129207e -Revise.errors() +# ╔═╡ b9bf49a0-7320-4269-9a6a-ac2533ab5fde +@bind angle_limit Slider(1:size(sinogram, 2), show_value=true) -# ╔═╡ 447b163b-cc06-4427-b734-e0498df35260 -sum(backproject) +# ╔═╡ 93a7ab4a-b2dc-4fc2-bf69-66e6d615103f +CUDA.@sync backproject_cu = RadonKA.iradon(sinogram_c[:, begin:angle_limit, :], CuArray(angles[begin:angle_limit]), backend=CUDABackend()); -# ╔═╡ 267d7684-4a1b-402d-96ae-c3e26b957e0b -sum(backproject_c) +# ╔═╡ 52a86ed8-4504-4d9e-9ea6-6aeaf8540406 +@bind i_z3 Slider(1:size(sinogram, 3), show_value=true) -# ╔═╡ ec342e4e-4ce2-4d26-91f8-4d06a4fad46e -begin - arr = zeros(2,2) - arr[1,1] = 1 - simshow(arr) -end +# ╔═╡ 9d7c41db-adb5-4da2-98ae-96e967c1056e +simshow(Array(backproject_cu[:, :, i_z3])) -# ╔═╡ e24bb409-bd5d-4eca-8cdc-884daece26fa +# ╔═╡ 81b07387-ede6-4a66-8260-8605cd978ede +md"# Filtered Backprojection" +# ╔═╡ 32b15077-5e09-4693-8f12-3b2029fe63cc +CUDA.@time CUDA.@sync filtered_bproj = RadonKA.filtered_backprojection(sinogram_c, CuArray(angles), backend=CUDABackend()); -# ╔═╡ 7e27da5a-1b04-4d4c-8c62-eaffa7f4f9ce -@time backproject2 = RadonKA.iradon2(sinogram, angles); +# ╔═╡ bc6e2d40-fcd1-4d7b-8f96-3d4d9e4336de +@bind i_z4 Slider(1:size(sinogram, 3), show_value=true) -# ╔═╡ 93a7ab4a-b2dc-4fc2-bf69-66e6d615103f -CUDA.@time CUDA.@sync backproject2_cu = RadonKA.iradon2(sinogram_c[:, :, :], CuArray(angles[:]), backend=CUDABackend()); +# ╔═╡ eee184e3-8d5d-42fb-81fb-a5d7e59a083a +simshow(Array(filtered_bproj[:, :, i_z4])) # ╔═╡ a29be556-174a-4ec5-962d-9fdf203d51aa - - -# ╔═╡ 52a86ed8-4504-4d9e-9ea6-6aeaf8540406 -@bind i_z3 Slider(1:size(sinogram, 3), show_value=true) - -# ╔═╡ 9d7c41db-adb5-4da2-98ae-96e967c1056e -simshow(Array(backproject2_cu[:, :, i_z3])) - -# ╔═╡ c9b84c39-7a74-4893-bbb6-5241a121df04 -Revise.errors() +backproject ≈ Array(backproject_cu) # ╔═╡ Cell order: # ╠═4eb3148e-8f8b-11ee-3cfe-854d3bd5cc80 @@ -179,24 +136,14 @@ Revise.errors() # ╠═3d584d94-b88f-4738-a470-7db1fb3fb996 # ╠═375a0179-8592-4d02-9686-d6a85a3eb048 # ╟─edbf1577-0fd4-4261-bd04-499bc1a0debd -# ╠═61f17d9e-ed0a-4176-9466-464527c1b10e -# ╠═7bbc33af-7082-42e4-ad5f-1d4273e87fbf -# ╠═7d08ba55-4490-400f-8497-5cbfb3f257c7 -# ╠═ed54c930-4f34-4f3d-9180-514dc59fde15 -# ╠═037e9d64-505e-40f9-b710-20f57d29bd17 -# ╠═72d63cbe-67d6-4a9c-80fa-d22743709105 -# ╠═365ee0e7-3545-4345-8b0c-8338a59c53b3 -# ╠═4c5038bd-d346-4070-822b-bc3e5331d99c -# ╠═3c85e03a-a126-40f7-bcc2-0e928190f757 -# ╠═b06bb885-175c-4cac-8346-f69f7172a9aa -# ╠═30f1016a-5b66-48ec-93f5-8c1f1129207e -# ╠═447b163b-cc06-4427-b734-e0498df35260 -# ╠═267d7684-4a1b-402d-96ae-c3e26b957e0b -# ╠═ec342e4e-4ce2-4d26-91f8-4d06a4fad46e -# ╠═e24bb409-bd5d-4eca-8cdc-884daece26fa # ╠═7e27da5a-1b04-4d4c-8c62-eaffa7f4f9ce +# ╠═0d2ccb21-a041-4fc4-b8b8-6bdc543e89e6 +# ╠═b9bf49a0-7320-4269-9a6a-ac2533ab5fde # ╠═93a7ab4a-b2dc-4fc2-bf69-66e6d615103f -# ╠═a29be556-174a-4ec5-962d-9fdf203d51aa -# ╟─52a86ed8-4504-4d9e-9ea6-6aeaf8540406 +# ╠═52a86ed8-4504-4d9e-9ea6-6aeaf8540406 # ╠═9d7c41db-adb5-4da2-98ae-96e967c1056e -# ╠═c9b84c39-7a74-4893-bbb6-5241a121df04 +# ╟─81b07387-ede6-4a66-8260-8605cd978ede +# ╠═32b15077-5e09-4693-8f12-3b2029fe63cc +# ╠═bc6e2d40-fcd1-4d7b-8f96-3d4d9e4336de +# ╠═eee184e3-8d5d-42fb-81fb-a5d7e59a083a +# ╠═a29be556-174a-4ec5-962d-9fdf203d51aa diff --git a/src/iradon.jl b/src/iradon.jl index 2a32099..a5d5c8f 100644 --- a/src/iradon.jl +++ b/src/iradon.jl @@ -1,102 +1,19 @@ export iradon - - -""" - iradon(sinogram, θs; backend=CPU()) - -`backend` can be either `CPU()` for multithreaded CPU execution or -`CUDABackend()` for CUDA execution. - - -""" -function iradon(sinogram::AbstractArray{T, 3}, angles::AbstractArray{T, 1}; - backend=CPU()) where T - #@assert isodd(size(sinogram, 1)) && size(sinogram, 2) == length(angles) - # this is the actual size we are using for calculation - N = size(sinogram, 1) - N_angles = size(angles, 1) - - # the only significant allocation - img = similar(sinogram, (N + 1, N + 1, size(sinogram, 3))) - fill!(img, 0) - - # radius of the cylinder we are projecting through - radius = size(img, 1) ÷ 2 - 1 - # mid point, it is actually N ÷ 2 + 1 - # but because of how adress the indices, we need 1.5 instead of +1 - mid = size(img, 1) ÷ 2 + 1#T(1) - # the y_dists samplings, in principle we can add this as function parameter - y_dists = similar(img, (size(img, 1) - 1, )) - y_dists .= -radius:radius - - #@show typeof(sinogram), typeof(img), typeof(y_dists), typeof(angles) - kernel! = iradon_kernel!(backend) - kernel!(sinogram::AbstractArray{T}, img, y_dists, angles, mid, radius, - ndrange=(N, N, size(img, 3))) - - return img -end - -""" - iradon_kernel!(sinogram, img, - y_dists, angles, mid, radius) - -""" -@kernel function iradon_kernel!(sinogram::AbstractArray{T}, - img, y_dists, angles, mid, radius) where T - # r is the index of the angles - # k is the index of the detector spatial coordinate - # i_z is the index for the z dimension - i_i, i_j, i_z = @index(Global, NTuple) - - if (i_i - mid)^2 + (i_j - mid)^2 > radius^2 - - else - l = 1 - # acculumators of the intensity - tmp = zero(T) - - for i_angle in 1:length(angles) - angle = angles[i_angle] -# if 0 ≤ angle ≤ π / 2 - # we need to find out which ray potentially intersects those positions - contact_x = sin(angle) - contact_y = -cos(angle) - dir_x = cos(angle) - dir_y = sin(angle) - if 0 ≤ angle < π - y_intersect = mid + floor(Int, (dir_x * (i_i - mid - contact_x * radius) + dir_y * (i_j - mid - contact_y * radius))) - elseif π <= angle - y_intersect = mid + floor(Int, (dir_x * (i_i - mid - contact_x * radius) + dir_y * (i_j - mid - contact_y * radius))) - end - - #println(angle, " ", y_intersect) - - tmp += sinogram[y_intersect, i_angle, i_z] - end - img[i_j,i_i, i_z] = tmp - end -end - - - - - function filtered_backprojection(sinogram::AbstractArray{T, 3}, θs, μ=nothing; backend=CPU()) where T filter = similar(sinogram, (size(sinogram, 1),)) filter .= rr(T, (size(sinogram, 1), )) p = plan_fft(sinogram, (1,)) sinogram = real(inv(p) * (p * sinogram .* ifftshift(filter))) - return iradon(sinogram, θs, μ, backend=backend) + return iradon(sinogram, θs, backend=backend) end -function iradon2(sinogram::AbstractArray{T, 3}, angles::AbstractArray{T, 1}; +function iradon(sinogram::AbstractArray{T, 3}, angles::AbstractArray{T, 1}; backend=CPU()) where T #@assert isodd(size(sinogram, 1)) && size(sinogram, 2) == length(angles) # this is the actual size we are using for calculation @@ -117,7 +34,7 @@ function iradon2(sinogram::AbstractArray{T, 3}, angles::AbstractArray{T, 1}; y_dists .= -radius:radius #@show typeof(sinogram), typeof(img), typeof(y_dists), typeof(angles) - kernel! = iradon_kernel2!(backend) + kernel! = iradon_kernel!(backend) kernel!(sinogram::AbstractArray{T}, img, y_dists, angles, mid, radius, ndrange=(N_angles, N, size(img, 3))) @@ -129,7 +46,7 @@ end y_dists, angles, mid, radius) """ -@kernel function iradon_kernel2!(sinogram::AbstractArray{T}, +@kernel function iradon_kernel!(sinogram::AbstractArray{T}, img, y_dists, angles, mid, radius) where T # r is the index of the angles # k is the index of the detector spatial coordinate From 6b64b5deaeed0607a14d3840d5ba2e9a3412dbeb Mon Sep 17 00:00:00 2001 From: roflmaostc Date: Fri, 1 Dec 2023 15:33:05 +0100 Subject: [PATCH 9/9] More progress. Seems to work --- examples/Manifest.toml | 2 +- examples/Project.toml | 1 + examples/example_radon_iradon.jl | 24 ++++++++++++++---------- src/iradon.jl | 4 ++-- src/radon.jl | 4 ++-- 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/examples/Manifest.toml b/examples/Manifest.toml index 668d45e..176ce4f 100644 --- a/examples/Manifest.toml +++ b/examples/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.9.4" manifest_format = "2.0" -project_hash = "299b3be6422f1603b5efe6219b0baa42967a5831" +project_hash = "7c85d5dd9b40fb7db497a724e2dc2c49bb108816" [[deps.AbstractFFTs]] deps = ["LinearAlgebra"] diff --git a/examples/Project.toml b/examples/Project.toml index a4354a7..a6a36d2 100644 --- a/examples/Project.toml +++ b/examples/Project.toml @@ -1,6 +1,7 @@ [deps] Atomix = "a9b6321e-bd34-4604-b9c9-b65b8de01458" CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" +FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341" ImageIO = "82e4d734-157c-48bb-816b-45c225c6df19" ImageShow = "4e3cecfd-b093-5904-9786-8bbb286a6a31" IndexFunArrays = "613c443e-d742-454e-bfc6-1d7f8dd76566" diff --git a/examples/example_radon_iradon.jl b/examples/example_radon_iradon.jl index fc26ade..807a4e5 100644 --- a/examples/example_radon_iradon.jl +++ b/examples/example_radon_iradon.jl @@ -30,13 +30,16 @@ using IndexFunArrays, ImageShow, Plots, ImageIO, PlutoUI, PlutoTest # ╔═╡ 03bccb92-b47f-477a-9bdb-74cc404da690 using KernelAbstractions, CUDA, CUDA.CUDAKernels +# ╔═╡ 810aebe4-2c6e-4ba6-916b-9e4306df33c9 +TableOfContents() + # ╔═╡ d25c1381-baf1-429b-8150-622b8f731d83 md"# Example Image" # ╔═╡ 54208d78-cf55-41d7-b4bf-6d1ab4927bbb begin - N = 320 - N_z = 100 + N = 512 + N_z = 20 img = box(Float32, (N, N, N_z), (N ÷4, N ÷ 4, 20), offset=(N ÷ 2 + 60, N ÷ 2 -50, N_z ÷ 2)) |> collect #img = box(Float32, (N, N, N_z), (1, 1, 1)) |> collect @@ -56,11 +59,14 @@ md"# Radon Transform" # ╔═╡ b8618268-0892-4abc-ae26-e25e41d07968 angles = range(0f0, 2f0π, 361)[begin:end-1] +# ╔═╡ 135e728b-efd8-44bc-81d9-6a2244ce4c31 +angles_c = CuArray(angles); + # ╔═╡ d2cc6fc6-135b-4c4a-8453-9c5bf9e4a24f @time sinogram = radon(img, angles); # ╔═╡ dc14103d-993c-402f-a8b5-a35843f3f4ac -CUDA.@time CUDA.@sync sinogram_c = radon(img_c, CuArray(angles), +CUDA.@time CUDA.@sync sinogram_c = radon(img_c, angles_c, backend=CUDABackend()); # ╔═╡ 783f05e0-2640-4ecd-8c19-1c15a99ee294 @@ -78,9 +84,6 @@ simshow(sinogram[:, :, i_z]) # ╔═╡ 3d584d94-b88f-4738-a470-7db1fb3fb996 simshow(Array(sinogram_c[:, :, i_z])) -# ╔═╡ 375a0179-8592-4d02-9686-d6a85a3eb048 -size(sinogram) - # ╔═╡ edbf1577-0fd4-4261-bd04-499bc1a0debd md"# IRadon Transform" @@ -94,7 +97,7 @@ rad2deg(angles[90]) @bind angle_limit Slider(1:size(sinogram, 2), show_value=true) # ╔═╡ 93a7ab4a-b2dc-4fc2-bf69-66e6d615103f -CUDA.@sync backproject_cu = RadonKA.iradon(sinogram_c[:, begin:angle_limit, :], CuArray(angles[begin:angle_limit]), backend=CUDABackend()); +CUDA.@time CUDA.@sync backproject_cu = RadonKA.iradon(sinogram_c[:, begin:angle_limit, :], CuArray(angles[begin:angle_limit]), backend=CUDABackend()); # ╔═╡ 52a86ed8-4504-4d9e-9ea6-6aeaf8540406 @bind i_z3 Slider(1:size(sinogram, 3), show_value=true) @@ -122,28 +125,29 @@ backproject ≈ Array(backproject_cu) # ╠═b336e55e-0be4-422f-b48a-0a2242cb0915 # ╠═1311e853-c4cd-42bb-8bf3-5e0d564bf9c5 # ╠═03bccb92-b47f-477a-9bdb-74cc404da690 +# ╟─810aebe4-2c6e-4ba6-916b-9e4306df33c9 # ╟─d25c1381-baf1-429b-8150-622b8f731d83 # ╠═54208d78-cf55-41d7-b4bf-6d1ab4927bbb # ╠═1393d029-66be-40aa-a2f9-f31317222575 # ╠═01b4b8f8-37d5-425f-975e-ebb3890d8624 # ╟─8be220a4-293d-411d-bbce-e39b64780814 # ╠═b8618268-0892-4abc-ae26-e25e41d07968 +# ╠═135e728b-efd8-44bc-81d9-6a2244ce4c31 # ╠═d2cc6fc6-135b-4c4a-8453-9c5bf9e4a24f # ╠═dc14103d-993c-402f-a8b5-a35843f3f4ac # ╠═783f05e0-2640-4ecd-8c19-1c15a99ee294 # ╠═db2676fd-3305-408f-93b4-08a3d04fdd02 # ╠═1a931e03-6a29-4c3e-b66f-bc1b5936a6f4 # ╠═3d584d94-b88f-4738-a470-7db1fb3fb996 -# ╠═375a0179-8592-4d02-9686-d6a85a3eb048 # ╟─edbf1577-0fd4-4261-bd04-499bc1a0debd # ╠═7e27da5a-1b04-4d4c-8c62-eaffa7f4f9ce # ╠═0d2ccb21-a041-4fc4-b8b8-6bdc543e89e6 -# ╠═b9bf49a0-7320-4269-9a6a-ac2533ab5fde +# ╟─b9bf49a0-7320-4269-9a6a-ac2533ab5fde # ╠═93a7ab4a-b2dc-4fc2-bf69-66e6d615103f # ╠═52a86ed8-4504-4d9e-9ea6-6aeaf8540406 # ╠═9d7c41db-adb5-4da2-98ae-96e967c1056e # ╟─81b07387-ede6-4a66-8260-8605cd978ede # ╠═32b15077-5e09-4693-8f12-3b2029fe63cc -# ╠═bc6e2d40-fcd1-4d7b-8f96-3d4d9e4336de +# ╟─bc6e2d40-fcd1-4d7b-8f96-3d4d9e4336de # ╠═eee184e3-8d5d-42fb-81fb-a5d7e59a083a # ╠═a29be556-174a-4ec5-962d-9fdf203d51aa diff --git a/src/iradon.jl b/src/iradon.jl index a5d5c8f..4c3167b 100644 --- a/src/iradon.jl +++ b/src/iradon.jl @@ -36,7 +36,7 @@ function iradon(sinogram::AbstractArray{T, 3}, angles::AbstractArray{T, 1}; #@show typeof(sinogram), typeof(img), typeof(y_dists), typeof(angles) kernel! = iradon_kernel!(backend) kernel!(sinogram::AbstractArray{T}, img, y_dists, angles, mid, radius, - ndrange=(N_angles, N, size(img, 3))) + ndrange=(N, N_angles, size(img, 3))) return img end @@ -51,7 +51,7 @@ end # r is the index of the angles # k is the index of the detector spatial coordinate # i_z is the index for the z dimension - r, k, i_z = @index(Global, NTuple) + k, r, i_z = @index(Global, NTuple) angle = angles[r] sinα, cosα = sincos(angle) diff --git a/src/radon.jl b/src/radon.jl index d44c3a3..c751095 100644 --- a/src/radon.jl +++ b/src/radon.jl @@ -38,7 +38,7 @@ function radon(img::AbstractArray{T, 3}, angles::AbstractArray{T, 1}; #@show typeof(sinogram), typeof(img), typeof(y_dists), typeof(angles) kernel! = radon_kernel!(backend) kernel!(sinogram::AbstractArray{T}, img, y_dists, angles, mid, radius, - ndrange=(N_angles,N, size(img, 3))) + ndrange=(N, N_angles, size(img, 3))) return sinogram end @@ -53,7 +53,7 @@ end # r is the index of the angles # k is the index of the detector spatial coordinate # i_z is the index for the z dimension - r, k, i_z = @index(Global, NTuple) + k, r, i_z = @index(Global, NTuple) angle = angles[r] sinα, cosα = sincos(angle)