首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Matlab循环x射线

Matlab循环x射线
EN

Stack Overflow用户
提问于 2020-06-23 07:37:07
回答 1查看 29关注 0票数 0

所以我正在做一些像素值的比较,我在循环一些东西时遇到了麻烦。我要做128个能量通道的X射线重建,但我一次只能分析8个通道。

代码语言:javascript
运行
复制
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等等。类似于:

代码语言:javascript
运行
复制
for i = 1:8:120
sinogram_data(i)=sinogram_data(i:i+7,:,:,:);

当我尽我最大的努力时,我得到这个错误

代码语言:javascript
运行
复制
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

希望有人能帮我。提前感谢!

EN

回答 1

Stack Overflow用户

发布于 2020-06-23 09:08:07

代码语言:javascript
运行
复制
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,否则图像数据将始终被覆盖。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62525107

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档