pwem.emlib.metadata.utils module
- class pwem.emlib.metadata.utils.Row[source]
Bases:
object
Support Xmipp class to store label and value pairs corresponding to a Metadata row.
- containsAll(labels)[source]
Check if all labels are present in the row. Params:
row: the Row object. labels: either a dict or list object containing the labels
(in the case of dicts, label are the dict.values())
- containsAny(labels)[source]
Check if at least one of labels is present in the row. Params:
row: the Row object. labels: either a dict or list object containing the labels
(in the case of dicts, label are the dict.values())
- class pwem.emlib.metadata.utils.RowMetaData(filename=None)[source]
Bases:
object
This class is a wrapper for MetaData in row mode. Where only one object is used.
- class pwem.emlib.metadata.utils.SetMdIterator(md, sortByLabel=None, keyLabel=199, updateItemCallback=None, skipDisabled=False)[source]
Bases:
object
Class to iterate over an input set and skip elements not present in metadata. This class can be used in copyItems when the number of elements in the set is higher that in metadata.
- pwem.emlib.metadata.utils.dropColumns(mdObj, *labels)[source]
Drop all columns from a given metadata. Labels can be either string or int.
- pwem.emlib.metadata.utils.getFirstRow(mdOrFn)[source]
Return the first object of a metadata. Params:
mdOrFn: you can pass a metadata or a filename as argument.
- pwem.emlib.metadata.utils.getLabel(value)[source]
Return the label value either from an int value or an string.
- pwem.emlib.metadata.utils.getSize(filename)[source]
Return the metadata size without parsing entirely.
- pwem.emlib.metadata.utils.iterRows(md, sortByLabel=None)[source]
Iterate over the rows of the given metadata. Params:
md: a MetaData object or a filename (MetaData will be read) sortByLabel: a label to sort the metadata before iterate.