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

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

问题描述

我在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.

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

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