File containing a method for finding a connected subset, centered around a starting index, in a matrix. More...
Functions | |
| def | PyPO.MatUtils.findConnectedSubsets (mat, component, idx_start) |
| Find extent of centered connected subset in a matrix. More... | |
| def | PyPO.MatUtils.findRotation (self, v, u) |
| Find rotation matrix to rotate v onto u. More... | |
| def | PyPO.MatUtils.getAnglesFromMatrix (self, M) |
| Find x, y and z rotation angles from general rotation matrix. More... | |
File containing a method for finding a connected subset, centered around a starting index, in a matrix.
Used for creating masks for fitting Gaussians.
| def PyPO.MatUtils.findConnectedSubsets | ( | mat, | |
| component, | |||
| idx_start | |||
| ) |
Find extent of centered connected subset in a matrix.
| mat | Matrix of which to find largest connected subset. |
| component | Value on which to differentiate subset. |
| idx_start | Matrix index on which to center the subset. |
| def PyPO.MatUtils.findRotation | ( | self, | |
| v, | |||
| u | |||
| ) |
Find rotation matrix to rotate v onto u.
| v | Numpy array of length 3. |
| u | Numpy array of length 3. |
| def PyPO.MatUtils.getAnglesFromMatrix | ( | self, | |
| M | |||
| ) |
Find x, y and z rotation angles from general rotation matrix.
Note that the angles are not necessarily the same as the original angles of the matrix. However, the matrix constructed by the found angles applies the same 3D rotation as the input matrix.
| M | Numpy array of shape (3,3) containg a general rotation matrix. |