spateo.digitization.utils_old ============================= .. py:module:: spateo.digitization.utils_old .. autoapi-nested-parse:: Written by @Jinerhal, adapted by @Xiaojieqiu. Functions --------- .. autoapisummary:: spateo.digitization.utils_old.fill_grid_label spateo.digitization.utils_old.format_boundary_line spateo.digitization.utils_old.draw_seg_grid spateo.digitization.utils_old.euclidean_dist spateo.digitization.utils_old.segment_bd_line spateo.digitization.utils_old.extend_layer spateo.digitization.utils_old.field_contour_line spateo.digitization.utils_old.field_contours spateo.digitization.utils_old.add_ep_boundary spateo.digitization.utils_old.add_gp_boundary spateo.digitization.utils_old.effective_L2_error spateo.digitization.utils_old.calc_op_field Module Contents --------------- .. py:function:: fill_grid_label(adata, spatial_key, seg_grid_img, bdl_seg_coor_x, bdl_seg_coor_y, curr_layer, curr_sign, layer_label_key: str = 'layer_label', column_label_key: str = 'column_label', init: bool = False) .. py:function:: format_boundary_line(boundary_line_img, pt_start, pt_end) .. py:function:: draw_seg_grid(boundary_line_img, bdl_seg_coor_x, bdl_seg_coor_y, gridline_width=1, mode='grid') .. py:function:: euclidean_dist(point_x: Tuple, point_y: Tuple) .. py:function:: segment_bd_line(boundary_line_list, n_column) .. py:function:: extend_layer(boundary_line_img, boundary_line_list, extend_width=10) .. py:function:: field_contour_line(ctr_seq, pnt_pos, min_pnt, max_pnt) .. py:function:: field_contours(contour, pnt_xy, pnt_Xy, pnt_xY, pnt_XY) Identify four boundary lines according to given corner points. :param contour: _description_ :type contour: _type_ :param pnt_xy: _description_ :type pnt_xy: _type_ :param pnt_Xy: _description_ :type pnt_Xy: _type_ :param pnt_xY: _description_ :type pnt_xY: _type_ :param pnt_XY: _description_ :type pnt_XY: _type_ :returns: _description_ :rtype: _type_ .. py:function:: add_ep_boundary(op_field, op_line, value) Add equal weight boundary to op_field. :param op_field: _description_ :type op_field: _type_ :param op_line: _description_ :type op_line: _type_ :param value: _description_ :type value: _type_ :returns: _description_ :rtype: _type_ .. py:function:: add_gp_boundary(op_field, op_line, value_s, value_e) Add growing weight boundary to op_field. :param op_field: _description_ :type op_field: _type_ :param op_line: _description_ :type op_line: _type_ :param value_s: _description_ :type value_s: _type_ :param value_e: _description_ :type value_e: _type_ :returns: _description_ :rtype: _type_ .. py:function:: effective_L2_error(op_field_i, op_field_j, field_mask) Calculate effective L2 error between two fields. :param op_field_i: _description_ :type op_field_i: _type_ :param op_field_j: _description_ :type op_field_j: _type_ :param field_mask: _description_ :type field_mask: _type_ :returns: _description_ :rtype: _type_ .. py:function:: calc_op_field(op_field, min_line, max_line, edge_line_a, edge_line_b, field_border, field_mask, max_err=1e-05, max_itr=100000.0, lp=1, hp=100) Calculate op_field (weights) for given boundary weights. :param op_field: _description_ :type op_field: _type_ :param min_line: _description_ :type min_line: _type_ :param max_line: _description_ :type max_line: _type_ :param edge_line_a: _description_ :type edge_line_a: _type_ :param edge_line_b: _description_ :type edge_line_b: _type_ :param field_border: _description_ :type field_border: _type_ :param field_mask: _description_ :type field_mask: _type_ :param max_err: _description_. Defaults to 1e-5. :type max_err: _type_, optional :param max_itr: _description_. Defaults to 1e5. :type max_itr: _type_, optional :param lp: _description_. Defaults to 1. :type lp: int, optional :param hp: _description_. Defaults to 100. :type hp: int, optional :returns: _description_ :rtype: _type_