所以我正在做一些像素值的比较,我在循环一些东西时遇到了麻烦。我要做128个能量通道的X射线重建,但我一次只能分析8个通道。
sinogram_data=sinogram_data(1:8,:,:,:);
images = perform_reconstruction_all_energy(sinogram_data, geostruct, reconst_param, ART_param, version_id);
save_image_data(images, dataset_path);
我想让代码在这里循环,所以我得到了16个图像/正弦图形,其中有1:8,9:15等等。类似于:
for i = 1:8:120
sinogram_data(i)=sinogram_data(i:i+7,:,:,:);
当我尽我最大的努力时,我得到这个错误
Unable to perform assignment because the size of the left side is 1-by-350-by-350 and the size of the right side is 350-by-350-by-8
希望有人能帮我。提前感谢!
发布于 2020-06-23 09:08:07
for i=1:8:128
current_sinogram_data=sinogram_data(i:i+7,:,:,:);
images = perform_reconstruction_all_energy(current_sinogram_data, geostruct, reconst_param, ART_param, version_id);
save_image_data(images, dataset_path); % change the dataset_path during for-loop
end
您必须在for循环期间更改dataset_path,否则图像数据将始终被覆盖。
https://stackoverflow.com/questions/62525107
复制相似问题