xmipp3.protocols.protocol_movie_gain module

class xmipp3.protocols.protocol_movie_gain.XmippProtMovieGain(**args)[source]

Bases: pwem.protocols.protocol_movies.ProtProcessMovies

Estimate the gain image of a camera, directly analyzing one of its movies. It can correct the orientation of an external gain image (by comparing it with the estimated). Finally, it estimates the residual gain (the gain of the movie after correcting with a gain). The gain used in the correction will be preferably the external gain, but can also be the estimated gain if the first is not found. The same criteria is used for assigning the gain to the output movies (external corrected > external > estimated)

createOutputStep()[source]
doGainProcess(movieId)[source]
estimateGainFun(movie, noSigma=False, residual=False)[source]
estimateOrientationStep(movieDict)[source]
getArgs(movieFn, movieId, extraArgs='', residual=False)[source]
getEstimatedGainPath(movieId)[source]
getFinalGainPath()[source]
getInputGain()[source]
getOrientedCorrectionPath()[source]
getOrientedGainPath()[source]
getResidualGainPath(movieId)[source]
invertImage(img, outFn)[source]
match_orientation(exp_gain, est_gain)[source]

Calculates the correct orientation of the experimental gain image with respect to the estimated Input: 2 Xmipp Images

normalizeGainStep()[source]
readImage(fn)[source]
searchEstimatedGainPath()[source]
updateGainsOutput(movie, imgSet, imageFile)[source]
writeImageFromArray(array, fn)[source]
xmipp3.protocols.protocol_movie_gain.applyTransform(imag_array, M, shape)[source]

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

xmipp3.protocols.protocol_movie_gain.array_zeros_to_median(a, thres=0.01, depth=1)[source]

Return an array, replacing the zeros (values under a threshold) with the median of its surrounding values (with a depth)

xmipp3.protocols.protocol_movie_gain.arrays_correlation_FT(ar1, ar2_ft_conj, normalize=True)[source]

Return the correlation matrix of an array and the FT_conjugate of a second array using the fourier transform

xmipp3.protocols.protocol_movie_gain.invert_array(gain, thres=0.01, depth=1)[source]

Return the inverted array by first converting the values under the threshold to the median of the surrounding

xmipp3.protocols.protocol_movie_gain.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.protocols.protocol_movie_gain.translation_correction(Loc, shape)[source]

Return translation corrections given the max/min Location and the image shape