Why do I get iradon error saying THETA does not match the number of projections?

7 vues (au cours des 30 derniers jours)
I want to do filter back projection after creating a sinogram, but I keep getting this error: The sinogram is made of 400 projections and has a size of 400 x 500.
Error using iradon>parse_inputs
THETA does not match the number of projections.
Error in iradon (line 119)
[p,theta,filter,d,interp,N] = parse_inputs(args{:});
reconstructed_image = iradon(sinogram, theta)
%This is the part of my code that does not work.
% Display the sinogram
figure;
imshow(sinogram, []);
% Define the angular range (theta) for equally spaced angles from 0 to 180 degrees with a step size of 0.45
theta = 0:0.45:180-0.45;
% Perform filtered back projection (FBP) using iradon to reconstruct the image
reconstructed_image = iradon(sinogram, theta;
% Display the reconstructed image
figure;
imshow(reconstructed_image, []);

Réponse acceptée

R
R le 3 Avr 2024
Hi Tevin,
I understand that the projection data i.e. 'sinogram' is made up of 400x500 projections. Therefore, 'theta' value should be a 1x500 numeric vector. The following code demonstrates the changes you can make to resolve the error:
theta = 0:180/500:180-180/500;
You can also use the following command that automatically sets the incremental angle between projections to 180/size(R,2)
reconstructed_image = iradon(sinogram, []);
Refer to the following documentation for more information:
Hope this helps!

Plus de réponses (0)

Produits


Version

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by