pwem.objects.data module¶
This modules contains basic hierarchy for EM data objects like: Image, SetOfImage and others
-
class
pwem.objects.data.
Acquisition
(**kwargs)[source]¶ Bases:
pwem.objects.data.EMObject
Acquisition information
-
class
pwem.objects.data.
AtomStruct
(filename=None, pseudoatoms=False, **kwargs)[source]¶ Bases:
pwem.objects.data.EMFile
Represents an PDB file.
-
class
pwem.objects.data.
CTFModel
(**kwargs)[source]¶ Bases:
pwem.objects.data.EMObject
Represents a generic CTF model.
-
equalAttributes
(other, ignore=[], verbose=False)[source]¶ Override default behaviour to compare two CTF objects, now ignoring the psdFile.
-
setStandardDefocus
(defocusU, defocusV, defocusAngle)[source]¶ Set defocus values following emx conventions. See _standardize function.
-
standardize
()[source]¶ Modify defocusU, defocusV and defocusAngle to conform the EMX standard: defocusU > defocusV, 0 <= defocusAngle < 180 and the defocusAnges is between x-axis and defocusU. Also determine the defocusRatio(defocusU/defocusV). For more details see: http://i2pc.cnb.csic.es/emx/LoadDictionaryFormat.htm?type=Convention#ctf
-
-
class
pwem.objects.data.
Class2D
(**kwargs)[source]¶ Bases:
pwem.objects.data.SetOfParticles
Represent a Class that groups Particles objects. Usually the representative of the class is another Particle (some kind of average particle from the particles assigned to the class)
-
class
pwem.objects.data.
Class3D
(**kwargs)[source]¶ Bases:
pwem.objects.data.SetOfParticles
Represent a Class that groups Particles objects. Usually the representative of the class is a Volume reconstructed from the particles assigned to the class.
-
class
pwem.objects.data.
ClassVol
(**kwargs)[source]¶ Bases:
pwem.objects.data.SetOfVolumes
Represent a Class that groups Volume objects. Usually the representative of the class is another Volume.
-
class
pwem.objects.data.
Coordinate
(**kwargs)[source]¶ Bases:
pwem.objects.data.EMObject
This class holds the (x,y) position and other information associated with a coordinate
-
class
pwem.objects.data.
DefocusGroup
(**kwargs)[source]¶ Bases:
pwem.objects.data.EMObject
Groups CTFs by defocus
-
class
pwem.objects.data.
EMFile
(filename=None, **kwargs)[source]¶ Bases:
pwem.objects.data.EMObject
Class to link usually to text files.
-
class
pwem.objects.data.
EMObject
(value=None, **kwargs)[source]¶ Bases:
pyworkflow.object.Object
Base object for all EM classes
-
class
pwem.objects.data.
EMSet
(filename=None, prefix='', mapperClass=None, classesDict=None, **kwargs)[source]¶ Bases:
pyworkflow.object.Set
,pwem.objects.data.EMObject
-
copyInfo
(other)[source]¶ Define a dummy copyInfo function to be used for some generic operations on sets.
-
copyItems
(otherSet, updateItemCallback=None, itemDataIterator=None, copyDisabled=False, doClone=True)[source]¶ Copy items from another set, allowing to update items information based on another source of data, paired with each item.
- Params:
otherSet: input set from where the items will be copied. updateItemCallback: if not None, this will be called for each item
and each data row (if the itemDataIterator is not None). Apart from setting item values or new attributes, it is possible to set the special flag _appendItem to False, and then this item will not be added to the set.- itemDataIterator: if not None, it must be an iterator that have one
- data item for each item in the set. Usually the data item is a data row, coming from a table stored in text files (e.g STAR)
- copyDisabled: By default, disabled items are not copied from the other
- set. If copyDisable=True, then the enabled property of the item will be ignored.
- doClone: By default, the new item that will be inserted is a “clone”
- of the input item. By using doClone=False, the same input item will be passed to the callback and added to the set. This will avoid the clone operation and the related overhead.
-
-
class
pwem.objects.data.
FSC
(**kwargs)[source]¶ Bases:
pwem.objects.data.EMObject
Store a Fourier Shell Correlation
-
class
pwem.objects.data.
FramesRange
(firstFrame=1, lastFrame=0, firstFrameIndex=1)[source]¶ Bases:
pyworkflow.object.CsvList
Store first and last frames in a movie. The last element will be the index in the stack of the first frame.
-
class
pwem.objects.data.
Image
(location=None, **kwargs)[source]¶ Bases:
pwem.objects.data.EMObject
Represents an EM Image object
-
getDimensions
()[source]¶ getDimensions is redundant here but not in setOfVolumes create it makes easier to create protocols for both images and sets of images
-
getLocation
()[source]¶ This function return the image index and filename. It will only differs from getFileName, when the image is contained in a stack and the index make sense.
-
-
class
pwem.objects.data.
ImageDim
(x=None, y=None, z=None)[source]¶ Bases:
pyworkflow.object.CsvList
Just a wrapper to a CsvList to store image dimensions as X, Y and Z.
-
class
pwem.objects.data.
Mask
(location=None, **kwargs)[source]¶ Bases:
pwem.objects.data.Particle
Represent a mask.
-
class
pwem.objects.data.
Matrix
(**kwargs)[source]¶ Bases:
pyworkflow.object.Scalar
-
class
pwem.objects.data.
Micrograph
(location=None, **kwargs)[source]¶ Bases:
pwem.objects.data.Image
Represents an EM Micrograph object
-
class
pwem.objects.data.
Movie
(location=None, **kwargs)[source]¶ Bases:
pwem.objects.data.Micrograph
Represent a set of frames of micrographs.
-
getDim
()[source]¶ Return image dimensions as tuple: (Xdim, Ydim, Zdim) Consider compressed Movie files
-
-
class
pwem.objects.data.
MovieAlignment
(first=-1, last=-1, **kwargs)[source]¶ Bases:
pwem.objects.data.EMObject
Store the alignment between the different Movie frames. Also store the first and last frames used for alignment.
-
getRange
()[source]¶ Return the first and last frames used for alignment. The first frame in a movie stack is numbered 1 and the maximum value for the last one is N, where N is the total number of frames.
-
-
class
pwem.objects.data.
MovieParticle
(**kwargs)[source]¶ Bases:
pwem.objects.data.Particle
-
class
pwem.objects.data.
NormalMode
(**kwargs)[source]¶ Bases:
pwem.objects.data.EMObject
Store normal mode information.
-
class
pwem.objects.data.
Particle
(location=None, **kwargs)[source]¶ Bases:
pwem.objects.data.Image
Represents an EM Particle object
-
class
pwem.objects.data.
PdbFile
(filename=None, pseudoatoms=False, **kwargs)[source]¶ Bases:
pwem.objects.data.AtomStruct
-
class
pwem.objects.data.
Sequence
(name=None, sequence=None, alphabet=None, isAminoacids=True, id=None, description=None, **kwargs)[source]¶ Bases:
pwem.objects.data.EMObject
Class containing a sequence of aminoacids/nucleotides Attribute names follow the biopython default ones
-
class
pwem.objects.data.
SetOfAtomStructs
(filename=None, prefix='', mapperClass=None, classesDict=None, **kwargs)[source]¶ Bases:
pwem.objects.data.EMSet
Set containing PDB items.
-
EXPOSE_ITEMS
= True¶
-
ITEM_TYPE
¶ alias of
AtomStruct
-
-
class
pwem.objects.data.
SetOfAverages
(**kwargs)[source]¶ Bases:
pwem.objects.data.SetOfParticles
Represents a set of Averages. It is a SetOfParticles but it is useful to differentiate outputs.
-
class
pwem.objects.data.
SetOfCTF
(**kwargs)[source]¶ Bases:
pwem.objects.data.EMSet
Contains a set of CTF models estimated for a set of images.
-
class
pwem.objects.data.
SetOfClasses
(**kwargs)[source]¶ Bases:
pwem.objects.data.EMSet
Store results from a classification.
-
ITEM_TYPE
= None¶
-
REP_TYPE
= None¶
-
appendFromClasses
(classesSet, filterClassFunc=None, updateClassCallback=None)[source]¶ Iterate over the classes and the elements inside each class and append classes and items that are enabled.
-
classifyItems
(updateItemCallback=None, updateClassCallback=None, itemDataIterator=None, classifyDisabled=False, iterParams=None, doClone=True)[source]¶ Classify items from the self.getImages() and add the needed classes. This function iterates over each item in the images and call the updateItemCallback to register the information coming from the iterator in itemDataIterator. The callback function should set the classId of the image that will be used to classify it. It is also possible to pass a callback to update the class properties.
Parameters: - updateItemCallback – callback to be invoked on each item’s loop (e.g.: 2d image in a 2d classification)
- updateClassCallback – callback to be invoked when a item.getClassId() changes
- itemDataIterator – an iterator (usually on metadata files, star, xmd,..) that will be called on each loop.
usually has that same lines as items and iteration is kept in sync :param classifyDisabled: classify disabled items. By default they are skipped. :param iterParams: Parameters for self.getImages() to leave oot images/filter :param doClone: Make a clone of the item (defaults to true)
-
-
class
pwem.objects.data.
SetOfClasses2D
(**kwargs)[source]¶ Bases:
pwem.objects.data.SetOfClasses
Store results from a 2D classification of Particles.
-
class
pwem.objects.data.
SetOfClasses3D
(**kwargs)[source]¶ Bases:
pwem.objects.data.SetOfClasses
Store results from a 3D classification of Particles.
-
class
pwem.objects.data.
SetOfClassesVol
(**kwargs)[source]¶ Bases:
pwem.objects.data.SetOfClasses3D
Store results from a classification of Volumes.
-
class
pwem.objects.data.
SetOfCoordinates
(**kwargs)[source]¶ Bases:
pwem.objects.data.EMSet
Encapsulate the logic of a set of particles coordinates. Each coordinate has a (x,y) position and is related to a Micrograph The SetOfCoordinates can also have information about TiltPairs.
-
ITEM_TYPE
¶ alias of
Coordinate
-
copyInfo
(other)[source]¶ Copy basic information (boxsize) from other set of coordinates to current one
-
iterCoordinates
(micrograph=None)[source]¶ Iterate over the coordinates associated with a micrograph. If micrograph=None, the iteration is performed over the whole set of coordinates.
-
iterMicrographCoordinates
(micrograph)[source]¶ Iterates over the set of coordinates belonging to that micrograph.
-
-
class
pwem.objects.data.
SetOfDefocusGroup
(**kwargs)[source]¶ Bases:
pwem.objects.data.EMSet
Contains a set of DefocusGroup. if min/max/avg exists the corresponding flag must be set to true.
-
ITEM_TYPE
¶ alias of
DefocusGroup
-
-
class
pwem.objects.data.
SetOfDefocusGroups
(inputSet, groupRange=1000, groupMinSize=1, **kwargs)[source]¶ Bases:
object
Store a set of several defocus groups.
-
class
pwem.objects.data.
SetOfFSCs
(filename=None, prefix='', mapperClass=None, classesDict=None, **kwargs)[source]¶ Bases:
pwem.objects.data.EMSet
Represents a set of FSCs
-
class
pwem.objects.data.
SetOfImages
(**kwargs)[source]¶ Bases:
pwem.objects.data.EMSet
Represents a set of Images
-
appendFromClasses
(classesSet)[source]¶ Iterate over the classes and the element inside each class and append to the set all that are enabled.
-
appendFromImages
(imagesSet)[source]¶ Iterate over the images and append every image that is enabled.
-
copyInfo
(other)[source]¶ Copy basic information (sampling rate and ctf) from other set of images to current one
-
iterItems
(orderBy='id', direction='ASC', where='1', limit=None, iterate=True)[source]¶ Redefine iteration to set the acquisition to images.
-
-
class
pwem.objects.data.
SetOfMicrographs
(**kwargs)[source]¶ Bases:
pwem.objects.data.SetOfMicrographsBase
Represents a set of Micrographs
-
ITEM_TYPE
¶ alias of
Micrograph
-
-
class
pwem.objects.data.
SetOfMicrographsBase
(**kwargs)[source]¶ Bases:
pwem.objects.data.SetOfImages
Create a base class for both Micrographs and Movies, but avoid to select Movies when Micrographs are required.
-
class
pwem.objects.data.
SetOfMovieParticles
(**kwargs)[source]¶ Bases:
pwem.objects.data.SetOfParticles
This is just to distinguish the special case when the particles have been extracted from a set of movies.
-
ITEM_TYPE
¶ alias of
MovieParticle
-
-
class
pwem.objects.data.
SetOfMovies
(**kwargs)[source]¶ Bases:
pwem.objects.data.SetOfMicrographsBase
Represents a set of Movies.
-
class
pwem.objects.data.
SetOfNormalModes
(**kwargs)[source]¶ Bases:
pwem.objects.data.EMSet
Set containing NormalMode items.
-
ITEM_TYPE
¶ alias of
NormalMode
-
-
class
pwem.objects.data.
SetOfPDBs
[source]¶ Bases:
pwem.objects.data.SetOfAtomStructs
Set containing PDB items.
-
class
pwem.objects.data.
SetOfParticles
(**kwargs)[source]¶ Bases:
pwem.objects.data.SetOfImages
Represents a set of Particles. The purpose of this class is to separate the concepts of Micrographs and Particles, even if both are considered Images
-
class
pwem.objects.data.
SetOfSequences
(filename=None, prefix='', mapperClass=None, classesDict=None, **kwargs)[source]¶ Bases:
pwem.objects.data.EMSet
Set containing Sequence items.
-
class
pwem.objects.data.
SetOfVolumes
(**kwargs)[source]¶ Bases:
pwem.objects.data.SetOfImages
Represents a set of Volumes
-
EXPOSE_ITEMS
= True¶
-
-
class
pwem.objects.data.
Transform
(matrix=None, **kwargs)[source]¶ Bases:
pwem.objects.data.EMObject
This class will contain a transformation matrix that can be applied to 2D/3D objects like images and volumes. It should contain information about euler angles, translation(or shift) and mirroring. Shifts are stored in pixels as treated in extract coordinates, or assign angles,…
-
class
pwem.objects.data.
Volume
(location=None, **kwargs)[source]¶ Bases:
pwem.objects.data.Image
Represents an EM Volume object
-
class
pwem.objects.data.
VolumeMask
(location=None, **kwargs)[source]¶ Bases:
pwem.objects.data.Volume
A 3D mask to be used with volumes.