sphire.convert module

class sphire.convert.CoordBoxReader(boxSize, yFlipHeight=None, boxSizeEstimated=False)[source]

Bases: object

Helper class to read coordinates from .BOX files.

close()[source]
iter3DCoords()[source]
iterCoords()[source]
open(filename)[source]

Open a new filename to write, close previous one if open.

class sphire.convert.CoordBoxWriter(boxSize, yFlipHeight=None)[source]

Bases: object

Helper class to write a .BOX file for cryolo.

close()[source]
open(filename)[source]

Open a new filename to write, close previous one if open.

writeCoord(coord)[source]
sphire.convert.convertMicrographs(micList, micDir, prefix='mic')[source]

Convert (or simply link) input micrographs into the given directory in a format that is compatible with crYOLO.

sphire.convert.convertTomograms(micList, micDir)[source]
sphire.convert.getFlipYHeight(filename)[source]

Return y-Height if flipping is needed, None otherwise

sphire.convert.getMicIdName(mic, prefix='mic', suffix='')[source]

Return a name for the micrograph based on its IDs.

sphire.convert.needToFlipOnY(filename)[source]

Returns true if need to flip coordinates on Y

sphire.convert.readSetOfCoordinates3D(tomogram, coord3DSetDict, coordsFile, boxSize, origin=None)[source]
sphire.convert.roundInputSize(inputSize)[source]

Returns the closest value to inputSize th is multiple of 32

sphire.convert.roundTo(number, base=1.0)[source]

Returns the closest int value to number that is multiple of base

sphire.convert.writeSetOfCoordinates(boxDir, coordSet, micList=None)[source]

Convert a SetOfCoordinates to Cryolo box files. Params:

boxDir: the output directory where to generate the files. coordSet: the input SetOfCoordinates that will be converted. micList: if not None, only coordinates from this micrographs

will be written.