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]
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.iterSubtomogramsByVol(subtomogramSet)[source]

Iterate subtomograms ordered by tomogram

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

Create a CTFModel from a json file

eman2.convert.convert.jsons2SetCoords3D(protocol, setTomograms, outPath)[source]
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 a given 2D shifts in X and Y…and the 3 euler angles.

eman2.convert.convert.readCTFModel(ctfModel, filename)[source]
eman2.convert.convert.readCoordinate3D(box, inputTomo)[source]
eman2.convert.convert.readCoordinates(mic, fileName, coordsSet, invertY=False)[source]
eman2.convert.convert.readSetOfCoordinates(workDir, micSet, coordSet, invertY=False, newBoxer=False)[source]

Read from Eman .json files. Params:

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

name should be the same of the micrographs.

coordSet: the SetOfCoordinates that will be populated.

eman2.convert.convert.readSetOfCoordinates3D(jsonBoxDict, coord3DSetDict, inputTomo, updateItem=None)[source]
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.setCoords3D2Jsons(setTomograms, setCoords, path)[source]
eman2.convert.convert.setWrongDefocus(ctfModel)[source]
eman2.convert.convert.updateSetOfSubTomograms(inputSetOfSubTomograms, outputSetOfSubTomograms, particlesParams)[source]

Update a set of subtomograms from a template and copy attributes coverage/score/transform

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.

eman2.convert.convert.writeSetOfSubTomograms(subtomogramSet, 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.