mcot.surface.utils

Functions

affine_mult(affine, coordinates)

Convert the given coordinates with the affine transformation.

average_orientation(orientations[, weights, …])

Averages the provided orientations using PCA.

gcoord_mult(args)

Runs the gcoord_mult script.

gcoord_split(args)

Runs the gcoord_split script.

signed_tetrahedral_volume(p1, p2, p3)

Computes the signed tetrahedral volume.

affine_mult

mcot.surface.utils.affine_mult(affine, coordinates)[source]

Convert the given coordinates with the affine transformation.

Parameters
  • affine – (4 x 4) array defining the affine transformation

  • coordinates – (…, 3) array of locations.

average_orientation

mcot.surface.utils.average_orientation(orientations, weights=None, return_val=False)[source]

Averages the provided orientations using PCA.

Parameters
  • orientations – (…, N, M) array of N orientations that will be averaged in M-dimensional space

  • weights – (…, N) array with the weighting of the orientations

  • return_val – if True returns the eigenvalues as well as the mean hemisphere

Returns

(…, M) array with the mean hemisphere

gcoord_mult

mcot.surface.utils.gcoord_mult(args)[source]

Runs the gcoord_mult script.

Parameters

args – arguments from the command line

gcoord_split

mcot.surface.utils.gcoord_split(args)[source]

Runs the gcoord_split script.

Parameters

args – arguments from the command line

signed_tetrahedral_volume

mcot.surface.utils.signed_tetrahedral_volume(p1, p2, p3)[source]

Computes the signed tetrahedral volume.

Tetrahedron is formed by (p1, p2, p3, and origin)

Parameters
  • p1 – (…, 3) array with positions of first point

  • p2 – (…, 3) array with positions of second point

  • p3 – (…, 3) array with positions of third point

Returns

(…, ) array with the volumes (negative if normal points towards the origin)