Error during post alignment of cone beam data using the ASTRA toolbox

6 ビュー (過去 30 日間)
Gideon Chinamatira
Gideon Chinamatira 2021 年 11 月 22 日
回答済み: yanqi liu 2021 年 11 月 23 日
Hi i use the following code to convert my projection data into vector based geometry :
proj_geom.DistanceOriginSource = 141.896514892578;
proj_geom.DistanceOriginDetector = 729.603485;
proj_geom.DetectorSpacingX = 0.2;
proj_geom.DetectorSpacingY = 0.2;
VoxelSize = 0.65127489159;
vectors = zeros(numel(angles), 12);
for i = 1:numel(angles)
% source
vectors(i,1) = sin(angles(i)) * proj_geom.DistanceOriginSource/VoxelSize;
vectors(i,2) = -cos(angles(i)) * proj_geom.DistanceOriginSource/VoxelSize;
vectors(i,3) = 0;
% center of detector
vectors(i,4) = -sin(angles(i)) * proj_geom.DistanceOriginDetector/VoxelSize;
vectors(i,5) = cos(angles(i)) * proj_geom.DistanceOriginDetector/VoxelSize;
vectors(i,6) = 0;
% vector from detector pixel (0,0) to (0,1) etector pixel (0,0) to (0,1)
vectors(i,7) = cos(angles(i)) * proj_geom.DetectorSpacingX/VoxelSize;
vectors(i,8) = sin(angles(i)) * proj_geom.DetectorSpacingX/VoxelSize;
vectors(i,9) = 0;
% vector from detector pixel (0,0) to (1,0)
vectors(i,10) = 0;
vectors(i,11) = 0;
vectors(i,12) = proj_geom.DetectorSpacingY/VoxelSize;
end
And I then use the following code to perform a reconstruction post alignment
% Parameters: #rows, #columns, vectors
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;
Index in position 2 exceeds array bounds (must not exceed 1).
Error in trialcode_v2 (line 68)
proj_geom(:,4:6) = proj_geom(:,4:6) + factor(1) * proj_geom(:,7:9) + factor(2) * proj_geom(:,10:12);
Please assist

回答 (1 件)

yanqi liu
yanqi liu 2021 年 11 月 23 日
sir,may be disp(proj_geom) to check proj_geom value

Community Treasure Hunt

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

Start Hunting!

Translated by