xmipp3.utils module

This module contains utils functions for Xmipp protocols

class xmipp3.utils.Data(**kwargs)[source]

Bases: object

Store data points.

addPoint(point, position=None)[source]
clear()[source]
getDiscardedSize()[source]
getPoint(index)[source]
getSelectedSize()[source]
getSize()[source]
getWeights()[source]
getXData()[source]
getYData()[source]
getZData()[source]
iterAll()[source]

Iterate over all points, including the discarded ones.

class xmipp3.utils.PathData(**kwargs)[source]

Bases: Data

Just contains two list of x and y coordinates.

createEmptyPoint()[source]
removeLastPoint()[source]
splitLongestSegment()[source]

Split the longest segment by adding the midpoint.

class xmipp3.utils.Point(pointId, data, weight, state=0)[source]

Bases: object

Return x, y 2d coordinates and some other properties such as weight and state.

DISCARDED = -1
NORMAL = 0
SELECTED = 1
eval(expression)[source]
getData()[source]
getId()[source]
getState()[source]
getWeight()[source]
getX()[source]
getY()[source]
getZ()[source]
isDiscarded()[source]
isSelected()[source]
setDiscarded()[source]
setSelected()[source]
setState(newState)[source]
setX(value)[source]
setY(value)[source]
setZ(value)[source]
xmipp3.utils.applyTransform(imag_array, M, shape)[source]

Apply a transformation(M) to a np array(imag) and return it in a given shape

xmipp3.utils.copy_image(imag)[source]

Return a copy of a xmipp_image

xmipp3.utils.flipYImage(inFn, outFn=None, outDir=None)[source]

Flips an image in the Y axis

xmipp3.utils.matmul_serie(mat_list, size=4)[source]

Return the matmul of several numpy arrays

xmipp3.utils.normalize_array(ar)[source]

Normalize values in an array with mean 0 and std deviation 1

xmipp3.utils.readImage(fn)[source]
xmipp3.utils.rotation(imag, angle, shape, P)[source]

Rotate a np.array and return also the transformation matrix #imag: np.array #angle: angle in degrees #shape: output shape #P: transform matrix (further transformation in addition to the rotation)

xmipp3.utils.surrounding_values(a, ii, jj, depth=1)[source]

Return a list with the surrounding elements, given the indexs of the center, from an 2D numpy array

xmipp3.utils.validateXmippGpuBins()[source]
xmipp3.utils.writeImageFromArray(array, fn)[source]