當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。