I have some basic difficulties when using the option FanCoverage='minimal' . In the example below I first apply fanbeam to the phantom image and then attempt to reconstruct the phantom using ifanbeam. It turns out that ifanbeam results in errors for specific combinations of the parameters FSS and FRI.
P = radon(I,0:0.5:179.5);
F = para2fan(P,D,'FanSensorSpacing',FSS,'FanRotationIncrement',FRI,...
Depending on the choice of FSS and FRI, ifanbeam sometimes gives the following error:
??? Error using ==> fan2para>checkAngles at 266
Internal problem: THETA values must be in the range [min(GAMMA),360) degrees.
Error in ==> fan2para at 193
Error in ==> ifanbeam at 193
[P,oploc,optheta] = fan2para(F,d,...
As an example, the code works for
- FSS=1, FRI=1
- FSS=1, FRI=2
- FSS=1, FRI=3
- FSS=1, FRI=5
- FSS=1, FRI=6
- FSS=1, FRI=10
while the error occurs for the combinations
- FSS=1, FRI=4
- FSS=1, FRI=7
- FSS=1, FRI=8
- FSS=1, FRI=9
I tried many different combinations, but I really cannot find a reason why some combinations work and others don't. The problem always seems to originate in line 262 of fan2para
isAnyThetaTooSmall = any(thetaDeg < floor(min(gammaDeg)));
At this point I am not able to determine whether the root of the problem lies in the theta-vector or the gamma-vector.
Might there be a problem with the subroutines which build these vectors or am I simply using invalid input parameters that make no sense?