Error during post alignment of cone beam data 2

1 回表示 (過去 30 日間)
Gideon Chinamatira
Gideon Chinamatira 2021 年 11 月 22 日
回答済み: yanqi liu 2021 年 11 月 23 日
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 Center および File ExchangeImages についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by