Esempio n. 1
0
def iterMdRows(md):
    """ Iterate over the rows of the given metadata. """
    # If md is string, take as filename and create the metadata
    if isinstance(md, basestring):
        md = xmipp.MetaData(md)

    row = XmippMdRow()

    for objId in md:
        row.readFromMd(md, objId)
        yield row
Esempio n. 2
0
def iterMdRows(md):
    """ Iterate over the rows of the given metadata. """
    # If md is string, take as filename and create the metadata
    if isinstance(md, basestring):
        md = xmipp.MetaData(md)
        
    row = XmippMdRow()
    
    for objId in md:
        row.readFromMd(md, objId)
        yield row
Esempio n. 3
0
def getMdFirstRow(filename):
    """ Create a MetaData but only read the first row.
    This method should be used for validations of labels
    or metadata size, but the full metadata is not needed.
    """
    md = xmipp.MetaData()
    md.read(filename, 1)
    if md.getParsedLines():
        row = XmippMdRow()
        row.readFromMd(md, md.firstObject())
    else:
        row = None

    return row
Esempio n. 4
0
def getMdFirstRow(filename):
    """ Create a MetaData but only read the first row.
    This method should be used for validations of labels
    or metadata size, but the full metadata is not needed.
    """
    md = xmipp.MetaData()
    md.read(filename, 1)
    if md.getParsedLines():
        row = XmippMdRow()
        row.readFromMd(md, md.firstObject())
    else:
        row = None
    
    return row
Esempio n. 5
0
def rowFromMd(md, objId):
    row = XmippMdRow()
    row.readFromMd(md, objId)
    return row
Esempio n. 6
0
def rowFromMd(md, objId):
    row = XmippMdRow()
    row.readFromMd(md, objId)
    return row