提取任意旋转的数据平面三维数组作为二维数组数组、平面、数据

2023-09-08 09:52:23 作者:我疯了。

我在MATLAB数据的3D矩阵,但我想提取的矩阵数据的任意旋转,切片,并将其保存为一个二维矩阵,这是我可以访问。类似于如何切片在任何角度的切片()函数显示数据,除我还要能够查看和修改数据,好像它是一个数组。

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矩阵,但我不知道如何再转化一个简单的二维数组。

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.

我希望这不是在别处回答,我已经整天都使用Google,但没有的问题似乎正好匹配我的。

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.

感谢

推荐答案

您可以看看的在code这里。我认为,功能类似于你正在试图解决什么。 该函数提取的任意平面从卷给出的的平面尺寸,所述平面的中心点,与平面正常,即[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.

 
精彩推荐
图片推荐