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


Python BlitzGateway.getAdminService方法代码示例

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


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

示例1: runAsScript

# 需要导入模块: from omero.gateway import BlitzGateway [as 别名]
# 或者: from omero.gateway.BlitzGateway import getAdminService [as 别名]
def runAsScript():

    dataTypes = [rstring('Image')]

    models_path=os.path.join(SCRIPT_PATH, "sample/classifiers/")
    systems=['carver']

    segmentationModel = []
    for file in os.listdir(models_path):
        if file.endswith(".model"):
            segmentationModel.append(str(os.path.join(models_path,file)))

    client = scripts.client('weka_tfmq.py', """Segment a dataset using Random Forest and a known classifier""",

    scripts.String("Data_Type", optional=False, grouping="1",
        description="Pick Images by 'Image' ID or by the ID of their 'Dataset'", values=dataTypes, default="Image"),

    scripts.List("IDs", optional=False, grouping="1.1",
        description="List of Dataset IDs or Image IDs to process.").ofType(rlong(0)),

    scripts.String("Segmentation_model", optional=False, grouping="2",
        description="Select model", values=segmentationModel, default=segmentationModel[0]),

    scripts.String("System", optional=False, grouping="3",
        description="Select the system", values=systems, default=systems[0]),

    scripts.String("Wall_time", grouping="3.1",
        description="Wall time", default='0:30:00'),

    scripts.String("Private_memory", grouping="3.2",
        description="Private memory", default='4GB'),

    scripts.Bool("Big_memory_nodes", grouping="3.2.1",
        description="Big memory nodes", default='False'),

    scripts.String("Nodes", grouping="3.3",
        description="Nodes", default='1'),

    scripts.String("PPN", grouping="3.4",
        description="PPN", default='5'),

    version = "0",
    authors = ["Joaquin Correa", "Data and Analytics services"],
    institutions = ["National Energy Research Scientific Computing Center (NERSC)"],
    contact = "[email protected]",
    )

    try:
        session = client.getSession();

        scriptParams = {}
        for key in client.getInputKeys():
            if client.getInput(key):
                scriptParams[key] = client.getInput(key, unwrap=True)

        conn = BlitzGateway(client_obj=client)

        admin = conn.getAdminService()
        uuid = admin.getEventContext().sessionUuid
        weka_segmentation(conn, scriptParams, uuid)

    finally:
        client.closeSession()
开发者ID:jjcorreao,项目名称:OMERO.HPC,代码行数:65,代码来源:weka_tfmq.py

示例2: runAsScript

# 需要导入模块: from omero.gateway import BlitzGateway [as 别名]
# 或者: from omero.gateway.BlitzGateway import getAdminService [as 别名]
def runAsScript():

    dataTypes = [rstring('Image')]

    models_path="/project/projectdirs/ngbi/jobs/ij_macros/classifiers"
    systems=['carver', 'sgnworker']

    # modelPath = []
    segmentationModel = []
    for file in os.listdir(models_path):
        if file.endswith(".model"):
            segmentationModel.append(str(os.path.join(models_path,file)))
            # segmentationModel.append(file)

    # Include files metadata information; link to a web application

    # segmentationModel = ['Desulfovibrio RCH1', 'Geobacter', 'Myxococcus Xanthus1', 'Myxococcus Xanthus2']

    client = scripts.client('weka_serial.py', """Segment a dataset using Random Forest and a known classifier""",

    scripts.String("Data_Type", optional=False, grouping="1",
        description="Pick Images by 'Image' ID or by the ID of their 'Dataset'", values=dataTypes, default="Image"),

    scripts.List("IDs", optional=False, grouping="1.1",
        description="List of Dataset IDs or Image IDs to process.").ofType(rlong(0)),

    scripts.String("Segmentation_model", optional=False, grouping="2",
        description="Select model", values=segmentationModel, default=segmentationModel[0]),

    scripts.String("System", optional=False, grouping="3",
        description="Select the system", values=systems, default=systems[0]),

    scripts.String("Wall_time", grouping="3.1",
        description="Wall time", default='0:30:00'),

    scripts.String("Private_memory", grouping="3.2",
        description="Private memory", default='4GB'),

    scripts.Bool("Big_memory_nodes", grouping="3.2.1",
        description="Big memory nodes", default='False'),

    scripts.String("Nodes", grouping="3.3",
        description="Nodes", default='1'),

    scripts.String("PPN", grouping="3.4",
        description="PPN", default='5'),

    version = "0",
    authors = ["Joaquin Correa", "OSP Team"],
    institutions = ["NERSC"],
    contact = "[email protected]",
    )

    try:
        session = client.getSession();





        # print("session key: %s" % (session)

        # process the list of args above.
        scriptParams = {}
        for key in client.getInputKeys():
            if client.getInput(key):
                scriptParams[key] = client.getInput(key, unwrap=True)

        print scriptParams

        print("key: %s" % (key))
        # print("session key: %s" % (session))

        # wrap client to use the Blitz Gateway
        conn = BlitzGateway(client_obj=client)

        admin = conn.getAdminService()
        uuid = admin.getEventContext().sessionUuid
        # uuid = uuid.split(":")[1]


        print(uuid)

        # print("key: %s" % (key))

        # sizeZ, sizeC, sizeT, sizeX, sizeY, dataset = newFilteredImage(conn, scriptParams)
        # newFilteredImage(conn, scriptParams)

        # sloopy("/global/project/projectdirs/ngbi/omero-0.7/OMERO.server/lib/scripts/omero/tmp/WT_7B_duct2.mrc")
        weka_segmentation(conn, scriptParams, uuid)

        # print sizeZ, sizeC, sizeT, sizeX, sizeY, dataset

        # Return message, new image and new dataset (if applicable) to the client
        # client.setOutput("Message", rstring(message))
        # if len(images) == 1:
        #     client.setOutput("Image", robject(images[0]._obj))
        # if dataset is not None:
        #     client.setOutput("New Dataset", robject(dataset._obj))

#.........这里部分代码省略.........
开发者ID:jjcorreao,项目名称:OMERO_features,代码行数:103,代码来源:OMERO_features.py


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