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


Python XSDataFile.parseString方法代码示例

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


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

示例1: createDataCollectionFromImageHeaders

# 需要导入模块: from XSDataCommon import XSDataFile [as 别名]
# 或者: from XSDataCommon.XSDataFile import parseString [as 别名]
 def createDataCollectionFromImageHeaders(self, _edPlugin):
     """
     This method creates a list of XSDataSubwedges by reading the header of the images
     given as a list of paths as input.
     """
     EDVerbose.DEBUG("EDPluginControlSubWedgeAssemblev1_1.createDataCollectionFromImageHeaders")
     xsDataInputSubWedgeAssemble = _edPlugin.getDataInput()
     listXSDataFile = xsDataInputSubWedgeAssemble.getFile()
     if (len(listXSDataFile) > 0):
         listSubWedge = []
         iIndex = 1
         for xsDataFile in listXSDataFile:
             xsDataFileCopy = XSDataFile.parseString(xsDataFile.marshal())
             xsDataInputReadImageHeader = XSDataInputReadImageHeader()
             xsDataInputReadImageHeader.setImage(xsDataFileCopy)
             self.__edPluginReadImageHeader = self.loadPlugin(self.__strPluginReadImageHeaderName, "ReadImageHeader_%d" % (iIndex))
             self.__edPluginReadImageHeader.setDataInput(xsDataInputReadImageHeader)
             self.__edPluginReadImageHeader.executeSynchronous()
             xsDataResultReadImageHeader = self.__edPluginReadImageHeader.getDataOutput()
             bSuccess = False
             if (xsDataResultReadImageHeader is not None):
                 xsDataSubWedge = xsDataResultReadImageHeader.getSubWedge()
                 if (xsDataSubWedge is not None):
                     xsDataSubWedge.setSubWedgeNumber(XSDataInteger(iIndex))
                     listSubWedge.append(xsDataSubWedge)
                     bSuccess = True
             if (not bSuccess):
                 # Fix for bug #223: raise an error if an image could not be read
                 strErrorMessage = "EDPluginControlSubWedgeAssemblev1_1.createDataCollectionFromImageHeaders: %s %s" % (
                                     self.__strPluginReadImageHeaderName, \
                                     "Could not read header from image %s" % xsDataFileCopy.getPath().getValue())
                 EDVerbose.error(strErrorMessage)
                 self.addErrorMessage(strErrorMessage)
                 self.setFailure()
             iIndex += 1
         if (not self.isFailure()):
             xsDataInputSubWedgeMerge = XSDataInputSubWedgeMerge()
             for xsDataSubWedge in listSubWedge:
                 xsDataInputSubWedgeMerge.addSubWedge(xsDataSubWedge)
             self.__edPluginSubWedgeMerge.setDataInput(xsDataInputSubWedgeMerge)
             self.__edPluginSubWedgeMerge.executeSynchronous()
开发者ID:antolinos,项目名称:edna,代码行数:43,代码来源:EDPluginControlSubWedgeAssemblev1_1.py

示例2: createDataCollectionFromImageHeaders

# 需要导入模块: from XSDataCommon import XSDataFile [as 别名]
# 或者: from XSDataCommon.XSDataFile import parseString [as 别名]
 def createDataCollectionFromImageHeaders(self, _edPlugin):
     """
     This method creates a list of XSDataSubwedges by reading the header of the images
     given as a list of paths as input.
     """
     EDVerbose.DEBUG("EDPluginControlSubWedgeAssemblev10.createDataCollectionFromImageHeaders")
     xsDataInputSubWedgeAssemble = _edPlugin.getDataInput()
     listXSDataFile = xsDataInputSubWedgeAssemble.getFile()
     if (len(listXSDataFile) > 0):
         listSubWedge = []
         iIndex = 1
         for xsDataFile in listXSDataFile:
             xsDataFileCopy = XSDataFile.parseString(xsDataFile.marshal())
             xsDataInputReadImageHeader = XSDataInputReadImageHeader()
             xsDataInputReadImageHeader.setImage(xsDataFileCopy)
             self.__edPluginReadImageHeader = self.loadPlugin(self.__strPluginReadImageHeaderName, "ReadImageHeader_%d" % (iIndex))
             self.__edPluginReadImageHeader.setDataInput(xsDataInputReadImageHeader)
             self.__edPluginReadImageHeader.executeSynchronous()
             xsDataResultReadImageHeader = self.__edPluginReadImageHeader.getDataOutput()
             xsDataSubWedge = xsDataResultReadImageHeader.getSubWedge()
             if (xsDataSubWedge is None):
                 # Fix for bug #223: raise an error if an image could not be read
                 errorMessage = EDMessage.ERROR_EXECUTION_03 % ("EDPluginControlSubWedgeAssemblev10.createDataCollectionFromImageHeaders", \
                                                                 self.__strPluginReadImageHeaderName, \
                                                                 "Could not read header from image %s" % xsDataFileCopy.getPath().getValue())
                 EDVerbose.error(errorMessage)
                 self.addErrorMessage(errorMessage)
                 raise RuntimeError, errorMessage
             else:
                 listSubWedge.append(xsDataSubWedge)
             iIndex += 1
         xsDataInputSubWedgeMerge = XSDataInputSubWedgeMerge()
         for xsDataSubWedge in listSubWedge:
             xsDataInputSubWedgeMerge.addSubWedge(xsDataSubWedge)
         self.__edPluginSubWedgeMerge.setDataInput(xsDataInputSubWedgeMerge)
         self.__edPluginSubWedgeMerge.executeSynchronous()
开发者ID:antolinos,项目名称:edna,代码行数:38,代码来源:EDPluginControlSubWedgeAssemblev10.py


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