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


Python Cluster.close方法代码示例

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


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

示例1: segmentation

# 需要导入模块: from cluster import Cluster [as 别名]
# 或者: from cluster.Cluster import close [as 别名]
    ### Segmentation Phase ###
    # 2 - Full dataset initial segmentation (see notes above)
    [memseg.add(('hnsWatershed', pb, wl if wl else wl_file, iseg), pb if wl else (pb, wl_file), iseg, 'waterlevel') for pb, iseg in izip(f_p_blur, f_is1)]
    # 3 - Training initial segmentation (pre-merging) (see notes above)
    [memseg.add(('hnsMerge', iseg1, pb, areaThreshold0, areaThreshold1, probThreshold, iseg2), (iseg1, pb), iseg2, ('pm-area-threshold-0', 'pm-area-threshold-1', 'pm-prob-threshold')) for iseg1, pb, iseg2 in izip(f_is1, f_p_blur, f_is2)]
    # 4 - Full dataset merge generation
    [memseg.add(('hnsGenMerges', iseg, pb, t, s), (iseg, pb), (t, s)) for iseg, pb, t, s in izip(f_is2, f_p_blur, f_tree, f_sal)]
    # 5 - Full dataset boundary feature generation (see notes above)
    [memseg.add(('hnsGenBoundaryFeatures', iseg, t, s, db, p, textondict, bcf), (iseg, t, s, db, p, textondict), bcf, can_run_on_cluster=True) for iseg, t, s, db, p, bcf in izip(f_is2, f_tree, f_sal, f_d_blur, f_p_mha, f_bcf)]
    # 8 - Generate Predictions
    rf_predict_procs(memseg, bcmodel, f_bcf, f_bcp)
    # 9 - Segment
    # Defaults used:
    #   [4] labelOutputBinaryImageConnectedComponents -> 1 (must be 1)
    #   [5] writeToUInt16Image       -> 0 (means write uint32 label image which is what we want)
    [memseg.add(('hnsSegment', iseg, t, bcp, fseg), (iseg, t, bcp), fseg) for iseg, t, bcp, fseg in izip(f_is2, f_tree, f_bcp, f_fs)]
    
    ### Convert output files ###
    [memseg.add(('hnsGenOrderedContours', fseg, z, sp), fseg, sp) for fseg, z, sp in izip(f_fs, zs_f, seg_pts)]
    memseg.add(['combine_points',] + seg_pts + [seg_pts_all,], seg_pts, seg_pts_all)
    # TODO: -im and pixel spacing?
    memseg.add(('point2model', '-im', mrc_f_filename, seg_pts_all, mod_output), (mrc_f_filename,seg_pts_all), mod_output)


    # Run!
    memseg.run(cluster=cluster, verbose=True)

    # Cleanup
    if cluster: cluster.close()
开发者ID:BMilkjam,项目名称:py-seg-tools,代码行数:31,代码来源:hns.py


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