polyTEM.crystal_peaks.flow_fields.propagate_lines¶
- polyTEM.crystal_peaks.flow_fields.propagate_lines(line_seeds, peak_matrix, matrix_step_size, bend_tolerance, rotate=False, curve_resolution=2, max_grid_length=200)¶
Lines are extended in both direction from each line seed to create a more readable image. When lines encounter a small change in angle, they bend to the new angle. If the angle difference is larger than the angle tolerance, the line ends instead. Lines also end if they reach the edge of the figure or they reach the maximum number of points. At each step, the lines are extended by a fixed unit length using a test line. If the test line finds a compatible location, the line is extended; otherwise it is terminated. Lines extend in both directions from each line seed, but the two directions are treated as separate lines.
- Inputs:
line_seeds: as created by the seed_lines function, this is a 3xn matrix of (x, y, theta) values. peak_matrix: as created by the determine_peaks function, this is a binary matrix showing the positions
and angles of peaks.
matrix_step_size: the real space distance between grid squares, i.e. 10nm bend_tolerance: the maximum bending permitted in a line spanning two grid squares rotate: whether to rotate the peak orientations by 90 degrees curve_resolution: the number of times per unit length that the angle of the line is updated max_grid_length: the maximum length a line can be extended, in grid units
- Outputs:
- line_matrix: (4 x m x n) matrix, which contains the (x, y, theta, is_active) values for each point m along each
line n. is_active is a binary value which is true if the line is still being drawn at that point.