Error during post alignment of cone beam data 2

3 次查看(过去 30 天)
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 个评论
Matt J
Matt J 2021-11-22
编辑:Matt J 2021-11-22
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.

请先登录,再进行评论。

回答(1 个)

yanqi liu
yanqi liu 2021-11-23
sir,may be use cell to save data
and upload astra_create_proj_geom to do some analysis

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by