deepcinac.utils.display

Module Contents

Functions

plot_hist_distribution(distribution_data, description)

Plot a distribution in the form of an histogram, with option for adding some scatter values

plot_spikes_raster([spike_nums, title, file_name, ...])

Plot or save a raster given a 2d array either binary representing onsets, peaks or rising time, or made of float

Attributes

BREWER_COLORS

deepcinac.utils.display.BREWER_COLORS = ['#a6cee3', '#1f78b4', '#b2df8a', '#33a02c', '#fb9a99', '#e31a1c', '#fdbf6f', '#ff7f00',...
deepcinac.utils.display.plot_hist_distribution(distribution_data, description, param=None, values_to_scatter=None, xticks_labelsize=10, yticks_labelsize=10, x_label_font_size=15, y_label_font_size=15, labels=None, scatter_shapes=None, colors=None, tight_x_range=False, twice_more_bins=False, background_color='black', labels_color='white', xlabel='', ylabel=None, path_results=None, save_formats='pdf', v_line=None, x_range=None, ax_to_use=None, color_to_use=None)

Plot a distribution in the form of an histogram, with option for adding some scatter values :param distribution_data: :param description: :param param: :param values_to_scatter: :param labels: :param scatter_shapes: :param colors: :param tight_x_range: :param twice_more_bins: :param xlabel: :param ylabel: :param save_formats: :return:

deepcinac.utils.display.plot_spikes_raster(spike_nums=None, title=None, file_name=None, time_str=None, spike_train_format=False, y_ticks_labels=None, y_ticks_labels_size=None, y_ticks_labels_color='white', x_ticks_labels_color='white', x_ticks_labels=None, x_ticks_labels_size=None, x_ticks=None, hide_x_labels=False, figure_background_color='black', without_ticks=True, save_raster=False, show_raster=False, plot_with_amplitude=False, activity_threshold=None, save_formats='png', span_area_coords=None, span_area_colors=None, span_area_only_on_raster=True, alpha_span_area=0.5, cells_to_highlight=None, cells_to_highlight_colors=None, color_peaks_activity=False, horizontal_lines=None, horizontal_lines_colors=None, horizontal_lines_sytle=None, horizontal_lines_linewidth=None, vertical_lines=None, vertical_lines_colors=None, vertical_lines_sytle=None, vertical_lines_linewidth=None, scatters_on_traces=None, scatters_on_traces_marker='*', scatters_on_traces_size=5, sliding_window_duration=1, show_sum_spikes_as_percentage=False, span_cells_to_highlight=None, span_cells_to_highlight_colors=None, spike_shape='|', spike_shape_size=10, raster_face_color='black', cell_spikes_color='white', activity_sum_plot_color='white', activity_sum_face_color='black', y_lim_sum_activity=None, seq_times_to_color_dict=None, link_seq_categories=None, link_seq_color=None, min_len_links_seq=3, link_seq_line_width=1, link_seq_alpha=1, jitter_links_range=1, display_link_features=True, seq_colors=None, debug_mode=False, axes_list=None, SCE_times=None, ylabel=None, without_activity_sum=False, spike_nums_for_activity_sum=None, spikes_sum_to_use=None, size_fig=None, cmap_name='jet', traces=None, display_traces=False, display_spike_nums=True, traces_lw=0.3, path_results=None, without_time_str_in_file_name=False, desaturate_color_according_to_normalized_amplitude=False, lines_to_display=None, lines_color='white', lines_width=1, lines_band=0, lines_band_color='white', use_brewer_colors_for_traces=False, dpi=100)

Plot or save a raster given a 2d array either binary representing onsets, peaks or rising time, or made of float to represents traces or encoding in onset/peaks/rising time a value. :param spike_nums: np.array of 2D, axis=1 (lines) represents the cells, the columns representing the spikes It could be binary, or containing the amplitude, if amplitudes values should be display put plot_with_amplitude to True :param spike_train_format: if True, means the data is a list of np.array, and then spike_nums[i][j] is a timestamps value as float :param title: title to be plot :param file_name: name of the file if save_raster is True :param save_raster: if True, the plot will be save. To do so param should not be None and contain a variable path_results that will indicated where to save file_name :param show_raster: if True, the plot will be shown :param plot_with_amplitude: to display a color bar representing the content values. :param activity_threshold: Int representing a threshold that will be display as a red line on the sum of activity subplot. :param save_formats: string or list of string representing the formats in which saving the raster. Exemple: “pdf” or [“pdf”, “png”] :param span_area_coords: List of list of tuples of two float representing coords (x, x) of span band with a color corresponding to the one in span_area_colors :param span_area_colors: list of colors, same len as span_area_coords :param span_area_only_on_raster: if True, means the span won’t be on the sum of activity on the sub-plot as well :param cells_to_highlight: cells index to span (y-axis) with special spikes color, list of int :param cells_to_highlight_colors: cells colors to span, same len as cells_to_span, list of string :param color_peaks_activity: if True, will span to the color of cells_to_highlight_colors each time at which a cell among cells_to_highlight will spike on the activity peak diagram :param horizontal_lines: list of float, representing the y coord at which trace horizontal lines :param horizontal_lines_colors: if horizontal_lines is not None, will set the colors of each line, list of string or color code :param horizontal_lines_style: give the style of the lines, string :param vertical_lines: list of float, representing the x coord at which trace vertical lines :param vertical__lines_colors: if horizontal_lines is not None, will set the colors of each line, list of string or color code :param vertical__lines_style: give the style of the lines, string :param vertical_lines_linewidth: linewidth of vertical_lines :param raster_face_color: the background color of the raster :param cell_spikes_color: the color of the spikes of the raster :param spike_shape: shape of the spike, “|”, “*”, “o” :param spike_shape_size: use for shape != of “|” :param seq_times_to_color_dict: None or a dict with as the key a tuple of int representing the cell index, and as a value a list of set, each set composed of int representing the times value at which the cell spike should be colored. It will be colored if there is indeed a spike at that time otherwise, the default color will be used. :param seq_colors: A dict, with key a tuple represening the indices of the seq and as value of colors, a color, should have the same keys as seq_times_to_color_dict :param link_seq_color: if not None, give the color with which link the spikes from a sequence. If not None, seq_colors will be ignored. could be a dict with key same tuple as seq_times_to_color_dict or a string and then we use the same color for all seq :param min_len_links_seq: minimum len of a seq for the links to be drawn :param axes_list if not None, give a list of axes that will be used, and be filled, but no figure will be created or saved then. Doesn’t work yet is show_amplitude is True :param SCE_times: a list of tuple corresponding to the first and last index of each SCE, (last index being included in the SCE). Will display the position of the SCE and their number above the activity diagram. If None, the overall time will be displayed. Need to be adapted to the format spike_numw or spike_train. Equivalent to span_are_coords :param without_activity_sum: if True, don’t plot the sum of activity diagram, valid only if axes_list is not None :param spike_nums_for_activity_sum: if different that the one given for the raster, should be the same second dimension :param spikes_sum_to_use: an array of 1D, that will be use to display the sum of activity, :param size_fig: tuple of int :param cmap_name: “jet” by default, used if with_amplitude for the colormap :param traces if not None and display_traces is True, will display traces instead of a raster :param display_traces, if True display traces :param display_spike_nums, if False, won’t display a raster using spike_nums :param traces_lw, default 0.3, linewidth of the traces :param path_results: indicate where to save the plot, replace the param.path_results if it exists :param desaturate_color_according_to_normalized_amplitude: if True, spike_nums should be filled with float between 0 and 1, representing the amplitude of the spike. And if a color is given for a cell, then it will be desaturate according to this value :param lines_to_display, dict that takes for a key a tuple of int representing 2 cells, and as value a list of tuple of 2 float representing the 2 extremities of a line between those 2 cells. By defualt, no lines :param lines_color=”white”: colors of lines_to_display :param lines_width=1: width of lines_to_display :param lines_band=0: if > 0, display a band around the line with transparency :param lines_band_color=”white” :return: