Skip to content

Commit aeb00b7

Browse files
authored
Fix 3D Shepp Logan value bug (#71)
* Fix 3D Shepp Logan value bug * v0.7.2
1 parent 0c995ab commit aeb00b7

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ImagePhantoms"
22
uuid = "71a99df6-f52c-4da1-bd2a-69d6f37f3252"
33
authors = ["Jeff Fessler <[email protected]> and contributors"]
4-
version = "0.7.1"
4+
version = "0.7.2"
55

66
[deps]
77
LazyGrids = "7031d0ef-c40d-4431-b2f8-61a8d2f650db"

src/shepplogan.jl

+10-7
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,9 @@ struct SheppLogan3 <: EllipsoidPhantomVersion end
285285

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

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

@@ -360,7 +363,7 @@ function ellipsoid_parameters_uscale(
360363
(tmp[1:3] * uc .* fovs)...,
361364
(tmp[4:6] * uc .* fovs)...,
362365
(tmp[7:9] * ua)...,
363-
tmp[9] * uv,
366+
tmp[10] * uv,
364367
)
365368
out[n] = tmp
366369
end
@@ -390,10 +393,10 @@ function ellipsoid_parameters(
390393
u::NTuple{3,Number} = (1,1,1), # unit scaling
391394
)
392395

393-
params = ellipsoid_parameters_shepplogan() # (N,9)
396+
params = ellipsoid_parameters_shepplogan() # (N,10)
394397

395-
case == SheppLogan3() || throw("unsupported")
396-
# params[:,9] = shepp_logan_values(case)
398+
case == SheppLogan3() || error("unsupported case $case")
399+
# params[:,10] = shepp_logan_values(case)
397400

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

0 commit comments

Comments
 (0)