本文整理汇总了Python中pyworkflow.em.data.Volume.setLocation方法的典型用法代码示例。如果您正苦于以下问题:Python Volume.setLocation方法的具体用法?Python Volume.setLocation怎么用?Python Volume.setLocation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyworkflow.em.data.Volume
的用法示例。
在下文中一共展示了Volume.setLocation方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createOutputStep
# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setLocation [as 别名]
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)
示例2: importVolumesStep
# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setLocation [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: createOutput
# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setLocation [as 别名]
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)
示例4: createOutput
# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setLocation [as 别名]
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)
示例5: createOutputStep
# 需要导入模块: from pyworkflow.em.data import Volume [as 别名]
# 或者: from pyworkflow.em.data.Volume import setLocation [as 别名]
def createOutputStep(self):
volSet = self.inputVolumes.get()
if self._isSingleInput():
vol = Volume()
vol.copyInfo(volSet)
if self.doResize:
vol.setSamplingRate(self.samplingRate)
vol.setFileName(self.outputStk)
self._defineOutputs(outputVol=vol)
else:
volumes = self._createSetOfVolumes()
volumes.copyInfo(volSet)
if self.doResize:
volumes.setSamplingRate(self.samplingRate)
for i, vol in enumerate(volSet):
j = i + 1
vol.setSamplingRate(self.samplingRate)
vol.setLocation(j, self.outputStk)
volumes.append(vol)
self._defineOutputs(outputVol=volumes)
self._defineTransformRelation(volSet, self.outputVol)