Exemplo n.º 1
0
 def _getClassesSqlite(self, blockName, fn):
     """ Read the classes from Xmipp metadata and write as sqlite file. """
     fnSqlite = fn + '.sqlite'
     
     if not os.path.exists(fnSqlite):
         classesSet = SetOfClasses2D(filename=fnSqlite)
         classesSet.setImages(self._getInputParticles())
         readSetOfClasses(classesSet, fn, blockName)
         classesSet.write()
     return fnSqlite
Exemplo n.º 2
0
    def _getClassesSqlite(self, blockName, fn):
        """ Read the classes from Xmipp metadata and write as sqlite file. """
        fnSqlite = fn + "_" + blockName + ".sqlite"

        # Generate the sqlite file from classes xmd if either
        # 1) Sqlite files has not been generated or
        # 2) Xmd file is newer than sqlite (using modification time)
        if os.path.exists(fnSqlite):
            if os.path.getmtime(fn) > os.path.getmtime(fnSqlite) - 10:
                pwutils.cleanPath(fnSqlite)  # Clean to load from scratch

        if not os.path.exists(fnSqlite):
            classesSet = SetOfClasses2D(filename=fnSqlite)
            classesSet.setImages(self._getInputParticles())
            readSetOfClasses(classesSet, fn, blockName, preprocessClass=self._setClassOrder)
            classesSet.write()

        return fnSqlite
Exemplo n.º 3
0
    def _getClassesSqlite(self, blockName, fn):
        """ Read the classes from Xmipp metadata and write as sqlite file. """
        fnSqlite = fn + '_'+blockName+'.sqlite'

        # Generate the sqlite file from classes xmd if either
        # 1) Sqlite files has not been generated or
        # 2) Xmd file is newer than sqlite (using modification time)
        if os.path.exists(fnSqlite):
            if os.path.getmtime(fn) > os.path.getmtime(fnSqlite)-10:
                pwutils.cleanPath(fnSqlite) # Clean to load from scratch

        if not os.path.exists(fnSqlite):
            classesSet = SetOfClasses2D(filename=fnSqlite)
            classesSet.setImages(self._getInputParticles())
            readSetOfClasses(classesSet, fn, blockName, 
                             preprocessClass=self._setClassOrder)
            classesSet.write()
            
        return fnSqlite