Skip to content

Commit

Permalink
Fix 3D Shepp Logan value bug (#71)
Browse files Browse the repository at this point in the history
* Fix 3D Shepp Logan value bug

* v0.7.2
  • Loading branch information
JeffFessler authored Dec 15, 2022
1 parent 0c995ab commit aeb00b7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ImagePhantoms"
uuid = "71a99df6-f52c-4da1-bd2a-69d6f37f3252"
authors = ["Jeff Fessler <[email protected]> and contributors"]
version = "0.7.1"
version = "0.7.2"

[deps]
LazyGrids = "7031d0ef-c40d-4431-b2f8-61a8d2f650db"
Expand Down
17 changes: 10 additions & 7 deletions src/shepplogan.jl
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,9 @@ struct SheppLogan3 <: EllipsoidPhantomVersion end

"""
ellipsoid_parameters_shepplogan( ; disjoint::Bool)
`12 × 9 Matrix{Float64}` of 3D Shepp-Logan ellipsoid parameters.
By default the first 6 columns are unitless "fractions of field of view",
`12 × 10 Matrix{Float64}` of 3D Shepp-Logan ellipsoid parameters
`(cx,cy,cz, rx,ry rz, Φ,Θ=0,Ψ=0, ρ)`.
By default the first 6 columns are unitless "fractions of field of view".
"""
function ellipsoid_parameters_shepplogan()

Expand All @@ -311,7 +312,9 @@ who said that the Kak&Slaney 1988 values are incorrect.
]
params[:,1:6] ./= 2 # radii
params[:,7] .*= π/180 # radians
out = [params[:,1:7] zeros(size(params,1)) zeros(size(params,1)) params[:,8]] # Θ=0, ψ=0
Θ = zeros(size(params,1))
Ψ = zeros(size(params,1))
out = [params[:,1:7] Θ Ψ params[:,8]] # (12,10)
return out
end

Expand Down Expand Up @@ -360,7 +363,7 @@ function ellipsoid_parameters_uscale(
(tmp[1:3] * uc .* fovs)...,
(tmp[4:6] * uc .* fovs)...,
(tmp[7:9] * ua)...,
tmp[9] * uv,
tmp[10] * uv,
)
out[n] = tmp
end
Expand Down Expand Up @@ -390,10 +393,10 @@ function ellipsoid_parameters(
u::NTuple{3,Number} = (1,1,1), # unit scaling
)

params = ellipsoid_parameters_shepplogan() # (N,9)
params = ellipsoid_parameters_shepplogan() # (N,10)

case == SheppLogan3() || throw("unsupported")
# params[:,9] = shepp_logan_values(case)
case == SheppLogan3() || error("unsupported case $case")
# params[:,10] = shepp_logan_values(case)

out = ellipsoid_parameters_uscale(params, fovs, u...)
end

2 comments on commit aeb00b7

@JeffFessler
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator() register

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/74205

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.2 -m "<description of version>" aeb00b79fc7141faec4d1f2b8de59cad6bae5298
git push origin v0.7.2

Please sign in to comment.