필터 지우기
필터 지우기

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

조회 수: 2 (최근 30일)
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
R 2024년 4월 3일
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!

추가 답변 (0개)

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by