pwem.protocols.protocol_align_movies module

class pwem.protocols.protocol_align_movies.ProtAlignMovies(**kwargs)[source]

Bases: pwem.protocols.protocol_movies.ProtProcessMovies

Base class for movie alignment protocols such as: motioncorr, crosscorrelation and optical flow

Alignment parameters are defined in common. For example, the frames range used for alignment and final sum, the binning factor or the cropping options (region of interest)

averageMovie(movie, inputFn, outputMicFn, binFactor=1, roi=None, dark=None, gain=None, splineOrder=None)[source]

Average a movie (using xmipp) taking into account the possible shifts and other alignment parameters. Params:

inputFn: input filename, either the movie file or a metadata
with the shifts and other info.

dark: dark file gain: gain correction file.

The output will be the averaged micrograph.

composePSD(psd1, psd2, outputFn, outputFnUncorrected=None, outputFnCorrected=None)[source]
composePSDImages(psdImg1, psdImg2, outputFn, outputFnUncorrected=None, outputFnCorrected=None)[source]

Compose a single PSD image: left part from psd1 (uncorrected PSD), right-part from psd2 (corrected PSD)

computePSD(inputMic, oroot, dim=384, overlap=0.4)[source]
computePSDImages(movie, fnUncorrected, fnCorrected, outputFnUncorrected=None, outputFnCorrected=None)[source]
computePSDs(movie, fnUncorrected, fnCorrected, outputFnUncorrected=None, outputFnCorrected=None)[source]
computeThumbnail(inputFn, scaleFactor=6, outputFn=None)[source]

Generates a thumbnail of the input file

correctGain(movieFn, outputFn, gainFn=None, darkFn=None)[source]

correct a movie with both gain and dark images

createOutputStep()[source]
getThumbnailFn(inputFn)[source]

Returns the default name for a thumbnail image

class pwem.protocols.protocol_align_movies.ProtAverageFrames(**kwargs)[source]

Bases: pwem.protocols.protocol_align_movies.ProtAlignMovies

Very simple protocol to align all the frames of a given data collection session. It can be used as a sanity check.

createOutputStep()[source]
pwem.protocols.protocol_align_movies.createAlignmentPlot(meanX, meanY)[source]

Create a plotter with the cumulative shift per frame.