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


Python Volume.setLocation方法代码示例

本文整理汇总了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)
开发者ID:josegutab,项目名称:scipion,代码行数:28,代码来源:protocol_process.py

示例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)
开发者ID:josegutab,项目名称:scipion,代码行数:37,代码来源:volumes.py

示例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)
开发者ID:I2PC,项目名称:scipion,代码行数:13,代码来源:protocol_split_volume.py

示例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)
开发者ID:azazellochg,项目名称:scipion,代码行数:14,代码来源:protocol_split_volume.py

示例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)
开发者ID:josegutab,项目名称:scipion,代码行数:24,代码来源:protocol_crop_resize.py


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