Visualization

Trace Visualization

brainlit.viz.skeletonize(img: np.ndarray, points: pd.DataFrame)[source]

Draw lines between points that are connected to produce binary mask

Parameters
  • image (img {3d array} --) --

  • combine_swc_img.points2voxel (points {pandas dataframe} -- dataframe with swc points as output by) --

Returns

[3d array] -- binary mask showing skeletonization between points

brainlit.viz.Bresenham3D(x1: int, y1: int, z1: int, x2: int, y2: int, z2: int)[source]

Takes two coordinates and gives the set of coordinates that connects them with a straight line

Adapted from https://www.geeksforgeeks.org/bresenhams-algorithm-for-3-d-line-drawing/

Parameters
  • coodinate (z2 {int} -- second z) --

  • coodinate --

  • coodinate --

  • coodinate --

  • coodinate --

  • coodinate --

Returns

[list] -- list of x coordinate connecting the points [list] -- list of y coordinate connecting the points [list] -- list of z coordinate connecting the points