cryosparc2.convert.convert module

cryosparc2.convert.convert.acquisitionToRow(acquisition, ctfRow)[source]

Set labels values from acquisition to md row.

cryosparc2.convert.convert.addRandomSubset(img, imgRow)[source]
cryosparc2.convert.convert.alignmentToRow(alignment, alignmentRow, 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
cryosparc2.convert.convert.convertBinaryFiles(imgSet, outputDir, extension='mrcs')[source]

Convert binary images files to a format read by Cryosparc. Params:

imgSet: input image set to be converted. outputDir: where to put the converted file(s)
Return:
A dictionary with old-file as key and new-file as value If empty, not conversion was done.
cryosparc2.convert.convert.convertBinaryVol(vol, outputDir)[source]

Convert binary volume to a format read by Cryosparc. Params:

vol: input volume object to be converted. outputDir: where to put the converted file(s)
Return:
new file name of the volume (converted or not).
cryosparc2.convert.convert.convertCs2SQlite(args)[source]
cryosparc2.convert.convert.convertCs2Star(args)[source]
cryosparc2.convert.convert.coordinateToRow(coord, coordRow, copyId=True)[source]

Set labels values from Coordinate coord to md row.

cryosparc2.convert.convert.createItemMatrix(item, row, align)[source]
cryosparc2.convert.convert.cryosPARCwriteSetOfParticles(imgSet, starFile, outputDir, **kwargs)[source]
cryosparc2.convert.convert.cryosparcToLocation(filename)[source]

Return a location (index, filename) given a cryoSPARC filename with the index@filename structure.

cryosparc2.convert.convert.ctfModelToRow(ctfModel, ctfRow)[source]

Set labels values from ctfModel to md row.

cryosparc2.convert.convert.defineArgs()[source]
cryosparc2.convert.convert.geometryFromMatrix(matrix, inverseTransform)[source]
cryosparc2.convert.convert.imageToRow(img, imgRow, imgLabel=433, **kwargs)[source]
cryosparc2.convert.convert.locationTocCryosparc(index, filename)[source]

Convert an index and filename location to a string with @ as expected in cryoSPARC.

cryosparc2.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.

cryosparc2.convert.convert.objectToRow(obj, row, attrDict, extraLabels=[])[source]

This function will convert an EMObject into a XmippMdRow. Params:

obj: the EMObject instance (input) row: the XmippMdRow instance (output) attrDict: dictionary with the map between obj attributes(keys) and

row MDLabels in Xmipp (values).
extraLabels: a list with extra labels that could be included
as _xmipp_labelName
cryosparc2.convert.convert.particleToRow(part, partRow, **kwargs)[source]

Set labels values from Particle to md row.

cryosparc2.convert.convert.readSetOfParticles(filename, partSet, **kwargs)[source]

read from Relion image meta filename: The metadata filename where the image are. imgSet: the SetOfParticles that will be populated. rowToParticle: this function will be used to convert the row to Object

cryosparc2.convert.convert.rowToAcquisition(acquisitionRow)[source]

Create an acquisition from a row of a meta

cryosparc2.convert.convert.rowToAlignment(alignmentRow, 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

cryosparc2.convert.convert.rowToCoordinate(coordRow)[source]

Create a Coordinate from a row of a meta

cryosparc2.convert.convert.rowToCtfModel(ctfRow)[source]

Create a CTFModel from a row of a meta

cryosparc2.convert.convert.rowToObject(row, obj, attrDict, extraLabels=[])[source]

This function will convert from a XmippMdRow to an EMObject. Params:

row: the XmippMdRow instance (input) obj: the EMObject instance (output) attrDict: dictionary with the map between obj attributes(keys) and

row MDLabels in Xmipp (values).
extraLabels: a list with extra labels that could be included
as properties with the label name such as: _rlnSomeThing
cryosparc2.convert.convert.rowToParticle(partRow, particleClass=<class 'pwem.objects.data.Particle'>, **kwargs)[source]

Create a Particle from a row of a meta

cryosparc2.convert.convert.setCryosparcAttributes(obj, objRow, *labels)[source]

Set an attribute to obj from a label that is not basic ones. The new attribute will be named _rlnLabelName and the datatype will be set correctly.

cryosparc2.convert.convert.setObjId(obj, mdRow, label=435)[source]
cryosparc2.convert.convert.setOfImagesToMd(imgSet, imgMd, imgToFunc, **kwargs)[source]

This function will fill Relion metadata from a SetOfMicrographs Params:

imgSet: the set of images to be converted to metadata md: metadata to be filled rowFunc: this function can be used to setup the row before

adding to meta
cryosparc2.convert.convert.setPsdFiles(ctfModel, ctfRow)[source]

Set the PSD files of CTF estimation related to this ctfModel. The values will be read from the ctfRow if present.

cryosparc2.convert.convert.setRowId(mdRow, obj, label=435)[source]
cryosparc2.convert.convert.writeSetOfParticles(imgSet, fileName, extraPath)[source]