Closed JeffFessler closed 1 year ago
@tknopp sorry about this. Can you summarize what ray geometry you used? I don't need a full MWE probably, just the part where you have a line of code like rg = CtFanArc( ... )
.
Sinograms.SinoFanFlat{Unitful.Quantity{Float64, π, Unitful.FreeUnits{(cm,), π, nothing}}, Float64} :
nb::Int64 1536
d::Unit{Float64} 0.011067708333333334 cm
offset::Float32 -6.0
na::Int64 834
orbit::Float64 199.15104677834458
orbit_start::Float64 -5.651046778344568
source_offset::Unit{Float64} 0.0 cm
dsd::Unit{Float64} 51.800000000000004 cm
dod::Unit{Float64} 11.684172500000004 cm
if I set orbit_start = 0
it works but the reconstruction is rotated. Most of the above parameters were read out of the file. Just the center and orbit_start
were hand tuned.
Those were very helpful clues. I have found the problem and it is in this line:
https://github.com/JuliaImageRecon/Sinograms.jl/blob/ed697de111248560c3b78ccf5519abe75fe734ff/src/fbp/parker.jl#L85
Surprisingly the first value is slightly (eps
) negative. Here is MWE to reproduce it. I will fix it now.
using Unitful: cm
using Sinograms
using Sinograms: _ar
rg = SinoFanFlat(; nb=1536, na = 834,
d = 0.011067708333333334cm,
orbit = 199.15104677834458,
orbit_start = -5.651046778344568,
dsd = 51.800000000000004cm,
dod = 11.684172500000004cm,
offset = -6,
)
ar = _ar(rg) # StepRangeLen
(ar .- ar[begin])[begin] # negative!?
minimum(ar .- minimum(ar)) # negative!?
OK, #50 should fix this and it's so simple that I just merged it without review.
Could you please retest on main branch, and if it is OK then I will tag.
BTW, it makes me happy that the show
method for the ray geometry had everything needed to reproduce π
yep, thanks, the issue is fixed!
I just tried it out and now get an error:
Apparently there is a division by zero in this line: https://github.com/JuliaImageRecon/Sinograms.jl/blob/main/src/fbp/parker.jl#L97
Not sure how to debug this further.
Originally posted by @tknopp in https://github.com/JuliaImageRecon/Sinograms.jl/issues/47#issuecomment-1368958795