diff --git a/Project.toml b/Project.toml index 1efc826..ddebd55 100644 --- a/Project.toml +++ b/Project.toml @@ -9,6 +9,6 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" [compat] -LazyGrids = "0.4, 0.5" +LazyGrids = "0.5" SpecialFunctions = "1.8, 2" -julia = "1.9" +julia = "1.10" diff --git a/README.md b/README.md index 96c79fe..de899ec 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,7 @@ ellipsoids/spheres, cuboids/cubes, gaussians, cylinders, cones. ### Compatibility -Tested with Julia ≥ 1.9. +Tested with Julia ≥ 1.10. [action-img]: https://github.com/JuliaImageRecon/ImagePhantoms.jl/workflows/CI/badge.svg diff --git a/src/mri-sense.jl b/src/mri-sense.jl index e49347f..0b4612b 100644 --- a/src/mri-sense.jl +++ b/src/mri-sense.jl @@ -29,7 +29,7 @@ leading to better boundary behavior than the DFT frequencies `k/N`. * `kmax::Int = 5` default frequency index -kmax:kmax in all dimensions * `kfun::Function = (k,N) -> k / (2N)` # DCT-II frequency * `deltas::NTuple{D,<:Number} = ones(D)` pixel sizes -(For additional options `kmaxs`, `kt`, `ki`, see code.) +(For additional options `kmaxs`, `kt`, `ki`, `T`, see code.) # Output * `(; B, ν)` where `B` is basis matrix of size `count(mask) × nk` @@ -47,7 +47,7 @@ function mri_smap_basis( kfun::Function = (k,N) -> k / (2N), # DCT-II frequency nfun::Function = (N) -> -(N÷2):(N÷2)-1, basis::Function = (k,N) -> cispi.(2 * nfun(N) * kfun(k,N)), # 1D basis - T::DataType = ComplexF32, + T::Type{<:Complex{<:AbstractFloat}} = ComplexF32, ) where D B = zeros(T, count(mask), length(ki)) for (i, k) in enumerate(ki) diff --git a/src/object2.jl b/src/object2.jl index 990086e..a13d16f 100644 --- a/src/object2.jl +++ b/src/object2.jl @@ -86,7 +86,7 @@ function phantom( y::AbstractVector, oa::Array{<:Object2d}, oversample::Int ; - T::DataType = typeof(1f0 * oneunit(promote_type(eltype.(oa)...))), + T::Type{<:Number} = typeof(1f0 * oneunit(promote_type(eltype.(oa)...))), ) oversample < 1 && throw(ArgumentError("oversample $oversample")) diff --git a/src/object3.jl b/src/object3.jl index cc205b9..09447c4 100644 --- a/src/object3.jl +++ b/src/object3.jl @@ -90,7 +90,7 @@ function phantom( z::AbstractVector, oa::Array{<:Object3d{S,V}}, oversample::Int; - T::DataType = typeof(oneunit(V) * 1f0), # at least Float32 + T::Type{<:Number} = typeof(oneunit(V) * 1f0), # at least Float32 ) where {S, V <: Number} oversample < 1 && throw(ArgumentError("oversample $oversample")) diff --git a/src/shepplogan.jl b/src/shepplogan.jl index 755f47a..d7c6061 100644 --- a/src/shepplogan.jl +++ b/src/shepplogan.jl @@ -93,7 +93,7 @@ Convenience method for generating `M×N` samples of Shepp-Logan phantoms. # Options * `oversample::Int = 3` (usually) * `yflip::Bool = true` (reverse `y` samples for convenience.) -* `T::DataType` default `Float32` (except `Int` for `BrainWeb` version) +* `T::Type{<:Number}` default `Float32` (except `Int` for `BrainWeb` version) * `kwargs...` remaining options passed to `ellipse_parameters` for parameters. # Out @@ -107,7 +107,7 @@ function shepp_logan( case::EllipsePhantomVersion ; oversample::Int = 3, yflip::Bool = true, - T::DataType = Float32, + T::Type{<:Number} = Float32, kwargs... ) ob = shepp_logan(case ; kwargs...)