matlab 三维图像投影,matlab – 3D平面上的三维灰度体积投影

这篇博客介绍了如何在MATLAB中使用tformarray函数对三维灰度体积数据进行旋转和平面投影。通过创建合成数据集,展示了一种中心化、旋转和重新定位数据的方法,并利用isosurface函数绘制旋转前后的三维图像。同时,通过sum函数对旋转后的数据进行投影可视化。
摘要由CSDN通过智能技术生成

解决方案的新尝试:

在下面的代码中,我使用tformarray()来旋转空间中的结构.首先,数据居中,然后使用rotationmat3D旋转以产生空间变换,然后再将数据移回其原始位置.

因为我之前从未使用过tformarray,所以我通过简单地用零填充数据矩阵(NxMxP)来旋转数据点,这些数据点在旋转后落在定义的区域之外.如果有人知道更好的方法,请告诉我们:)

代码:

%Synthetic dataset, 25x50x25

blob = flow();

%Pad to allow for rotations in space. Bad solution,

%something better might be possible to better understanding

%of tformarray()

blob = padarray(blob,size(blob));

f1 = figure(1);clf;

s1=subplot(1,2,1);

p = patch(isosurface(blob,1));

set(p, 'FaceColor', 'red', 'EdgeColor', 'none');

daspect([1 1 1]);

view([1 1 1])

camlight

lighting gouraud

%Calculate center

blob_center = (size(blob) + 1) / 2;

%Translate to origin transformation

T1 = [1 0 0 0

0 1 0 0

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值