(foci, mat_dims=None, xyz_dims=None)
return np.round_(result).astype(int)
Convert an N x 3 array of matrix indices to XYZ coordinates.
Convert an N x 3 array of matrix indices to XYZ coordinates.
Convert an N x 3 array of matrix indices to XYZ coordinates .
def mat_to_xyz(foci, mat_dims=None, xyz_dims=None):
    """ Convert an N x 3 array of matrix indices to XYZ coordinates. """
    foci = np.hstack((foci, np.ones((foci.shape[0], 1))))
    mat = np.array([[-2, 0, 0, 90], [0, 2, 0, -126], [0, 0, 2, -72]]).T
    result = np.dot(foci, mat)[:, ::-1]  # multiply and reverse column order
    return np.round_(result).astype(int)
def mat_to_xyz ( foci , mat_dims = None , xyz_dims = None ) : foci = np . hstack ( ( foci , np . ones ( ( foci . shape [ 0 ] , 1 ) ) ) ) mat = np . array ( [ [ - 2 , 0 , 0 , 90 ] , [ 0 , 2 , 0 , - 126 ] , [ 0 , 0 , 2 , - 72 ] ] ) . T result = np . dot ( foci , mat ) [ : , : : - 1 ] # multiply and reverse column order return np . round_ ( result ) . astype ( int )