make_interpolated

behavenet.plotting.cond_ae_utils.make_interpolated(ims, save_file, markers=None, text=None, text_title=None, text_color=[1, 1, 1], fontsize=4, frame_rate=20, scale=3, markersize=10, markeredgecolor='w', markeredgewidth=1, ax=None)[source]

Make a latent space interpolation movie.

Parameters:
  • ims (list of np.ndarray) – each list element is an array of shape (y_pix, x_pix)

  • save_file (str) – absolute path of save file; does not need file extension, will automatically be saved as mp4. To save as a gif, include the ‘.gif’ file extension in save_file. The movie will only be saved if ax is NoneType; else the list of animated frames is returned

  • markers (array-like, optional) – array of size (n_frames, 2) which specifies the (x, y) coordinates of a marker on each frame

  • text (array-like, optional) – array of size (n_frames) which specifies text printed in the lower left corner of each frame

  • text_title (array-like, optional) – array of size (n_frames) which specifies text printed in the upper left corner of each frame

  • text_color (array-like, optional) – rgb array specifying color of text and text_title, if applicable

  • frame_rate (float, optional) – frame rate of saved movie

  • scale (float, optional) – width of panel is (scale / 2) inches

  • markersize (float, optional) – size of marker if markers is not NoneType

  • markeredgecolor (float, optional) – color of marker edge if markers is not NoneType

  • markeredgewidth (float, optional) – width of marker edge if markers is not NoneType

  • ax (matplotlib.axes.Axes object) – optional axis in which to plot the frames; if this argument is not NoneType the list of animated frames is returned and the movie is not saved

Returns:

list of list of animated frames if ax is True; else save movie

Return type:

list