Error during post alignment of cone beam data 2

when i use the following code for image reconstruction:
i=0;
proj_num =300; % number of used projections
step = 3000/proj_num;
% Preparing space for projections
% Coordinate order: column (u), angle, row (v)
projections = zeros(810,proj_num,2000);
ectors = zeros(numel(linspace(0,2pi,300)), 12);
for i = 1:numel(linspace(0,2
pi,300))
% source
vectors(i,1) = sin(linspace(0,2*pi,300)) * 141.896514892578;
vectors(i,2) = -cos(linspace(0,2*pi,300)) * 141.896514892578;
vectors(i,3) = 0;
% center of detector
vectors(i,4) = -sin(linspace(0,2*pi,300)) * (871.5-141.896514892578);
vectors(i,5) = cos(linspace(0,2*pi,300)) * (871.5-141.896514892578);
vectors(i,6) = 0;
% vector from detector pixel (0,0) to (0,1)
vectors(i,7) = cos(linspace(0,2*pi,300)) * 0.2;
vectors(i,8) = sin(linspace(0,2*pi,300)) * 0.2;
vectors(i,9) = 0;
% vector from detector pixel (0,0) to (1,0)
vectors(i,10) = 0;
vectors(i,11) = 0;
vectors(i,12) = 0.2;
end
proj_geom = astra_create_proj_geom('cone_vec', 2000, 810, vectors);
factor(1) = 10;
factor(2) = 10;
proj_geom(:,4:6) = proj_geom(:,4:6) + factor(1) * proj_geom(:,7:9) + factor(2) * proj_geom(:,10:12);
The following error shows up;
Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 1-by-300.
Error in vector_code_samplerun (line 31)
vectors(i,1) = sin(linspace(0,2*pi,300)) * 141.896514892578;
Please assist

1 commentaire

Matt J
Matt J le 22 Nov 2021
Modifié(e) : Matt J le 22 Nov 2021
The intention of the line,
vectors(i,1) = sin(linspace(0,2*pi,300)) * 141.896514892578;
is not clear. vector(i,1) is a scalar memory location. You cannot put a 1x300 vector there.

Connectez-vous pour commenter.

Réponses (1)

yanqi liu
yanqi liu le 23 Nov 2021

0 votes

sir,may be use cell to save data
and upload astra_create_proj_geom to do some analysis

Catégories

En savoir plus sur Images dans Centre d'aide et File Exchange

Produits

Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by