当前位置: 首页>>代码示例>>Python>>正文


Python Volume.setFileName方法代码示例

本文整理汇总了Python中pyworkflow.em.data.Volume.setFileName方法的典型用法代码示例。如果您正苦于以下问题:Python Volume.setFileName方法的具体用法?Python Volume.setFileName怎么用?Python Volume.setFileName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyworkflow.em.data.Volume的用法示例。


在下文中一共展示了Volume.setFileName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: createOutputStep

# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setFileName [as 别名]
    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,代码行数:27,代码来源:protocol_ml_classification.py

示例2: runCreateOutputStep

# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setFileName [as 别名]
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,代码行数:62,代码来源:projmatch_steps.py

示例3: createOutputStep

# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setFileName [as 别名]
    def createOutputStep(self):
        volume=Volume()
        volume.setFileName(self._getFileName(OUTPUT_RESOLUTION_FILE))
        if (self.halfVolumes):
            volume.setSamplingRate(self.inputVolume.get().getSamplingRate())
            self._defineOutputs(resolution_Volume=volume)
            self._defineSourceRelation(self.inputVolume, volume)
        else:
            volume.setSamplingRate(self.inputVolumes.get().getSamplingRate())
            self._defineOutputs(resolution_Volume=volume)
            self._defineSourceRelation(self.inputVolumes, volume)
            
            
        #Setting the min max for the summary
        imageFile = self._getFileName(OUTPUT_RESOLUTION_FILE_CHIMERA)
        min_, max_ = self.getMinMax(imageFile)
        self.min_res_init.set(round(min_*100)/100)
        self.max_res_init.set(round(max_*100)/100)
        self._store(self.min_res_init)
        self._store(self.max_res_init)

        if self.filterInput.get():
            print 'Saving filtered map'
            volume.setFileName(self._getFileName(FN_FILTERED_MAP))
            if (self.halfVolumes):
                volume.setSamplingRate(self.inputVolume.get().getSamplingRate())
                self._defineOutputs(outputVolume_Filtered=volume)
                self._defineSourceRelation(self.inputVolume, volume)
            else:
                volume.setSamplingRate(self.inputVolumes.get().getSamplingRate())
                self._defineOutputs(outputVolume_Filtered=volume)
                self._defineSourceRelation(self.inputVolumes, volume)
开发者ID:I2PC,项目名称:scipion,代码行数:34,代码来源:protocol_resolution_monogenic_signal.py

示例4: createOutputStep

# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setFileName [as 别名]
 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,代码行数:9,代码来源:protocol_reconstruct.py

示例5: createOutputStep

# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setFileName [as 别名]
    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,代码行数:9,代码来源:protocol_volume_local_sharpening.py

示例6: createOutputStep

# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setFileName [as 别名]
 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,代码行数:10,代码来源:protocol_reconstruct.py

示例7: createOutputStep

# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setFileName [as 别名]
 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,代码行数:10,代码来源:protocol_localres.py

示例8: createOutputStep

# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setFileName [as 别名]
 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,代码行数:10,代码来源:protocol_locscale.py

示例9: createOutputStep

# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setFileName [as 别名]
    def createOutputStep(self):
        
        if not self.realignMovieFrames:
            imgSet = self._getInputParticles()
            vol = Volume()
            vol.setFileName(self._getExtraPath('relion_class001.mrc'))
            vol.setSamplingRate(imgSet.getSamplingRate())
            half1 = self._getFileName("final_half1_volume", ref3d=1)
            half2 = self._getFileName("final_half2_volume", ref3d=1)
            vol.setHalfMaps([half1, half2])
            
            outImgSet = self._createSetOfParticles()
            outImgSet.copyInfo(imgSet)
            self._fillDataFromIter(outImgSet, self._lastIter())

            self._defineOutputs(outputVolume=vol)
            self._defineSourceRelation(self.inputParticles, vol)
            self._defineOutputs(outputParticles=outImgSet)
            self._defineTransformRelation(self.inputParticles, outImgSet)

            fsc = FSC(objLabel=self.getRunName())
            blockName = 'model_class_%[email protected]' % 1
            fn = blockName + self._getExtraPath("relion_model.star")
            mData = md.MetaData(fn)
            fsc.loadFromMd(mData,
                           md.RLN_RESOLUTION,
                           md.RLN_MLMODEL_FSC_HALVES_REF)
            self._defineOutputs(outputFSC=fsc)
            self._defineSourceRelation(vol, fsc)

        else:
            movieSet = self.inputMovieParticles.get()
            if self.movieIncludeRotSearch:
                vol = Volume()
                vol.setFileName(self._getExtraPath('relion_class001.mrc'))
                vol.setSamplingRate(movieSet.getSamplingRate())
                half1 = self._getFileName("final_half1_volume", ref3d=1)
                half2 = self._getFileName("final_half2_volume", ref3d=1)
                vol.setHalfMaps([half1, half2])

                self._defineOutputs(outputVolume=vol)
                self._defineSourceRelation(self.inputParticles, vol)
                self._defineSourceRelation(self.inputMovieParticles, vol)

            fnOut = self._getFileName('dataFinal')
            outMovieSet = self._createSetOfMovieParticles()
            outMovieSet.copyInfo(movieSet)
            outMovieSet.setAlignmentProj()
            # not using copyItems since input movie particle
            # set is missing a lot of metadata (CTF, micName etc.)
            # that was created in convertInputStep
            readSetOfParticles(fnOut, outMovieSet, alignType=ALIGN_PROJ,
                               extraLabels=MOVIE_EXTRA_LABELS,
                               postprocessImageRow=self._updateParticle)

            self._defineOutputs(outputParticles=outMovieSet)
            self._defineTransformRelation(self.inputParticles, outMovieSet)
            self._defineTransformRelation(self.inputMovieParticles, outMovieSet)
开发者ID:I2PC,项目名称:scipion,代码行数:60,代码来源:protocol_refine3d.py

示例10: createOutputStep

# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setFileName [as 别名]
    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,代码行数:11,代码来源:protocol_projmatch.py

示例11: createOutputStep

# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setFileName [as 别名]
    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,代码行数:11,代码来源:protocol_reconstruct.py

示例12: runCreateOutputStep

# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setFileName [as 别名]
def runCreateOutputStep(self):
    import pyworkflow.em.metadata as md
    ''' 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)
    else:
        volFn = self._getFileName('reconstructedFileNamesIters', iter=lastIter, ref=1)
        vol = Volume()
        vol.setFileName(volFn)
        vol.setSamplingRate(imgSet.getSamplingRate())
        self._defineOutputs(outputVolume=vol)
        self._defineSourceRelation(self.inputParticles, vol)
        
        #create set of images
        imgSetOut = self._createSetOfParticles()
        imgFn = "[email protected]" + self._getFileName('docfileInputAnglesIters', iter=lastIter, ref=1)
        
        imgSetOut.copyInfo(imgSet)
        imgSetOut.setAlignmentProj()
        imgSetOut.copyItems(imgSet,
                            updateItemCallback=self._createItemMatrix,
                            itemDataIterator=md.iterRows(imgFn))
        self._defineOutputs(outputParticles=imgSetOut)
        self._defineSourceRelation(self.inputParticles, imgSetOut)
开发者ID:denisfortun,项目名称:scipion,代码行数:57,代码来源:projmatch_steps.py

示例13: createOutputStep

# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setFileName [as 别名]
    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,代码行数:14,代码来源:protocol_pseudoatoms.py

示例14: _appendOutputVolume

# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setFileName [as 别名]
    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,代码行数:14,代码来源:protocol_random_conical_tilt.py

示例15: createOutputStep

# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setFileName [as 别名]
    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,代码行数:15,代码来源:protocol_postprocess.py


注:本文中的pyworkflow.em.data.Volume.setFileName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。