def createOutputStep(self): imgSet = self.inputParticles.get() classes2DSet = self._createSetOfClasses2D(imgSet) readSetOfClasses2D(classes2DSet, self._getFileName('output_classes')) self._defineOutputs(outputClasses=classes2DSet) self._defineSourceRelation(self.inputParticles, classes2DSet) if not self.doGenerateReferences: self._defineSourceRelation(self.inputReferences, classes2DSet)
def createOutputStep(self): imgSet = self.inputParticles.get() classes2DSet = self._createSetOfClasses2D(imgSet) readSetOfClasses2D(classes2DSet, self._getFileName('output_classes')) self._defineOutputs(outputClasses=classes2DSet) self._defineSourceRelation(imgSet, classes2DSet) if not self.doGenerateReferences: self._defineSourceRelation(self.inputReferences.get(), classes2DSet)
def createOutputStep(self): """ Store the kenserdom object as result of the protocol. """ imgSet = self.inputParticles.get() classes2DSet = self._createSetOfClasses2D(imgSet) readSetOfClasses2D(classes2DSet, self._params['kclasses'], preprocessClass=self._preprocessClass) self._defineOutputs(outputClasses=classes2DSet) self._defineSourceRelation(self.inputParticles, classes2DSet)
def createOutputStep(self, subset=''): """ Store the SetOfClasses2D object resulting from the protocol execution. """ levelMdFiles = self._getLevelMdFiles(subset) lastMdFn = levelMdFiles[-1] inputParticles = self.inputParticles.get() classes2DSet = self._createSetOfClasses2D(inputParticles, subset) readSetOfClasses2D(classes2DSet, lastMdFn, 'classes') result = {'outputClasses' + subset: classes2DSet} self._defineOutputs(**result) self._defineSourceRelation(self.inputParticles, classes2DSet)
def _getClassesSqlite(self, fnXmd, it): """ Return the sqlite file given the xmd of classes. """ fnSqlite = join(dirname(fnXmd), 'classes_it%03d.sqlite' % it) if not exists(fnSqlite): # Create the sqlite if not exists classes2DSet = SetOfClasses2D(filename=fnSqlite) classes2DSet.setImages(self.protocol.inputParticles.get()) readSetOfClasses2D(classes2DSet, fnXmd) classes2DSet.write() return fnSqlite
def createOutputStep(self): self.plotsDir = self._getExtraPath('plots') makePath(self.plotsDir) fnClassVectors = self._params['kvectors'].replace('xmd', 'vec') f = open(fnClassVectors) self.classArray = np.fromfile(f, dtype=np.float32) f.close() fnImgVectors = self._params['vectors'].replace('xmd', 'vec') f = open(fnImgVectors) self.imgArray = np.fromfile(f, dtype=np.float32) f.close() self.imgCount = 0 imgSet = self.inputParticles.get() classes2DSet = self._createSetOfClasses2D(imgSet) readSetOfClasses2D(classes2DSet, self._params['kclasses'], preprocessClass=self._preprocessClass, postprocessImageRow=self._postprocessImageRow) self._defineOutputs(outputClasses=classes2DSet) self._defineSourceRelation(self.inputParticles, classes2DSet)