嗨,我正在尝试使用 iradon 变换运行用于 2D 投影图像重建的代码。我的目标是显着减少我尝试在笔记本电脑的本地集群配置文件中使用并行 for 循环的时间。但是我似乎遇到了一个我发现很难调试的错误-
错误:parfor 中的变量数据无法分类。
我的代码-
clc;
close all;
clear all;
tic
% projection_length = input('Define projection length (px) = ');
projection_length = 4100; % which means our ouput will have 4100 cross sectional images of the capillary tube
parfor q = 1:projection_length
for i = 1:5 % typically 500, since we take 500 projections around the capillary tube 0.72 deg inc
if length(num2str(i)) == 1
data(q,:, i) = imread(['pre00' num2str(i) '.tif'], 'PixelRegion', {[1 1600], [q q]});
elseif length(num2str(i)) == 2
data(q,:, i) = imread(['pre0' num2str(i) '.tif'], 'PixelRegion', {[1 1600], [q q]});
elseif length(num2str(i)) == 3
data(q,:, i) = imread(['pre' num2str(i) '.tif'], 'PixelRegion', {[1 1600], [q q]});
end
disp(['Analyzing projection ' num2str(q) ' of ' num2str(projection_length) ', Angle ' num2str(i) '...']);
end
H = iradon( data(q,:,:), 0.72, 'Hann', 0.8, 1600);
end
toc