spateo.external.CAST.CAST_Stack¶
Classes¶
Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#dxy_da: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
coords_raw_list: list of numpy arrays, each array is the coordinates of a layer |
|
|
|
|
|
|
|
|
|
|
|
|
|
Module Contents¶
- spateo.external.CAST.CAST_Stack.prelocate(coords_q, coords_r, cov_anchor_it, bleeding, output_path, d_list=[1, 2, 3], prefix='test', ifplot=True, index_list=None, translation_params=None, mirror_t=None)[source]¶
- spateo.external.CAST.CAST_Stack.Affine_GD(coords_query_it_raw, coords_ref_it, cov_anchor_it, output_path, bleeding=500, dist_penalty=0, diff_step=50, alpha_basis=np.reshape(np.array([0, 0, 1 / 5, 2, 2]), [5, 1]), iterations=50, prefix='test', attention_params=[None, 3, 1, 0], scale_t=1, coords_log=False, index_list=None, mid_visual=False, early_stop_thres=1, ifrigid=False)[source]¶
- spateo.external.CAST.CAST_Stack.BSpline_GD(coords_q, coords_r, cov_anchor_it, iterations, output_path, bleeding, dist_penalty=0, alpha_basis=1000, diff_step=50, mesh_size=5, prefix='test', mesh_weight=None, attention_params=[None, 3, 1, 0], scale_t=1, coords_log=False, index_list=None, mid_visual=False, max_xy=None, renew_mesh_trans=True, restriction_t=0.5)[source]¶
- spateo.external.CAST.CAST_Stack.J_cal(coords_q, coords_r, cov_mat, bleeding=10, dist_penalty=0, attention_params=[None, 3, 1, 0])[source]¶
- spateo.external.CAST.CAST_Stack.dJ_dt_cal(coords_q, coords_r, diff_step, dev, cov_anchor_it, bleeding, dist_penalty, attention_params)[source]¶
- spateo.external.CAST.CAST_Stack.dJ_dtheta_cal(xi, yi, dJ_dxy_mat, theta, dev, ifrigid=False)[source]¶
#dxy_da: #{x * cos(rad_phi), x * sin(rad_phi)} #dxy_dd: #{-y * sin(rad_phi), y * cos(rad_phi)} #dxy_dphi: #{-d * y * cos(rad_phi) - a * x * sin(rad_phi), a * x * cos(rad_phi) - d * y * sin(rad_phi)} #dxy_dt1: #{1, 0} #dxy_dt2: #{0, 1}
# when we set d = a (rigid): #dxy_da #{x * cos(rad_phi) - y * sin(rad_phi), y * cos(rad_phi) + x * sin(rad_phi)} #dxy_dd - set as the same value as dxy_da #{x * cos(rad_phi) - y * sin(rad_phi), y * cos(rad_phi) + x * sin(rad_phi)} #dxy_dphi #{-a * y * cos(rad_phi) - a * x * sin(rad_phi), a * x * cos(rad_phi) - a * y * sin(rad_phi)}
- spateo.external.CAST.CAST_Stack.BSpline_GD_preparation(max_xy, mesh_size, dev, mesh_weight)[source]¶
- spateo.external.CAST.CAST_Stack.get_dxy_ffd(ij, result_B_t, mesh, dJ_dxy_mat, mesh_weight, alpha_basis)[source]¶
- spateo.external.CAST.CAST_Stack.plot_mid(coords_q, coords_r, output_path='', filename=None, title_t=['ref', 'query'], s_t=8, scale_bar_t=None)[source]¶
- spateo.external.CAST.CAST_Stack.corr_heat(coords_q, coords_r, corr, output_path, title_t=['Corr in ref', 'Anchor in query'], filename=None, scale_bar_t=None)[source]¶
- spateo.external.CAST.CAST_Stack.register_result(coords_q, coords_r, cov_anchor_t, bleeding, embed_stack, output_path, k=8, prefix='test', scale_t=1, index_list=None)[source]¶
- spateo.external.CAST.CAST_Stack.affine_reg_params(it_theta, similarity_score, iterations, output_path, prefix='test')[source]¶
- spateo.external.CAST.CAST_Stack.CAST_STACK_rough(coords_raw_list, ifsquare=True, if_max_xy=True, percentile=None)[source]¶
coords_raw_list: list of numpy arrays, each array is the coordinates of a layer ifsquare: if True, the coordinates will be scaled to a square if_max_xy: if True, the coordinates will be scaled to the max value of the max_range_x and max_range_y, respectively (if ifsquare is False), or the max value of [max_range_x,max_range_y] (if ifsquare is True) percentile: if not None, the min and max will be calculated based on the percentile of the coordinates for each slice.