nwbwidgets package

Subpackages

Submodules

nwbwidgets.allen module

class nwbwidgets.allen.AllenRasterWidget(**kwargs: Any)[source]

Bases: RasterWidget

Public constructor

make_group_and_sort(group_by=None, control_order=False)[source]
class nwbwidgets.allen.AllenPSTHWidget(**kwargs: Any)[source]

Bases: TimeIntervalsSelector

Creates a TimeInterval controller that controls InnerWidget.

Parameters

input_data (pynwb object) – Pynwb object (e.g. pynwb.misc.Units) belonging to a nwbfile that will be filtered by the TimeIntervalSelector controller.

InnerWidget

alias of PSTHWidget

class nwbwidgets.allen.AllenRasterGridWidget(**kwargs: Any)[source]

Bases: TimeIntervalsSelector

Creates a TimeInterval controller that controls InnerWidget.

Parameters

input_data (pynwb object) – Pynwb object (e.g. pynwb.misc.Units) belonging to a nwbfile that will be filtered by the TimeIntervalSelector controller.

InnerWidget

alias of RasterGridWidget

class nwbwidgets.allen.AllenTuningCurveWidget(**kwargs: Any)[source]

Bases: TimeIntervalsSelector

Creates a TimeInterval controller that controls InnerWidget.

Parameters

input_data (pynwb object) – Pynwb object (e.g. pynwb.misc.Units) belonging to a nwbfile that will be filtered by the TimeIntervalSelector controller.

InnerWidget

alias of TuningCurveWidget

class nwbwidgets.allen.AllenRasterGroupAndSortController(**kwargs: Any)[source]

Bases: GroupAndSortController

Parameters
  • dynamic_table (DynamicTable) – the table wrt which the grouping is performed

  • group_by (str) – the column name from the dynamic table for which the grouping is performed

  • window (None or bool,) –

  • keep_rows (Iterable) – rows of dynamic table to consider in the grouping op

  • control_limit (bool) – whether to control the limit of the displayed rows

  • control_order (bool) – whether to control the order of the displayed rows based on other column

  • groups (dict) – dict(column_name=column_values) to work with specific columns only

get_groups()[source]
get_orderable_cols()[source]
get_group_vals(by, rows_select=())[source]
nwbwidgets.allen.allen_show_dynamic_table(node: DynamicTable, **kwargs) Widget[source]
nwbwidgets.allen.allen_show_electrodes(node: DynamicTable)[source]
nwbwidgets.allen.load_allen_widgets()[source]

nwbwidgets.base module

nwbwidgets.base.show_fields(node, **kwargs) Widget[source]
nwbwidgets.base.render_dataframe(dynamic_table: DynamicTable)[source]
nwbwidgets.base.show_neurodata_base(node: NWBDataInterface, neurodata_vis_spec: dict) Widget[source]

Gets a pynwb object and returns a Vertical Box containing textual info and an expandable Accordion with it’s children.

nwbwidgets.base.dict2accordion(d: dict, neurodata_vis_spec: dict, **pass_kwargs) Widget[source]
nwbwidgets.base.lazy_tabs(in_dict: dict, node, style: ~typing.Union[~ipywidgets.widgets.widget_selectioncontainer.Accordion, ~ipywidgets.widgets.widget_selectioncontainer.Tab] = <class 'ipywidgets.widgets.widget_selectioncontainer.Tab'>) Union[Accordion, Tab][source]

Creates a lazy tab object where multiple visualizations can be used for a single node and are generated on the fly

Parameters
  • in_dict (dict) – keys are labels for tabs and values are functions

  • node (NWBDataInterface) – instance of neurodata type to visualize

  • style (ipywidgets.Tab or ipywidgets.Accordion, optional) – which way to present the data

Returns

tab

Return type

widget

class nwbwidgets.base.LazyTab(**kwargs: Any)[source]

Bases: Tab

A lazy tab object where multiple visualizations can be used for a single node and are generated on the fly

Parameters
  • func_dict (dict) – keys are labels for tabs and values are functions

  • data (NWBDataInterface) – instance of neurodata type to visualize

nwbwidgets.base.lazy_show_over_data(list_, func_, labels=None, style: ~typing.Union[~ipywidgets.widgets.widget_selectioncontainer.Accordion, ~ipywidgets.widgets.widget_selectioncontainer.Tab] = <class 'ipywidgets.widgets.widget_selectioncontainer.Tab'>) Union[Accordion, Tab][source]

Apply same function to list of data in lazy tabs or lazy accordion :param list_: :param func_: :param labels: :type labels: list of str :param style: :type style: widgets.Tab or widgets.Accordion

Returns

subtype Tab or Accordion

Return type

ipywidgets.Tab or ipywidgets.Accordion

nwbwidgets.base.nwb2widget(node, neurodata_vis_spec: dict, **pass_kwargs) Widget[source]
nwbwidgets.base.vis2widget(vis) Widget[source]
nwbwidgets.base.fig2widget(fig: Figure, **kwargs) Widget[source]
nwbwidgets.base.processing_module(node: ProcessingModule, neurodata_vis_spec: dict) Widget[source]
nwbwidgets.base.show_text_fields(node, exclude=('comments', 'interval'), **kwargs) Widget[source]
nwbwidgets.base.df2accordion(df: ~pandas.core.frame.DataFrame, by, func, style: ~typing.Union[~ipywidgets.widgets.widget_selectioncontainer.Accordion, ~ipywidgets.widgets.widget_selectioncontainer.Tab] = <class 'ipywidgets.widgets.widget_selectioncontainer.Accordion'>, detect_single=True) Union[Accordion, Tab][source]

Visualize pandas.DataFrame with an ipywidgets.Accordion

Parameters
  • df (pandas.DataFrame) –

  • by (str) –

  • func (visualization function) –

  • style (ipywidgets.Tab or ipywidgets.Accordion, optional) –

  • detect_single (bool) – If True, test if the dimension you are grouping by only has 1 unique value. If so, do not form an Accordion.

Return type

ipywigets.Accordion or ipywidgets.Tab

nwbwidgets.base.show_dset(dset: Dataset, **kwargs)[source]
nwbwidgets.base.dataset_to_sheet(dset: Dataset)[source]
nwbwidgets.base.show_dict(in_dict) Widget[source]
nwbwidgets.base.df_to_hover_text(df: DataFrame)[source]
nwbwidgets.base.row_to_hover_text(row)[source]
class nwbwidgets.base.TimeIntervalsSelector(**kwargs: Any)[source]

Bases: VBox

Creates a TimeInterval controller that controls InnerWidget.

Parameters

input_data (pynwb object) – Pynwb object (e.g. pynwb.misc.Units) belonging to a nwbfile that will be filtered by the TimeIntervalSelector controller.

InnerWidget = None
stimulus_type_dd_callback(change)[source]
nwbwidgets.base.show_multi_container_interface(node: MultiContainerInterface, neurodata_vis_spec=None)[source]

nwbwidgets.behavior module

nwbwidgets.behavior.show_behavioral_events(beh_events: BehavioralEvents, neurodata_vis_spec: dict)[source]
nwbwidgets.behavior.show_spatial_series(node: SpatialSeries, **kwargs)[source]
nwbwidgets.behavior.route_spatial_series(spatial_series, **kwargs)[source]
class nwbwidgets.behavior.SpatialSeriesTraceWidget(**kwargs: Any)[source]

Bases: AbstractTraceWidget

Public constructor

abstract plot_data(data, units, tt)[source]
abstract update_plot(data, tt)[source]
set_out_fig()[source]
class nwbwidgets.behavior.SpatialSeriesTraceWidget2D(**kwargs: Any)[source]

Bases: SpatialSeriesTraceWidget

Public constructor

plot_data(data, units, tt)[source]
update_plot(data, tt)[source]
class nwbwidgets.behavior.SpatialSeriesTraceWidget3D(**kwargs: Any)[source]

Bases: SpatialSeriesTraceWidget

Public constructor

plot_data(data, units, tt)[source]
update_plot(data, tt)[source]
nwbwidgets.behavior.trial_align_spatial_series(spatial_series, trials=None)[source]

nwbwidgets.brains module

nwbwidgets.brains.make_cylinder_mesh(radius, height, sections=32, position=(0, 0, 0), direction=(1, 0, 0), **kwargs)[source]
nwbwidgets.brains.make_cylinders(positions, directions, radius=1, height=1, sections=32, name='cylinders', **kwargs)[source]
class nwbwidgets.brains.HumanElectrodesPlotlyWidget(**kwargs: Any)[source]

Bases: VBox

Public constructor

static find_normals(points, k=3)[source]
show_electrodes(electrodes: DynamicTable, color_by)[source]
plot_human_brain(left_opacity=1.0, right_opacity=1.0)[source]
observe_left_opacity(change)[source]
observe_right_opacity(change)[source]
color_electrode_by(change)[source]

nwbwidgets.dynamictablesummary module

class nwbwidgets.dynamictablesummary.DynamicTableSummaryWidget(**kwargs: Any)[source]

Bases: VBox

Public constructor

max_selection(change)[source]
reset_dropdown()[source]
plot_hist_bar(col_names_display, nbins, show_labels)[source]

nwbwidgets.ecephys module

nwbwidgets.ecephys.show_spectrogram(nwbobj: TimeSeries, channel=0, **kwargs)[source]
class nwbwidgets.ecephys.ElectrodeGroupsWidget(**kwargs: Any)[source]

Bases: ValueWidget, HBox

Public constructor

nwbwidgets.ecephys.show_electrodes(electrodes_table)[source]
nwbwidgets.ecephys.show_ccf(electrodes_table=None, **kwargs)[source]
nwbwidgets.ecephys.show_spike_event_series(ses: SpikeEventSeries, **kwargs)[source]
class nwbwidgets.ecephys.ElectricalSeriesWidget(**kwargs: Any)[source]

Bases: BaseGroupedTraceWidget

Parameters
  • time_series (TimeSeries) –

  • dynamic_table_region_name (str, optional) –

  • foreign_time_window_controller (StartAndDurationController, optional) –

  • foreign_group_and_sort_controller (GroupAndSortController, optional) –

  • mpl_plotter (function) – Choose function to use when creating figures

  • kwargs

nwbwidgets.ephys_viz_interface module

import ipywidgets as widgets import pynwb from .view import default_neurodata_vis_spec import spikeextractors as se from pynwb.ecephys import LFP

ephys_viz_neurodata_vis_spec = dict(default_neurodata_vis_spec)

def _set_spec():

ephys_viz_neurodata_vis_spec[pynwb.ecephys.LFP] = show_lfp

def show_lfp(node: LFP, **kwargs):

import spikeextractors as se import ephys_viz as ev try:

recording = LFPRecordingExtractor(lfp_node=node)

except:

return widgets.Text(‘Problem creating LFPRecordingExtractor’)

return ev.TimeseriesView(

recording=recording, initial_y_scale_factor=5

).show(render=False)

class LFPRecordingExtractor(se.RecordingExtractor):
def __init__(self, lfp_node: LFP):

super().__init__() lfp = list(lfp_node.electrical_series.values())[0] self._samplerate = lfp.rate self._data = lfp.data self._num_channels = self._data.shape[1] self._num_timepoints = self._data.shape[0]

def get_channel_ids(self):

return list(range(self._num_channels))

def get_num_frames(self):

return self._num_timepoints

def get_sampling_frequency(self):

return self._samplerate

def get_traces(self, channel_ids=None, start_frame=None, end_frame=None):
if start_frame is None:

start_frame = 0

if end_frame is None:

end_frame = self.get_num_frames()

if channel_ids is None:

channel_ids = self.get_channel_ids()

return self._data[start_frame:end_frame, :][:, channel_ids].T

_set_spec()

nwbwidgets.file module

nwbwidgets.file.show_nwbfile(nwbfile: NWBFile, neurodata_vis_spec: dict) Widget[source]

Gets a pynwb object and returns a Vertical Box containing textual info and an expandable Accordion with it’s children.

nwbwidgets.icephys module

nwbwidgets.icephys.show_single_sweep_sequence(sweep_sequence, axs=None, title=None, **kwargs) Figure[source]

Show a single rep of a single stimulus sequence

Parameters
  • sweep_sequence

  • axs ([matplotlib.pyplot.Axes, matplotlib.pyplot.Axes], optional) –

  • title (str, optional) –

  • kwargs (dict) – passed to show_indexed_timeseries_mpl

Return type

matplotlib.pyplot.Figure

nwbwidgets.icephys.show_sweep_sequence_reps(stim_df: DataFrame, **kwargs) Figure[source]

Show data from multiple reps of the same stimulus type

Parameters
  • stim_df (pandas.DataFrame) –

  • kwargs (dict) – passed to show_single_sweep_sequence

Return type

matplotlib.pyplot.Figure

nwbwidgets.icephys.show_sweep_sequences(node: ~ndx_icephys_meta.icephys.SweepSequences, *args, style: ~typing.Union[~ipywidgets.widgets.widget_selectioncontainer.Accordion, ~ipywidgets.widgets.widget_selectioncontainer.Tab] = <class 'ipywidgets.widgets.widget_selectioncontainer.Accordion'>, **kwargs) Union[Accordion, Tab][source]

Visualize the sweep sequences table with a lazy accordion of sweep sequence repetitions

Parameters
  • node (SweepSequences) –

  • style (widgets.Accordion or widgets.Tabs) –

Return type

widgets.Accordion or widgets.Tabs

nwbwidgets.icephys.show_sequential_recordings(nwbfile, elec_name, sequence_id=0)[source]
class nwbwidgets.icephys.IVCurveWidget(**kwargs: Any)[source]

Bases: VBox

Public constructor

update_electrode(change)[source]
update_stimulus(change)[source]
update_figure()[source]

nwbwidgets.image module

class nwbwidgets.image.ImageSeriesWidget(**kwargs: Any)[source]

Bases: VBox

Widget showing ImageSeries.

Public constructor

time_to_index(time)[source]
set_controls(**kwargs)[source]
get_frame(idx)[source]
set_out_fig()[source]
nwbwidgets.image.show_image_series(image_series: ImageSeries, neurodata_vis_spec: dict)[source]
nwbwidgets.image.show_grayscale_image_series(image_series: ImageSeries, neurodata_vis_spec: dict)[source]
nwbwidgets.image.show_index_series(index_series, neurodata_vis_spec: dict)[source]
nwbwidgets.image.show_grayscale_image(grayscale_image: GrayscaleImage, neurodata_vis_spec=None)[source]
nwbwidgets.image.show_rbga_image(rgb_image: RGBImage, neurodata_vis_spec=None)[source]

nwbwidgets.misc module

nwbwidgets.misc.show_annotations(annotations: AnnotationSeries, **kwargs)[source]
nwbwidgets.misc.show_session_raster(units: Units, time_window=None, units_window=None, show_obs_intervals=True, order=None, group_inds=None, labels=None, show_legend=True, progress_bar=None)[source]
Parameters
  • units (pynwb.misc.Units) –

  • time_window ([int, int]) –

  • units_window ([int, int]) –

  • show_obs_intervals (bool) –

  • order (array-like, optional) –

  • group_inds (array-like, optional) –

  • labels (array-like, optional) –

  • show_legend (bool) – default = True Does not show legend if color_by is None or ‘id’.

  • progress_bar (FloatProgress, optional) –

Return type

matplotlib.pyplot.Figure

class nwbwidgets.misc.RasterWidget(**kwargs: Any)[source]

Bases: HBox

Public constructor

make_group_and_sort(group_by=None, control_order=True)[source]
nwbwidgets.misc.show_decomposition_series(node, **kwargs)[source]
nwbwidgets.misc.show_decomposition_traces(node: DecompositionSeries)[source]
class nwbwidgets.misc.PSTHWidget(**kwargs: Any)[source]

Bases: VBox

Public constructor

get_trials()[source]
make_group_and_sort(window=None, control_order=False)[source]
update(index: int, start_labels: tuple = ('start_time',), start: float = 0.0, end: float = 1.0, order=None, group_inds=None, labels=None, sigma_in_secs=0.05, ntt: int = 1000, progress_bar=None, figsize=(12, 7), nbins=30, plot_type='histogram', align_line_color=(0.7, 0.7, 0.7))[source]
Parameters
  • index (int) – Index of unit

  • start_label (str, optional) – Trial column name to align on

  • start (float) – Start time for calculation before or after (negative or positive) the reference point (aligned to).

  • end (float) – End time for calculation before or after (negative or positive) the reference point (aligned to).

  • order

  • group_inds

  • labels

  • sigma_in_secs (float, optional) – standard deviation of gaussian kernel

  • ntt – Number of time points to use for smooth curve

  • progress_bar

  • figsize (tuple, optional) –

Return type

matplotlib.Figure

nwbwidgets.misc.show_histogram(data, ax: Axes, start: float, end: float, group_inds=None, nbins: int = 30)[source]
nwbwidgets.misc.show_psth_smoothed(data, ax, start: float, end: float, group_inds=None, sigma_in_secs: float = 0.05, ntt: int = 1000)[source]
nwbwidgets.misc.plot_grouped_events(data, window, group_inds=None, colors=['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf'], ax=None, labels=None, show_legend=True, offset=0, unobserved_intervals_list=None, progress_bar=None, figsize=(8, 6), fontsize=12)[source]
Parameters
  • data (array-like) –

  • window (array-like [float, float]) – Time in seconds

  • group_inds (array-like dtype=int, optional) –

  • colors (array-like, optional) –

  • ax (plt.Axes, optional) –

  • labels (array-like dtype=str, optional) –

  • show_legend (bool, optional) –

  • offset (number, optional) –

  • unobserved_intervals_list (array-like, optional) –

  • progress_bar (FloatProgress, optional) –

  • figsize (tuple, optional) –

  • fontsize (int, optional) –

nwbwidgets.misc.plot_unobserved_intervals(unobserved_intervals_list, ax, offset=0, color=(0.85, 0.85, 0.85))[source]
nwbwidgets.misc.show_psth_raster(data, start=-0.5, end=2.0, group_inds=None, labels=None, ax=None, show_legend=True, align_line_color=(0.7, 0.7, 0.7), progress_bar: Optional[FloatProgress] = None, fontsize=12) Axes[source]
Parameters
  • data (array-like) –

  • start (float) – Start time for calculation before or after (negative or positive) the reference point (aligned to).

  • end (float) – End time for calculation before or after (negative or positive) the reference point (aligned to).

  • group_inds (array-like, optional) –

  • labels (array-like, optional) –

  • ax (plt.Axes, optional) –

  • show_legend (bool, optional) –

  • align_line_color (array-like, optional) – [R, G, B] (0-1) Default = [0.7, 0.7, 0.7]

  • progress_bar (FloatProgress, optional) –

  • fontsize (int, optional) –

Return type

plt.Axes

nwbwidgets.misc.raster_grid(units: Units, time_intervals: TimeIntervals, index, start, end, rows_label=None, cols_label=None, trials_select=None, align_by='start_time') Figure[source]
Parameters
  • units (pynwb.misc.Units) –

  • time_intervals (pynwb.epoch.TimeIntervals) –

  • index (int) –

  • start (float) – Start time for calculation before or after (negative or positive) the reference point (aligned to).

  • end (float) – End time for calculation before or after (negative or positive) the reference point (aligned to).

  • rows_label (str, optional) –

  • cols_label (str, optional) –

  • trials_select (np.array(dtype=bool), optional) –

  • align_by (str, optional) –

Return type

plt.Figure

nwbwidgets.misc.plot_grouped_events_plotly(data, window=None, group_inds=None, colors=['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf'], labels=None, show_legend=True, unobserved_intervals_list=None, progress_bar=None, fig=None, **kwargs)[source]
class nwbwidgets.misc.RasterWidgetPlotly(**kwargs: Any)[source]

Bases: HBox

Public constructor

toggle_legend(change)[source]
update_fig(change)[source]
nwbwidgets.misc.show_session_raster_plotly(units: Units, fig, time_window=None, order=None, progress_bar=None, **kwargs)[source]
Parameters
  • units (pynwb.misc.Units) –

  • time_window ([int, int]) –

  • show_obs_intervals (bool) –

  • order (array-like, optional) –

  • group_inds (array-like, optional) –

  • labels (array-like, optional) –

  • show_legend (bool) – default = True Does not show legend if color_by is None or ‘id’.

  • progress_bar (FloatProgress, optional) –

Return type

go.FigureWidget

class nwbwidgets.misc.UnitsAndTrialsControllerWidget(**kwargs: Any)[source]

Bases: VBox

Creates a UnitsAndTrials controller that controls InnerWidget.

Parameters
  • units (pynwb.misc.Units object) –

  • trials (pynwb.epoch.TimeIntervals object) –

  • unit_index (int) –

InnerWidget = None
get_trials()[source]
get_groups(trials)[source]
rows_callback(change)[source]

Gets triggered when self.rows_controller changes. Updates other dropdown options.

class nwbwidgets.misc.RasterGridWidget(**kwargs: Any)[source]

Bases: VBox

Public constructor

class nwbwidgets.misc.TuningCurveWidget(**kwargs: Any)[source]

Bases: VBox

Public constructor

class nwbwidgets.misc.TuningCurveExtendedWidget(**kwargs: Any)[source]

Bases: VBox

Public constructor

nwbwidgets.misc.draw_tuning_curve(units: Units, time_intervals: TimeIntervals, index, start, end, rows_label=None, cols_label=None, align_by='start_time') Figure[source]
nwbwidgets.misc.draw_tuning_curve_1d(units: Units, time_intervals: TimeIntervals, index, start, end, rows_label=None, align_by='start_time') Figure[source]
nwbwidgets.misc.draw_tuning_curve_2d(units: Units, time_intervals: TimeIntervals, index, start, end, rows_label=None, cols_label=None, align_by='start_time') Figure[source]
nwbwidgets.misc.sort_mixed_type_list(x)[source]

Returns the indexes for a sorted list of mixed types

nwbwidgets.ophys module

class nwbwidgets.ophys.TwoPhotonSeriesWidget(**kwargs: Any)[source]

Bases: VBox

Widget showing Image stack recorded over time from 2-photon microscope.

Public constructor

nwbwidgets.ophys.show_df_over_f(df_over_f: DfOverF, neurodata_vis_spec: dict)[source]
nwbwidgets.ophys.show_image_segmentation(img_seg: ImageSegmentation, neurodata_vis_spec: dict)[source]
nwbwidgets.ophys.show_plane_segmentation_3d_voxel(plane_seg: PlaneSegmentation)[source]
nwbwidgets.ophys.show_plane_segmentation_3d_mask(plane_seg: PlaneSegmentation)[source]
class nwbwidgets.ophys.PlaneSegmentation2DWidget(**kwargs: Any)[source]

Bases: VBox

Public constructor

on_button_click(b)[source]
update_fig(color_by)[source]
show_plane_segmentation_2d(color_wheel: list = ['red', 'blue', 'green', 'black', 'magenta', 'yellow'], color_by: Optional[str] = None, threshold: float = 0.01, fig: Optional[Figure] = None, width: int = 600, ref_image=None)[source]
Parameters
  • plane_seg (PlaneSegmentation) –

  • color_wheel (list, optional) –

  • color_by (str, optional) –

  • threshold (float, optional) –

  • fig (plotly.graph_objects.Figure, optional) –

  • width (int, optional) – width of image in pixels. Height is automatically determined to be proportional

  • ref_image (image, optional) –

compute_outline(i, threshold)[source]
nwbwidgets.ophys.route_plane_segmentation(plane_seg: PlaneSegmentation, neurodata_vis_spec: dict)[source]
nwbwidgets.ophys.show_grayscale_volume(vol: GrayscaleVolume, neurodata_vis_spec: dict)[source]
class nwbwidgets.ophys.RoiResponseSeriesWidget(**kwargs: Any)[source]

Bases: BaseGroupedTraceWidget

Parameters
  • time_series (TimeSeries) –

  • dynamic_table_region_name (str, optional) –

  • foreign_time_window_controller (StartAndDurationController, optional) –

  • foreign_group_and_sort_controller (GroupAndSortController, optional) –

  • mpl_plotter (function) – Choose function to use when creating figures

  • kwargs

nwbwidgets.panel module

class nwbwidgets.panel.Panel(**kwargs: Any)[source]

Bases: VBox

NWB widgets Panel for visualization of NWB files.

Parameters
  • stream_mode (str, optional) – Either “fsspec” or “ros3”. Defaults to “fsspec”.

  • cache_path (str, optional) – The path to cached data if streaming with “fsspec”. If left as None, a directory “nwb-cache” is created under the current working directory. Defaults to None.

  • enable_dandi_source (bool, optional) – Enable DANDI source option. Defaults to True.

  • enable_s3_source (bool, optional) – Enable S3 source option. Defaults to True.

  • enable_local_source (bool, optional) – Enable local source option. Defaults to True.

updated_source(args=None)[source]

Update Panel components depending on chosen source.

create_components_dandi_source(args=None)[source]

Create widgets components for DANDI option

create_components_s3_source()[source]

Create widgets components for S3 option

create_components_local_dir_source()[source]

Create widgets components for Loca dir option

create_components_local_file_source()[source]

Create widgets components for Local file option

list_dandiset_files_dropdown(args=None)[source]

Populate dropdown with all files and text area with summary

list_local_dir_files(args=None)[source]

List NWB files in local dir

stream_dandiset_file(args=None)[source]

Stream NWB file from DANDI

stream_s3_file(args=None)[source]

Stream NWB file from S3 url

load_local_dir_file(args=None)[source]

Load local NWB file

load_local_file(args=None)[source]

Load local NWB file

nwbwidgets.spectrum module

nwbwidgets.spectrum.show_spectrum(node: Spectrum, **kwargs) Widget[source]
nwbwidgets.spectrum.plot_spectrum_figure(spectrum, channel_nos, frequency_nos)[source]

Plot power vs frequencies and/or phase vs frequencies. :param spectrum: :type spectrum: Spectrum :param channel_nos: Input from the channel range slider widget: (channel_no start, channel_no end) :type channel_nos: tuple :param frequency_nos: Input from frequency range slider widget: (freq start, freq end) :type frequency_nos: tuple

nwbwidgets.spectrum.check_spectrum(node)[source]

nwbwidgets.timeseries module

nwbwidgets.timeseries.show_ts_fields(node)[source]
nwbwidgets.timeseries.show_timeseries_mpl(time_series: TimeSeries, time_window=None, ax=None, zero_start=False, xlabel=None, ylabel=None, title=None, figsize=None, **kwargs)[source]
Parameters
  • time_series (TimeSeries) –

  • time_window ([int int]) –

  • ax (plt.Axes) –

  • zero_start (bool) –

  • xlabel (str) –

  • ylabel (str) –

  • title (str) –

  • figsize (tuple, optional) –

  • kwargs

nwbwidgets.timeseries.show_indexed_timeseries_mpl(node: TimeSeries, istart=0, istop=None, ax=None, zero_start=False, xlabel='time (s)', ylabel=None, title=None, figsize=None, neurodata_vis_spec=None, **kwargs)[source]
nwbwidgets.timeseries.show_indexed_timeseries_plotly(timeseries: TimeSeries, istart: int = 0, istop: Optional[int] = None, time_window: Optional[list] = None, trace_range: Optional[list] = None, offsets=None, fig: Optional[FigureWidget] = None, col=None, row=None, zero_start=False, scatter_kwargs: Optional[dict] = None, figure_kwargs: Optional[dict] = None)[source]
nwbwidgets.timeseries.plot_traces(timeseries: TimeSeries, time_window=None, trace_window=None, title: Optional[str] = None, ylabel: str = 'traces', **kwargs)[source]
Parameters
  • timeseries (TimeSeries) –

  • time_window ([float, float], optional) – Start time and end time in seconds.

  • trace_window ([int int], optional) – Index range of traces to view

  • title (str, optional) –

  • ylabel (str, optional) –

nwbwidgets.timeseries.show_timeseries(node, **kwargs)[source]
class nwbwidgets.timeseries.AbstractTraceWidget(**kwargs: Any)[source]

Bases: VBox

Public constructor

abstract set_out_fig()[source]
set_controls(**kwargs)[source]
set_children()[source]
class nwbwidgets.timeseries.SingleTracePlotlyWidget(**kwargs: Any)[source]

Bases: AbstractTraceWidget

Public constructor

set_out_fig()[source]
class nwbwidgets.timeseries.SeparateTracesPlotlyWidget(**kwargs: Any)[source]

Bases: AbstractTraceWidget

Public constructor

set_out_fig()[source]
nwbwidgets.timeseries.plot_grouped_traces(time_series: TimeSeries, time_window=None, order=None, ax=None, figsize=(8, 7), group_inds=None, labels=None, colors=['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf'], show_legend=True, dynamic_table_region_name=None, window=None, **kwargs)[source]
nwbwidgets.timeseries.plot_grouped_traces_plotly(time_series: TimeSeries, time_window, order, group_inds=None, labels=None, colors=['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf'], fig=None, **kwargs)[source]
class nwbwidgets.timeseries.BaseGroupedTraceWidget(**kwargs: Any)[source]

Bases: HBox

Parameters
  • time_series (TimeSeries) –

  • dynamic_table_region_name (str, optional) –

  • foreign_time_window_controller (StartAndDurationController, optional) –

  • foreign_group_and_sort_controller (GroupAndSortController, optional) –

  • mpl_plotter (function) – Choose function to use when creating figures

  • kwargs

class nwbwidgets.timeseries.MultiTimeSeriesWidget(**kwargs: Any)[source]

Bases: VBox

Parameters
  • time_series_list (list of TimeSeries) –

  • widget_class_list (list of classes, optional) –

  • constrain_time_range (bool, optional) – Default is False

class nwbwidgets.timeseries.AlignMultiTraceTimeSeriesByTrialsAbstract(**kwargs: Any)[source]

Bases: VBox

Public constructor

get_trials()[source]
make_group_and_sort(window=None, control_order=False, control_limit=False)[source]
plot_group(group_inds, data_trialized, time_trialized, fig, order)[source]
class nwbwidgets.timeseries.AlignMultiTraceTimeSeriesByTrialsConstant(**kwargs: Any)[source]

Bases: AlignMultiTraceTimeSeriesByTrialsAbstract

Public constructor

align_data(start_label, before, after, index=None)[source]
update(index: int, start_label: str = 'start_time', before: float = 0.0, after: float = 1.0, order=None, group_inds=None, labels=None, align_to_zero=False, sem=False, fig: Optional[FigureWidget] = None)[source]
class nwbwidgets.timeseries.AlignMultiTraceTimeSeriesByTrialsVariable(**kwargs: Any)[source]

Bases: AlignMultiTraceTimeSeriesByTrialsAbstract

Public constructor

align_data(start_label, before, after, index=None)[source]
update(index: int, start_label: str = 'start_time', before: float = 0.0, after: float = 1.0, order=None, group_inds=None, labels=None, align_to_zero=False, fig: Optional[FigureWidget] = None)[source]

nwbwidgets.version module

nwbwidgets.view module

nwbwidgets.view.show_dynamic_table(node, **kwargs) Widget[source]
nwbwidgets.view.nwb2widget(node, neurodata_vis_spec={<class 'pynwb.file.NWBFile'>: <function show_nwbfile>, <class 'ndx_icephys_meta.icephys.SweepSequences'>: <function show_sweep_sequences>, <class 'pynwb.behavior.BehavioralEvents'>: <function show_behavioral_events>, <class 'pynwb.misc.Units'>: OrderedDict([('Summary', <class 'nwbwidgets.dynamictablesummary.DynamicTableSummaryWidget'>), ('Session Raster', <class 'nwbwidgets.misc.RasterWidget'>), ('Grouped PSTH', <class 'nwbwidgets.misc.PSTHWidget'>), ('Raster Grid', <class 'nwbwidgets.misc.RasterGridWidget'>), ('Tuning Curves', <class 'nwbwidgets.misc.TuningCurveWidget'>), ('Combined', <class 'nwbwidgets.misc.TuningCurveExtendedWidget'>), ('table', <function show_dynamic_table>)]), <class 'pynwb.misc.DecompositionSeries'>: <function show_decomposition_series>, <class 'pynwb.file.Subject'>: <function show_fields>, <class 'pynwb.ecephys.SpikeEventSeries'>: <function show_spike_event_series>, <class 'pynwb.ophys.ImageSegmentation'>: <function show_image_segmentation>, <class 'pynwb.ophys.TwoPhotonSeries'>: <class 'nwbwidgets.ophys.TwoPhotonSeriesWidget'>, <class 'abc.GrayscaleVolume'>: <function show_grayscale_volume>, <class 'pynwb.ophys.PlaneSegmentation'>: <function route_plane_segmentation>, <class 'pynwb.ophys.DfOverF'>: <function show_df_over_f>, <class 'pynwb.ophys.RoiResponseSeries'>: <class 'nwbwidgets.ophys.RoiResponseSeriesWidget'>, <class 'pynwb.misc.AnnotationSeries'>: OrderedDict([('text', <function show_text_fields>), ('times', <function show_annotations>)]), <class 'hdmf.utils.LabelledDict'>: <function dict2accordion>, <class 'pynwb.base.ProcessingModule'>: <function processing_module>, <class 'hdmf.common.table.DynamicTable'>: {'Summary': <class 'nwbwidgets.dynamictablesummary.DynamicTableSummaryWidget'>, 'table': <function show_dynamic_table>}, <class 'pynwb.ecephys.ElectricalSeries'>: <class 'nwbwidgets.ecephys.ElectricalSeriesWidget'>, <class 'pynwb.behavior.SpatialSeries'>: <function route_spatial_series>, <class 'pynwb.image.GrayscaleImage'>: <function show_grayscale_image>, <class 'pynwb.image.RGBImage'>: <function show_rbga_image>, <class 'pynwb.image.RGBAImage'>: <function show_rbga_image>, <class 'pynwb.base.Image'>: <function show_rbga_image>, <class 'pynwb.image.ImageSeries'>: <class 'nwbwidgets.image.ImageSeriesWidget'>, <class 'pynwb.image.IndexSeries'>: <function show_index_series>, <class 'pynwb.base.TimeSeries'>: <function show_timeseries>, <class 'pynwb.core.MultiContainerInterface'>: <function show_multi_container_interface>, <class 'pynwb.core.NWBContainer'>: <function show_neurodata_base>, <class 'pynwb.core.NWBDataInterface'>: <function show_neurodata_base>, <class 'h5py._hl.dataset.Dataset'>: <function show_dset>, <class 'zarr.core.Array'>: <function show_dset>, <class 'abc.Spectrum'>: <function show_spectrum>, <class 'pynwb.icephys.SequentialRecordingsTable'>: {'Summary': <class 'nwbwidgets.dynamictablesummary.DynamicTableSummaryWidget'>, 'table': <function show_dynamic_table>, 'I-V Analysis': <class 'nwbwidgets.icephys.IVCurveWidget'>}})[source]

Module contents