コード例 #1
0
 def test_single_trace_widget(self):
     single_wd = SeparateTracesPlotlyWidget(timeseries=self.ts_multi)
     tt = get_timeseries_tt(self.ts_multi)
     single_wd.controls["time_window"].value = [
         tt[int(len(tt) * 0.2)],
         tt[int(len(tt) * 0.4)],
     ]
コード例 #2
0
 def test_show_spatial_series_over_time(self):
     SeparateTracesPlotlyWidget(self.spatial_series)
コード例 #3
0
 def test_show_spatial_series_over_time_threeD(self):
     widget = SeparateTracesPlotlyWidget(self.spatial_series)
     widget.controls["time_window"].value = [2.0 / 50, 10.0 / 50]
コード例 #4
0
    def tab_stream(self, nwb_file):
        position_keys = list(nwb_file.processing["behavior"].
                             data_interfaces["Position"].spatial_series.keys())
        spatial_series = nwb_file.processing["behavior"].data_interfaces[
            "Position"][position_keys[0]]
        tt = get_timeseries_tt(spatial_series,
                               istart=spatial_series.starting_time)
        time_trace_window_controller = StartAndDurationController(tmax=tt[-1],
                                                                  tmin=tt[0],
                                                                  start=0,
                                                                  duration=5)
        reach_arm = (nwb_file.processing["behavior"].
                     data_interfaces["ReachEvents"].description)
        reach_arm = map(lambda x: x.capitalize(), reach_arm.split("_"))
        reach_arm = list(reach_arm)
        reach_arm = "_".join(reach_arm)

        jointpos_widget = SeparateTracesPlotlyWidget(
            nwb_file.processing["behavior"].data_interfaces["Position"]
            [reach_arm],
            foreign_time_window_controller=time_trace_window_controller,
        )
        text = "(b) Movement segments"
        jointpos_label = widgets.HTML(value=f"<b><font size=4>{text}</b>")
        jointpos = widgets.VBox([jointpos_label, jointpos_widget],
                                layout=self.box_layout)

        skeleton_widget = SkeletonPlot(
            nwb_file.processing["behavior"].data_interfaces["Position"],
            foreign_time_window_controller=time_trace_window_controller,
        )
        text = "(a) Tracked joints"
        skeleton_label = widgets.HTML(value=f"<b><font size=4>{text}</b>")
        skeleton = widgets.VBox([skeleton_label, skeleton_widget],
                                layout=self.box_layout)

        ecog_widget = ElectricalSeriesWidget(
            nwb_file.acquisition["ElectricalSeries"],
            foreign_time_window_controller=time_trace_window_controller,
        )
        text = "(d) Raw ECoG"
        ecog_label = widgets.HTML(value=f"<b><font size=4>{text}</b>")
        ecog = widgets.VBox([ecog_label, ecog_widget], layout=self.box_layout)

        brain_widget = HumanElectrodesPlotlyWidget(nwb_file.electrodes)
        text = "(c) Subject electrode locations"
        brain_label = widgets.HTML(value=f"<b><font size=4>{text}</b>")
        brain = widgets.VBox([brain_label, brain_widget],
                             layout=self.box_layout)

        tab1_hbox_header = widgets.HBox([time_trace_window_controller])
        tab1_row1_widgets = widgets.HBox(
            [skeleton, jointpos],
            layout=self.row_layout,
        )
        tab1_row2_widgets = widgets.HBox(
            [brain, ecog],
            layout=self.row_layout,
        )
        tab1 = widgets.VBox(
            [tab1_hbox_header, tab1_row1_widgets, tab1_row2_widgets])
        return tab1