从 3D 数组中提取任意旋转的数据平面作为 2D 数组 [英] Extract arbitrarily rotated plane of data from 3D array as 2D array

查看:23
本文介绍了从 3D 数组中提取任意旋转的数据平面作为 2D 数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 matlab 中有一个 3D 数据矩阵,但我想从该矩阵中提取任意旋转的数据切片并将其存储为我可以访问的 2D 矩阵.类似于 slice() 函数如何显示以任何角度切片的数据,但我还希望能够像查看和修改数据一样查看和修改数据.

I have a 3D matrix of data in matlab, but I want to extract an arbitrarily rotated slice of data from that matrix and store it as a 2D matrix, which I can access. Similar to how the slice() function displays data sliced at any angle, except I would also like to be able to view and modify the data as if it were an array.

我有平面枢轴点的坐标以及旋转角度(在 x、y 和 z 轴上),我还计算了平面的方程:

I have the coordinates of the pivot-point of the plane as well as the angles of rotation (in x, y and z axis), I have also calculated the equation of the plane in the form:

Ax + By + Cz = D

并且可以提取仅包含落在该平面上的数据的 3D 矩阵,但我不知道如何将其转换为简单的 2D 数组.

and can extract a 3D matrix containing only the data that fall on that plane, but I don't know how to then convert that into a simple 2D array.

另一种方法是以某种方式在平面角度的相反方向旋转源矩阵,以便将数据平面与 XY 轴对齐,然后简单地提取矩阵的那部分,但我不知道是否可以旋转这样的矩阵.

Another way of doing it would be to somehow rotate the source matrix in the opposite direction of the angle of the plane, so as to line up the plane of data with the XY axis, and simply extract that portion of the matrix, but I do not know if rotating a matrix like that is possible.

我希望这个问题没有在其他地方得到解答,我已经在谷歌上搜索了一整天,但似乎没有一个问题与我的完全匹配.

I hope this hasn't been answered elsewhere, I've been googling it all day, but none of the problems seem to exactly match mine.

谢谢

推荐答案

你可以看看 此处的代码.我认为该功能与您要解决的功能相似.

函数从体积中提取任意平面,给定平面的大小、平面的中心点和平面法线,即[A,B,C].它还输出平面上每个像素的体积索引和坐标.

You can take a look at the code here. I think the function is similar to what you are trying to solve.

The function extracts an arbitrary plane from a volume given the size of the plane, the center point of the plane, and the plane normal, i.e. [A,B,C]. It also outputs the volumetric index and coordinate of each pixel on the plane.

这篇关于从 3D 数组中提取任意旋转的数据平面作为 2D 数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆