本文整理汇总了Python中pyworkflow.em.data.Volume.setSamplingRate方法的典型用法代码示例。如果您正苦于以下问题:Python Volume.setSamplingRate方法的具体用法?Python Volume.setSamplingRate怎么用?Python Volume.setSamplingRate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyworkflow.em.data.Volume
的用法示例。
在下文中一共展示了Volume.setSamplingRate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: runCreateOutputStep
# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setSamplingRate [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)
示例2: importVolumesStep
# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setSamplingRate [as 别名]
def importVolumesStep(self, pattern, samplingRate):
""" Copy images matching the filename pattern
Register other parameters.
"""
self.info("Using pattern: '%s'" % pattern)
# Create a Volume template object
vol = Volume()
vol.setSamplingRate(self.samplingRate.get())
copyOrLink = self.getCopyOrLink()
imgh = ImageHandler()
volSet = self._createSetOfVolumes()
volSet.setSamplingRate(self.samplingRate.get())
for fileName, fileId in self.iterFiles():
dst = self._getExtraPath(basename(fileName))
copyOrLink(fileName, dst)
x, y, z, n = imgh.getDimensions(dst)
# First case considers when reading mrc without volume flag
# Second one considers single volumes (not in stack)
if (z == 1 and n != 1) or (z !=1 and n == 1):
vol.setObjId(fileId)
vol.setLocation(dst)
volSet.append(vol)
else:
for index in range(1, n+1):
vol.cleanObjId()
vol.setLocation(index, dst)
volSet.append(vol)
if volSet.getSize() > 1:
self._defineOutputs(outputVolumes=volSet)
else:
self._defineOutputs(outputVolume=vol)
示例3: createOutputStep
# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setSamplingRate [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)
示例4: createOutputStep
# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setSamplingRate [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)
示例5: createOutputStep
# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setSamplingRate [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)
示例6: createOutputStep
# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setSamplingRate [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)
示例7: createOutputStep
# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setSamplingRate [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)
示例8: createOutputStep
# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setSamplingRate [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)
示例9: createOutputStep
# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setSamplingRate [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)
示例10: runCreateOutputStep
# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setSamplingRate [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)
示例11: _appendOutputVolume
# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setSamplingRate [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)
示例12: createOutputStep
# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setSamplingRate [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)
示例13: _appendOutputVolume
# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setSamplingRate [as 别名]
def _appendOutputVolume(self, volumeOut):
vol = Volume()
vol.setFileName(volumeOut)
vol.setSamplingRate(self.inputParticlesTiltPair.get().getUntilted().getSamplingRate())
self.volumesSet.append(vol)
if self.doFilter.get():
volumeFilterOut = volumeOut.replace('.vol','_filtered.vol')
volf = Volume()
volf.setFileName(volumeFilterOut)
volf.setSamplingRate(self.inputParticlesTiltPair.get().getUntilted().getSamplingRate())
self.volumesFilterSet.append(volf)
示例14: createOutputStep
# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setSamplingRate [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)
示例15: createOutputStep
# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setSamplingRate [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)