How to use the nwbwidgets.view function in nwbwidgets

To help you get started, we’ve selected a few nwbwidgets examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NeurodataWithoutBorders / nwb-jupyter-widgets / nwbwidgets / base.py View on Github external
pub_list = []
            for pub in value:
                pub_list.append(widgets.HTML(value="<a href="http://dx.doi.org/&quot;+pub[4:]+&quot;">"+pub+"</a>"))
            lbl_key = widgets.Label(key+':', layout=field_lay)
            pub_list.insert(0, lbl_key)
            info.append(widgets.HBox(children=pub_list))
        elif key == 'experimenter':
            lbl_experimenter = widgets.Label('Experimenter:', layout=field_lay)
            if isinstance(value, (list, tuple)):
                lbl_names = widgets.Label(', '.join(value), layout=field_lay)
            else:
                lbl_names = widgets.Label(value, layout=field_lay)
            hbox_exp = widgets.HBox(children=[lbl_experimenter, lbl_names])
            info.append(hbox_exp)
        elif (isinstance(value, Iterable) and len(value)) or value:
            neuro_data.append(view.nwb2widget(value, neurodata_vis_spec=neurodata_vis_spec))
            labels.append(key)
    accordion = widgets.Accordion(children=neuro_data, selected_index=None)
    for i, label in enumerate(labels):
        if hasattr(node.fields[label], 'description') and node.fields[label].description:
            accordion.set_title(i, label + ': ' + node.fields[label].description)
        else:
            accordion.set_title(i, label)
    return widgets.VBox(info + [accordion])
github NeurodataWithoutBorders / nwb-jupyter-widgets / nwbwidgets / behavior.py View on Github external
def show_position(node: Position, neurodata_vis_spec: dict):

    if len(node.spatial_series.keys()) == 1:
        for value in node.spatial_series.values():
            return view.nwb2widget(value, neurodata_vis_spec=neurodata_vis_spec)
    else:
        return view.nwb2widget(node.spatial_series, neurodata_vis_spec=neurodata_vis_spec)
github NeurodataWithoutBorders / nwb-jupyter-widgets / nwbwidgets / file.py View on Github external
lbl_names = widgets.Label(', '.join(value), layout=field_lay)
                elif isinstance(value[0], bytes):
                    lbl_names = widgets.Label(b', '.join(value).decode(), layout=field_lay)
                else:
                    raise ValueError('unrecognized type for experimenter')
            else:
                lbl_names = widgets.Label(value, layout=field_lay)
            hbox_exp = widgets.HBox(children=[lbl_experimenter, lbl_names])
            info.append(hbox_exp)
        elif (isinstance(value, Iterable) and len(value)) or value:
            neuro_data.append(value)
            if hasattr(nwbfile.fields[key], 'description') and nwbfile.fields[key].description:
                labels.append(key + ': ' + nwbfile.fields[key].description)
            else:
                labels.append(key)
    func_ = partial(view.nwb2widget, neurodata_vis_spec=neurodata_vis_spec)
    accordion = lazy_show_over_data(neuro_data, func_, labels=labels, style=widgets.Accordion)

    return widgets.VBox(info + [accordion])
github NeurodataWithoutBorders / nwb-jupyter-widgets / nwbwidgets / behavior.py View on Github external
def show_position(node: Position, neurodata_vis_spec: dict):

    if len(node.spatial_series.keys()) == 1:
        for value in node.spatial_series.values():
            return view.nwb2widget(value, neurodata_vis_spec=neurodata_vis_spec)
    else:
        return view.nwb2widget(node.spatial_series, neurodata_vis_spec=neurodata_vis_spec)