tomo.objects module

class tomo.objects.AverageSubTomogram(**kwargs)[source]

Bases: tomo.objects.SubTomogram

Represents a set of Averages. It is a SetOfParticles but it is useful to differentiate outputs.

class tomo.objects.ClassSubTomogram(**kwargs)[source]

Bases: tomo.objects.SetOfSubTomograms

Represent a Class that groups SubTomogram objects. The representative of the class is an AverageSubTomogram.

REP_TYPE

alias of AverageSubTomogram

clone()[source]

Override the clone defined in Object to avoid copying _mapperPath property

close()[source]
copyInfo(other)[source]

Copy basic information (id and other properties) but not _mapperPath or _size from other set of SubTomograms to current one.

class tomo.objects.Coordinate3D(**kwargs)[source]

Bases: pwem.objects.data.EMObject

This class holds the (x,y) position and other information associated with a coordinate

copyInfo(coord)[source]

Copy information from other coordinate.

euler2Matrix(r, p, y)[source]
eulerAngles()[source]
getBoxSize()[source]
getMatrix()[source]
getPosition()[source]

Return the position of the coordinate as a (x, y) tuple. mode: select if the position is the center of the box or in the top left corner.

getVolId()[source]
getVolName()[source]
getVolume()[source]

Return the micrograph object to which this coordinate is associated.

getX()[source]
getY()[source]
getZ()[source]
invertY()[source]
scale(factor)[source]

Scale x, y and z coordinates by a given factor.

setBoxSize(boxSize)[source]
setMatrix(matrix)[source]
setPosition(x, y, z)[source]
setVolId(volId)[source]
setVolume(volume)[source]

Set the micrograph to which this coordinate belongs.

setX(x)[source]
setY(y)[source]
setZ(z)[source]
shiftX(shiftX)[source]
shiftY(shiftY)[source]
class tomo.objects.LandmarkModel(tsId=None, fileName=None, modelName=None, **kwargs)[source]

Bases: pwem.objects.data.EMObject

Represents the set of landmarks belonging to an specific Tilt-series.

addLandmark(xCoor, yCoor, tiltIm, chainId, xResid, yResid)[source]
getFileName()[source]
getModelName()[source]
getTsId()[source]
setFileName(fileName)[source]
setModelName(modelName)[source]
setTsId(tsId)[source]
class tomo.objects.Mesh(path=None, group=None, **kwargs)[source]

Bases: pwem.objects.data.EMObject

Mesh object: it stores the coordinates of the points (specified by the user) needed to define the triangulation of a volume. A Mesh object can be consider as a point cloud in 3D containing the coordinates needed to divide a given region of space into planar triangles interconnected that will result in a closed surface.

getGroup()[source]
getMesh()[source]
getPath()[source]
getVolId()[source]
getVolume()[source]

Return the tomogram object to which this mesh is associated.

setGroup(group)[source]
setPath(path)[source]
setVolume(volume)[source]

Set the tomogram to which this mesh belongs.

class tomo.objects.SetOfAverageSubTomograms(**kwargs)[source]

Bases: tomo.objects.SetOfSubTomograms

ITEM_TYPE

alias of AverageSubTomogram

REP_TYPE

alias of AverageSubTomogram

class tomo.objects.SetOfClassesSubTomograms(**kwargs)[source]

Bases: pwem.objects.data.SetOfClasses

Store results from a subtomogram averaging method.

ITEM_TYPE

alias of ClassSubTomogram

REP_TYPE

alias of AverageSubTomogram

class tomo.objects.SetOfCoordinates3D(**kwargs)[source]

Bases: pwem.objects.data.EMSet

Encapsulate the logic of a set of volumes coordinates. Each coordinate has a (x,y,z) position and is related to a Volume The SetOfCoordinates3D can also have information about TiltPairs.

ITEM_TYPE

alias of Coordinate3D

copyInfo(other)[source]

Copy basic information (id and other properties) but not _mapperPath or _size from other set of objects to current one.

getBoxSize()[source]

Return the box size of the particles.

getFiles()[source]

Get all filePaths

getFirstItem()[source]

Return the first item in the Set.

getPrecedents()[source]

Returns the SetOfTomograms or Tilt Series associated with this SetOfCoordinates

getSamplingRate()[source]

Return the sampling rate of the particles.

getSummary()[source]
iterCoordinates(volume=None)[source]

Iterate over the coordinates associated with a tomogram. If tomogram=None, the iteration is performed over the whole set of coordinates.

iterVolumeCoordinates(volume)[source]

Iterates over the set of coordinates belonging to that micrograph.

iterVolumes()[source]

Iterate over the objects set associated with this set of coordinates.

setBoxSize(boxSize)[source]

Set the box size of the particles.

setPrecedents(precedents)[source]

Set the tomograms or Tilt Series associated with this set of coordinates. Params:

tomograms: Either a SetOfTomograms or Tilt Series object or a pointer to it.
setSamplingRate(sampling)[source]

Set the sampling rate of the particles.

class tomo.objects.SetOfLandmarkModels(**kwargs)[source]

Bases: pwem.objects.data.EMSet

Represents a class that groups a set of landmark models.

ITEM_TYPE

alias of LandmarkModel

class tomo.objects.SetOfMeshes(*args, **kwargs)[source]

Bases: pwem.objects.data.EMSet

Store a series of meshes.

ITEM_TYPE

alias of Mesh

getVolumes()[source]

Returns the SetOfTomograms associated with this SetOfCoordinates

iterItems(orderBy='id', direction='ASC', where='1', limit=None)[source]

Redefine iteration to set the acquisition to images.

setVolumes(volumes)[source]

Set the tomograms associated with this set of coordinates. Params:

tomograms: Either a SetOfTomograms object or a pointer to it.
class tomo.objects.SetOfSubTomograms(**kwargs)[source]

Bases: pwem.objects.data.SetOfVolumes

ITEM_TYPE

alias of SubTomogram

REP_TYPE

alias of SubTomogram

getCoordinates3D()[source]

Returns the SetOfCoordinates associated with this SetOfParticles

hasCoordinates3D()[source]
setCoordinates3D(coordinates)[source]

Set the SetOfCoordinates associates with this set of particles.

class tomo.objects.SetOfTiltSeries(**kwargs)[source]

Bases: tomo.objects.SetOfTiltSeriesBase

ITEM_TYPE

alias of TiltSeries

class tomo.objects.SetOfTiltSeriesBase(**kwargs)[source]

Bases: pwem.objects.data.SetOfImages

EXPOSE_ITEMS = True

Base class for SetOfTiltImages and SetOfTiltImagesM.

copyItems(inputTs, orderByTs='id', updateTsCallback=None, orderByTi='id', updateTiCallback=None)[source]

Copy items (TiltSeries and TiltImages) from the input Set. Params:

inputTs: input TiltSeries (or movies) from where to copy elements. orderByTs: optional orderBy value for iterating over TiltSeries updateTsCallback: optional callback after TiltSeries is created orderByTi: optional orderBy value for iterating over TiltImages updateTiCallback: optional callback after TiltImage is created
getFirstItem()[source]

Return the first item in the Set.

getScannedPixelSize()[source]
iterClassItems(iterDisabled=False)[source]

Iterate over the images of a class. Params:

iterDisabled: If True, also include the disabled items.
iterItems(orderBy='id', direction='ASC')[source]

Redefine iteration to set the acquisition to images.

updateDim()[source]

Update dimensions of this set base on the first element.

class tomo.objects.SetOfTiltSeriesM(**kwargs)[source]

Bases: tomo.objects.SetOfTiltSeriesBase

ITEM_TYPE

alias of TiltSeriesM

copyInfo(other)[source]

Copy SoM specific information plus inherited

getDark()[source]
getFramesRange()[source]
getGain()[source]
setDark(dark)[source]
setFramesRange(value)[source]
setGain(gain)[source]
class tomo.objects.SetOfTomograms(*args, **kwargs)[source]

Bases: pwem.objects.data.SetOfVolumes

EXPOSE_ITEMS = True
ITEM_TYPE

alias of Tomogram

updateDim()[source]

Update dimensions of this set base on the first element.

class tomo.objects.SubTomogram(**kwargs)[source]

Bases: pwem.objects.data.Volume

getAcquisition()[source]
getCoordinate3D()[source]
getVolId()[source]

Return the tomogram id if the coordinate is not None. or have set the _volId property.

getVolName()[source]

Return the tomogram filename if the coordinate is not None. or have set the _volName property.

hasAcquisition()[source]
hasCoordinate3D()[source]
setAcquisition(acquisition)[source]
setCoordinate3D(coordinate)[source]
setVolId(volId)[source]
setVolName(volName)[source]
class tomo.objects.TiltImage(location=None, **kwargs)[source]

Bases: pwem.objects.data.Image, tomo.objects.TiltImageBase

Tilt image

copyInfo(other, copyId=False)[source]

Copy basic information

parseFileName(suffix='', extension=None)[source]

This method returns the filename of the Tilt-Image adding a specified suffix and changing its extension. :param suffix: String to be added at the end of the location path (before extension). :param extension: String containing the new extension of the filename. :return: String containing the parsed filename with the specified suffix and extension.

class tomo.objects.TiltImageBase(**kwargs)[source]

Bases: object

Base class for TiltImageM and TiltImage.

copyInfo(other, copyId=False)[source]
getAcquisitionOrder()[source]
getTiltAngle()[source]
getTsId()[source]

Get unique TiltSerie ID, usually retrieved from the file pattern provided by the user at the import time.

setTiltAngle(value)[source]
setTsId(value)[source]
class tomo.objects.TiltImageM(location=None, **kwargs)[source]

Bases: pwem.objects.data.Movie, tomo.objects.TiltImageBase

Tilt movie.

copyInfo(other, copyId=False)[source]

Copy basic information

class tomo.objects.TiltSeries(**kwargs)[source]

Bases: tomo.objects.TiltSeriesBase

ITEM_TYPE

alias of TiltImage

applyTransform(outputFilePath)[source]
class tomo.objects.TiltSeriesBase(**kwargs)[source]

Bases: pwem.objects.data.SetOfImages

append(tiltImage)[source]

Add a image to the set.

clone(ignoreAttrs=('_mapperPath', '_size'))[source]

Override the clone defined in Object to avoid copying _mapperPath property

close()[source]
copyInfo(other, copyId=False)[source]

Copy basic information (id and other properties) but not _mapperPath or _size from other set of tomograms to current one.

generateTltFile(tltFilePath, reverse=False)[source]

Generates an angle file in .tlt format in the specified location. If reverse is set to true the angles in file are sorted in the opposite order

getScannedPixelSize()[source]
getTsId()[source]

Get unique TiltSerie ID, usually retrieved from the file pattern provided by the user at the import time.

setTsId(value)[source]
class tomo.objects.TiltSeriesDict(inputSet=None, outputSet=None, newItemsCallback=None, doneItemsCallback=None)[source]

Bases: object

Helper class that to store TiltSeries and TiltImage but using dictionaries for quick access. This class also contains some logic related to the streaming: - Check for new input items that needs to be processed - Check for items already done that needs to be saved.

addTi(ti)[source]
addTs(ts, includeTi=False)[source]

Add a clone of the tiltseries.

allDone()[source]

Return True if input stream is closed and all task are done.

getTi(tsId, tiObjId)[source]
getTiDict(tsId)[source]
getTiList(tsId)[source]
getTs(tsId)[source]
hasTs(tsId)[source]
setFinished(*tsIdList)[source]

Notify that all TiltSeries in the list of ids are finished.

update()[source]
class tomo.objects.TiltSeriesM(**kwargs)[source]

Bases: tomo.objects.TiltSeriesBase

ITEM_TYPE

alias of TiltImageM

class tomo.objects.TomoAcquisition(**kwargs)[source]

Bases: pwem.objects.data.Acquisition

getAngleAxis1()[source]
getAngleAxis2()[source]
getAngleMax()[source]
getAngleMin()[source]
getStep()[source]
setAngleAxis1(value)[source]
setAngleAxis2(value)[source]
setAngleMax(value)[source]
setAngleMin(value)[source]
setStep(value)[source]
class tomo.objects.Tomogram(**kwargs)[source]

Bases: pwem.objects.data.Volume

getAcquisition()[source]
getTsId()[source]

Get unique TiltSeries ID, usually retrieved from the file pattern provided by the user at the import time.

hasAcquisition()[source]
setAcquisition(acquisition)[source]
setTsId(value)[source]