コード例 #1
0
 def reconstructStep(self, fnRoot):
     from pyworkflow.em.metadata.utils import getSize
     if os.path.exists(fnRoot+".xmd"):
         Nimages=getSize(fnRoot+".xmd")
         if Nimages>0:
             self.runJob("xmipp_reconstruct_fourier","-i %s.xmd -o %s.vol --sym %s " %(fnRoot,fnRoot,self.symmetryGroup.get()))
             self.runJob("xmipp_transform_mask","-i %s.vol --mask circular -%d "%(fnRoot,self.Xdim2/2))
     else:
         print fnRoot+".xmd is empty. The corresponding volume is not generated." 
コード例 #2
0
 def _createAngDistChimera(self, it):
     fnDir = self.protocol._getExtraPath("Iter%03d"%it)
     fnAngles = join(fnDir,"angles.xmd")
     view=None
     if exists(fnAngles):
         fnAnglesSqLite = join(fnDir,"angles.sqlite")
         from pyworkflow.em.metadata.utils import getSize
         self.createAngDistributionSqlite(fnAnglesSqLite, getSize(fnAngles), itemDataIterator=self._iterAngles(fnAngles))
         view = ChimeraClientView(join(fnDir,"volumeAvg.mrc"), showProjection=True, angularDistFile=fnAnglesSqLite, spheresDistance=self.spheresScale.get())
     return view
コード例 #3
0
 def _createAngDist2D(self, it):
     fnDir = self.protocol._getExtraPath("Iter%03d"%it)
     fnAngles = join(fnDir,"angles.xmd")
     view=None
     if exists(fnAngles):
         fnAnglesSqLite = join(fnDir,"angles.sqlite")
         from pyworkflow.em.metadata.utils import getSize
         from pyworkflow.em.plotter import EmPlotter
         self.createAngDistributionSqlite(fnAnglesSqLite, getSize(fnAngles), itemDataIterator=self._iterAngles(fnAngles))
         view = EmPlotter(x=1, y=1, mainTitle="Iteration %d" % it, windowTitle="Angular distribution")
         view.plotAngularDistributionFromMd(fnAnglesSqLite, 'iter %d' % it)
     return view
コード例 #4
0
 def split(self,i):
     from pyworkflow.em.metadata.utils import getSize
     from math import ceil
     from random import randint
     from time import sleep
     sleep(randint(1,10))
     fnDirCurrent=self._getExtraPath("Iter001")
     fnAngles=self._getExtraPath("Iter001/angles.xmd")
     fnSplit=self._getExtraPath('split%05d.xmd'%i)
     Nimages=getSize(fnAngles)
     Nsplit=ceil(Nimages*self.splitFraction.get())
     self.runJob("xmipp_metadata_utilities","-i %s -o %s --operate random_subset %d"%(fnAngles,fnSplit,Nsplit),numberOfMpi=1)
 
     fnVol=self._getExtraPath('split%05d.vol'%i)
     args="-i %s -o %s --sym %s --weight"%(fnSplit,fnVol,self.symmetryGroup)
     row=getFirstRow(fnAngles)
     if row.containsLabel(xmipp.MDL_CTF_DEFOCUSU) or row.containsLabel(xmipp.MDL_CTF_MODEL):
         TsCurrent=self.readInfoField(fnDirCurrent,"sampling",xmipp.MDL_SAMPLINGRATE)
         args+=" --useCTF --sampling %f"%TsCurrent
         if self.phaseFlipped:
             args+=" --phaseFlipped"
     self.runJob("xmipp_reconstruct_fourier",args,numberOfMpi=1)
     self.runJob("xmipp_image_operate","-i %s --minus %s"%(fnVol,join(fnDirCurrent,"volume.vol")))