dynamo.pl.line_integral_conv

dynamo.pl.line_integral_conv(adata, basis='umap', U_grid=None, V_grid=None, xy_grid_nums=[50, 50], method='yt', cmap='viridis', normalize=False, density=1, lim=(0, 1), const_alpha=False, kernellen=100, V_threshold=None, vector='velocity', file=None, save_show_or_return='show', save_kwargs={}, g_kwargs_dict={})[source]
Visualize vector field with quiver, streamline and line integral convolution (LIC), using velocity estimates on a

grid from the associated data. A white noise background will be used for texture as default. Adjust the bounds of lim in the range of [0, 1] which applies upper and lower bounds to the values of line integral convolution and enhance the visibility of plots. When const_alpha=False, alpha will be weighted spatially by the values of line integral convolution; otherwise a constant value of the given alpha is used.

Parameters:
  • adata (AnnData) – an AnnData object that contains U_grid and V_grid data.

  • basis (str) – the dimension reduction method to use. Defaults to “umap”.

  • U_grid (Optional[ndarray]) – original velocity on the first dimension of a 2 d grid. Defaults to None.

  • V_grid (Optional[ndarray]) – original velocity on the second dimension of a 2 d grid. Defaults to None.

  • xy_grid_nums (Union[Tuple[int], List[int]]) – the number of grids in either x or y axis. The number of grids has to be the same on both dimensions. Defaults to [50, 50].

  • method (Literal['yt', 'lic']) – the method to visualize the data. Defaults to “yt”.

  • cmap (str) – the colormap used to plot the figure. Defaults to “viridis”.

  • normalize (bool) – whether to normalize the original data. Defaults to False.

  • density (float) – density of the streamlines. Defaults to 1.

  • lim (Tuple[float, float]) – the value of line integral convolution will be clipped to the range of lim, which applies upper and lower bounds to the values of line integral convolution and enhance the visibility of plots. Each element should be in the range of [0,1].. Defaults to (0, 1).

  • const_alpha (bool) – whether to prevent the alpha from being weighted spatially by the values of line integral convolution; otherwise a constant value of the given alpha is used. Defaults to False.

  • kernellen (float) – the lens of kernel for convolution, which is the length over which the convolution will be performed. For longer kernellen, longer streamline structure will appear. Defaults to 100.

  • V_threshold (Optional[float]) – the threshold of velocity value for visualization. Defaults to None.

  • vector (str) – which vector type will be used for plotting, one of {‘velocity’, ‘acceleration’} or either velocity field or acceleration field will be plotted. Defaults to “velocity”.

  • file (Optional[str]) – the path to save the slice figure. Defaults to None.

  • save_show_or_return (Literal['save', 'show', 'return']) – whether to save, show or return the figure. Defaults to “show”.

  • save_kwargs (Dict[str, Any]) – a dictionary that will be passed to the save_fig function. By default, it is an empty dictionary and the save_fig function will use the {“path”: None, “prefix”: ‘line_integral_conv’, “dpi”: None, “ext”: ‘pdf’, “transparent”: True, “close”: True, “verbose”: True} as its parameters. Otherwise, you can provide a dictionary that properly modify those keys according to your needs. Defaults to {}.

  • g_kwargs_dict (Dict[str, Any]) – any other kwargs that would be passed to dynamo.tl.grid_velocity_filter. Defaults to {}.

Raises:
Returns:

None would be returned by default. If save_show_or_return is set to be True, the generated yt.SlicePlot will be returned.