當前位置: 首頁>>代碼示例>>Python>>正文


Python data.Volume類代碼示例

本文整理匯總了Python中pyworkflow.em.data.Volume的典型用法代碼示例。如果您正苦於以下問題:Python Volume類的具體用法?Python Volume怎麽用?Python Volume使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Volume類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: createOutputStep

    def createOutputStep(self):
        volume=Volume()
        volume.setFileName(self._getExtraPath('sharpenedMap_last.mrc'))
        volume.setSamplingRate(self.inputVolume.get().getSamplingRate())

        self._defineOutputs(sharpened_map=volume)
        self._defineSourceRelation(self.inputVolume, volume)          
開發者ID:I2PC,項目名稱:scipion,代碼行數:7,代碼來源:protocol_volume_local_sharpening.py

示例2: runCreateOutputStep

def runCreateOutputStep(self):
    ''' Create standard output results_images, result_classes'''
    #creating results files
    imgSet = self.inputParticles.get()
    lastIter = self.numberOfIterations.get()
    if self.numberOfReferences != 1:
        inDocfile = self._getFileName('docfileInputAnglesIters', iter=lastIter)
        ClassFnTemplate = '%(rootDir)s/reconstruction_Ref3D_%(ref)03d.vol'
        
        allExpImagesinDocfile = xmipp.FileName()
        all_exp_images="all_exp_images"
        allExpImagesinDocfile.compose(all_exp_images, inDocfile)
        
        dataClasses = self._getFileName('sqliteClasses')
        
        createClassesFromImages(imgSet, str(allExpImagesinDocfile), dataClasses, 
                                SetOfClasses3D, xmipp.MDL_REF3D, ClassFnTemplate, lastIter)
        
        classes = self._createSetOfClasses3D(imgSet)
        clsSet = SetOfClasses3D(dataClasses)
        classes.appendFromClasses(clsSet)
        
        volumes = self._createSetOfVolumes()
        volumes.setSamplingRate(imgSet.getSamplingRate())
        
        for refN in self.allRefs():
            volFn = self._getFileName('reconstructedFileNamesIters', iter=lastIter, ref=refN)
            vol = Volume()
            vol.setFileName(volFn)
            volumes.append(vol)
    
        self._defineOutputs(outputVolumes=volumes)
        self._defineOutputs(outputClasses=classes)
        self._defineSourceRelation(self.inputParticles, volumes)
        self._defineSourceRelation(self.inputParticles, classes)
        self._defineSourceRelation(self.input3DReferences, volumes)
        self._defineSourceRelation(self.input3DReferences, classes)
    else:
        volFn = self._getFileName('reconstructedFileNamesIters',
                                  iter=lastIter, ref=1)
        halfMap1 = self._getFileName('reconstructedFileNamesItersSplit1',
                                     iter=lastIter, ref=1)
        halfMap2 = self._getFileName('reconstructedFileNamesItersSplit2',
                                     iter=lastIter, ref=1)

        vol = Volume()
        vol.setFileName(volFn)
        vol.setSamplingRate(imgSet.getSamplingRate())
        vol.setHalfMaps([halfMap1, halfMap2])
        self._defineOutputs(outputVolume=vol)
        self._defineSourceRelation(self.inputParticles, vol)
        self._defineSourceRelation(self.input3DReferences, vol)
        
        #create set of images
        imgSetOut = self._createSetOfParticles("_iter_%03d" %lastIter)
        self._fillParticlesFromIter(imgSetOut, lastIter)
        
        self._defineOutputs(outputParticles=imgSetOut)
        self._defineSourceRelation(self.inputParticles, imgSetOut)
        self._defineSourceRelation(self.input3DReferences, imgSetOut)
開發者ID:I2PC,項目名稱:scipion,代碼行數:60,代碼來源:projmatch_steps.py

示例3: createOutputStep

 def createOutputStep(self):
     volInput = self.inputVolumes.get()
     if self._isSingleInput():
         # Create the output with the same class as
         # the input, that should be Volume or a subclass
         # of Volume like VolumeMask
         volClass = volInput.getClass()
         vol = volClass() # Create an instance with the same class of input 
         vol.copyInfo(volInput)
         vol.setLocation(1, self.outputStk)
         self._postprocessOutput(vol)
         self._defineOutputs(outputVol=vol)
     else:
         # ToDo: createSetOfVolumes not work properly when the protocol is resumed.
         volumes = self._createSetOfVolumes()
         volumes.copyInfo(volInput)
         self._preprocessOutput(volumes)
         numberOfVols = self.inputVolumes.get().getSize()
         for i in range(1, numberOfVols + 1):
             vol = Volume()
             vol.setLocation(i, self.outputStk)
             volumes.append(vol)
         self._postprocessOutput(volumes)
         self._defineOutputs(outputVol=volumes)
         
     self._defineTransformRelation(volInput, self.outputVol)
開發者ID:josegutab,項目名稱:scipion,代碼行數:26,代碼來源:protocol_process.py

示例4: createOutputStep

    def createOutputStep(self):
        numberOfClasses = self.numberOfRef
        imgSet = self._getInputParticles()
        volumes = self._createSetOfVolumes()
        volumes.setSamplingRate(imgSet.getSamplingRate())
        
        for ref in range(1, numberOfClasses + 1):
            vol = Volume()
            volFn = self._getFileName('iter_vol_class', iter=self._getLastIter(), ref=ref)
            vol.setFileName(volFn)
            volumes.append(vol)
        
        clsSet = self._createSetOfClasses3D(imgSet)
        self._fill3DClasses(clsSet, numberOfClasses)

        # Define the outputs and relations
        self._defineOutputs(outputClasses=clsSet)
        self._defineOutputs(outputVolumes=volumes)
        #TODO: save alignment

        self._defineSourceRelation(self._getInputParticlesPointer(), clsSet)
        self._defineSourceRelation(self._getInputParticlesPointer(), volumes)
        if not self.doContinue:
            self._defineSourceRelation(self.input3DReference, clsSet)
            self._defineSourceRelation(self.input3DReference, volumes)
開發者ID:I2PC,項目名稱:scipion,代碼行數:25,代碼來源:protocol_ml_classification.py

示例5: createOutputStep

 def createOutputStep(self):
     partSet = self.inputParticles.get()
     vol = Volume()
     vol.setFileName(self._getFileName("volume"))
     vol.copyInfo(partSet)
     self._defineOutputs(outputVolume=vol)
     self._defineSourceRelation(self.inputParticles, vol)
開發者ID:I2PC,項目名稱:scipion,代碼行數:7,代碼來源:protocol_reconstruct.py

示例6: createOutputStep

 def createOutputStep(self):
     imgSet = self.inputParticles.get()
     volume = Volume()
     volume.setFileName(self._getFileName('output_volume'))
     volume.setSamplingRate(imgSet.getSamplingRate())
     
     self._defineOutputs(outputVolume=volume)
     self._defineSourceRelation(self.inputParticles, volume)
開發者ID:azazellochg,項目名稱:scipion,代碼行數:8,代碼來源:protocol_reconstruct.py

示例7: createOutputStep

 def createOutputStep(self):
     volume = Volume()
     volume.setFileName(self._getFileName("finalMap"))
     vol = self.protRefine.get().outputVolume
     pxSize = vol.getSamplingRate()
     volume.setSamplingRate(pxSize)
     self._defineOutputs(outputVolume=volume)
     self._defineSourceRelation(vol, volume)
開發者ID:I2PC,項目名稱:scipion,代碼行數:8,代碼來源:protocol_localres.py

示例8: createOutputStep

 def createOutputStep(self):
     """ Create the output volume 
     """
     outputVolume = Volume()
     outputVolume.setSamplingRate(self.getSampling())
     outputVolume.setFileName(self.getOutputFn())
     self._defineOutputs(outputVolume=outputVolume)
     self._defineTransformRelation(self.inputVolume, outputVolume)
開發者ID:I2PC,項目名稱:scipion,代碼行數:8,代碼來源:protocol_locscale.py

示例9: createOutputStep

    def createOutputStep(self):
        imgSet = self.inputParticles.get()
        vol = Volume()
        # FIXME: return two half-volumes as well
        vol.setFileName(self._getPath('volume.stk'))
        vol.setSamplingRate(imgSet.getSamplingRate())

        self._defineOutputs(outputVolume=vol)
        self._defineSourceRelation(self.inputParticles, vol)
開發者ID:I2PC,項目名稱:scipion,代碼行數:9,代碼來源:protocol_reconstruct.py

示例10: createOutputStep

    def createOutputStep(self):
        imgSet = self.inputParticles.get()
        vol = Volume()
        #FIXME: return the last completed iteration
        vol.setFileName(self._getExtraPath('Refinement/final/bpr%02d.stk' % (self.numberOfIterations.get() + 1)))
        vol.setSamplingRate(imgSet.getSamplingRate())

        self._defineOutputs(outputVolume=vol)
        self._defineSourceRelation(self.inputParticles, vol)
開發者ID:azazellochg,項目名稱:scipion,代碼行數:9,代碼來源:protocol_projmatch.py

示例11: createOutput

 def createOutput(self):
     inputParticles = self.directionalClasses.get()
     volumesSet = self._createSetOfVolumes()
     volumesSet.setSamplingRate(inputParticles.getSamplingRate())
     for i in range(2):
         vol = Volume()
         vol.setLocation(1, self._getExtraPath("split_v%d.vol"%(i+1)))
         volumesSet.append(vol)
     
     self._defineOutputs(outputVolumes=volumesSet)
     self._defineSourceRelation(inputParticles, volumesSet)
開發者ID:I2PC,項目名稱:scipion,代碼行數:11,代碼來源:protocol_split_volume.py

示例12: createOutputStep

    def createOutputStep(self):
        inputVol = self.inputStructure.get()
        pdb = PdbFile(self._getPath('pseudoatoms.pdb'), pseudoatoms=True)
        self.createChimeraScript(inputVol, pdb)
        self._defineOutputs(outputPdb=pdb)
        self._defineSourceRelation(self.inputStructure, pdb)

        volume=Volume()
        volume.setFileName(self._getExtraPath("pseudoatoms_approximation.vol"))
        volume.setSamplingRate(inputVol.getSamplingRate())
        self._defineOutputs(outputVolume=volume)
        self._defineSourceRelation(self.inputStructure.get(),volume)
開發者ID:I2PC,項目名稱:scipion,代碼行數:12,代碼來源:protocol_pseudoatoms.py

示例13: _appendOutputVolume

    def _appendOutputVolume(self, volumeOut):
        vol = Volume()
        vol.setFileName(volumeOut)
        vol.setSamplingRate(self.sampling)
        self.volumesSet.append(vol)

        if self.doFilter.get():
            volumeFilterOut = volumeOut.replace('.vol', '_filtered.vol')
            volf = Volume()
            volf.setFileName(volumeFilterOut)
            volf.setSamplingRate(self.sampling)
            self.volumesFilterSet.append(volf)
開發者ID:I2PC,項目名稱:scipion,代碼行數:12,代碼來源:protocol_random_conical_tilt.py

示例14: createOutput

 def createOutput(self):
     volumesSet = self._createSetOfVolumes()
     volumesSet.setSamplingRate(self.inputParticles.get().getSamplingRate())
     Nvols = len(self.splitPercentiles.get().split())
     fnStack = self._getPath("splittedVolumes.stk")
     for i in range(Nvols):
         vol = Volume()
         vol.setLocation(i+1, fnStack)
         volumesSet.append(vol)
     
     self._defineOutputs(outputVolumes=volumesSet)
     self._defineSourceRelation(self.inputParticles.get(), volumesSet)
開發者ID:azazellochg,項目名稱:scipion,代碼行數:12,代碼來源:protocol_split_volume.py

示例15: createOutputStep

    def createOutputStep(self):
        volume = Volume()
        volume.setFileName(self._getExtraPath('postprocess.mrc'))
        volume.setSamplingRate(self.samplingRate)
        vol = self.protRelionRefine.get().outputVolume
        mask = VolumeMask()
        mask.setFileName(self._getExtraPath('postprocess_automask.mrc'))
        mask.setSamplingRate(self.samplingRate)

        self._defineOutputs(outputVolume=volume)
        self._defineOutputs(outputMask=mask)
        self._defineSourceRelation(vol, volume)
        self._defineSourceRelation(vol, mask)
開發者ID:azazellochg,項目名稱:scipion,代碼行數:13,代碼來源:protocol_postprocess.py


注:本文中的pyworkflow.em.data.Volume類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。