eman2.convert.convert module

eman2.convert.convert.alignmentToRow(alignment, alignType)[source]
is2D == True-> matrix is 2D (2D images alignment)

otherwise matrix is 3D (3D volume alignment or projection)

invTransform == True -> for xmipp implies projection

-> for xmipp implies alignment

eman2.convert.convert.calculatePhaseShift(ampcont)[source]
eman2.convert.convert.convertImage(inputLoc, outputLoc)[source]

This function will allow us to use EMAN2 to write some formats not currently supported by the native image library (Xmipp). Underneath, it will call an script to do the job.

eman2.convert.convert.convertReferences(refSet, outputFn)[source]

Simplified version of writeSetOfParticles function. Writes out an hdf stack.

eman2.convert.convert.geometryFromMatrix(matrix, inverseTransform)[source]

Convert the transformation matrix to shifts and angles. :param matrix: input matrix :return: two lists, shifts and angles

eman2.convert.convert.getImageDimensions(imageFile)[source]

This function will allow us to use EMAN2 to read some formats not currently supported by the native image library (Xmipp). Underneath, it will call a script to do the job.

eman2.convert.convert.getLastParticlesParams(directory)[source]

Return a dictionary containing the params values of the last iteration.

Key: Particle index (int) Value: Dict[{coverage: float, score: float, alignMatrix: list[float]}]

eman2.convert.convert.iterLstFile(filename)[source]
eman2.convert.convert.iterParticlesByMic(partSet)[source]

Iterate the particles ordered by micrograph

eman2.convert.convert.jsonToCtfModel(ctfJsonFn, ctfModel)[source]

Create a CTFModel from a json file

eman2.convert.convert.loadJson(jsonFn)[source]

This function loads the Json dictionary into memory

eman2.convert.convert.matrixFromGeometry(shifts, angles, inverseTransform)[source]

Create the transformation matrix from given 2D shifts in X and Y and the 3 euler angles. :param shifts: input list of shifts :param angles: input list of angles :return matrix

eman2.convert.convert.readCTFModel(ctfModel, filename)[source]

Set values for the ctfModel. :param ctfModel: output CTF model :param filename: input file to parse

eman2.convert.convert.readCoordinates(mic, fileName, coordsSet, invertY=False)[source]

Parse coords file and populate coordsSet. :param mic: input micrograph object :param fileName: input file to parse :param coordsSet: output set of coords :param invertY: flip Y axis

eman2.convert.convert.readSetOfCoordinates(workDir, micSet, coordSet, invertY=False)[source]

Read from Eman .json files. :param workDir: where the Eman boxer output files are located. :param micSet: the SetOfMicrographs to associate the .json, which

name should be the same of the micrographs.

Parameters

coordSet – the SetOfCoordinates that will be populated.

eman2.convert.convert.readSetOfParticles(lstFile, partSet, copyOrLink, direc)[source]
eman2.convert.convert.rowToAlignment(alignmentList, alignType)[source]
is2D == True-> matrix is 2D (2D images alignment)

otherwise matrix is 3D (3D volume alignment or projection)

invTransform == True -> for xmipp implies projection

eman2.convert.convert.setWrongDefocus(ctfModel)[source]

Set parameters if results parsing has failed. :param ctfModel: the model to be updated

eman2.convert.convert.writeCTFModel(ctfObj, filename)[source]

Write a CTFModel object as Xmipp .ctfparam

eman2.convert.convert.writeJson(jsonDict, jsonFn)[source]

This function write a Json dictionary

eman2.convert.convert.writeSetOfMicrographs(micSet, filename)[source]

Simplified function borrowed from xmipp.

eman2.convert.convert.writeSetOfParticles(partSet, path, **kwargs)[source]

Convert the imgSet particles to .hdf files as expected by Eman. This function should be called from a current dir where the images in the set are available.