Exemplo n.º 1
0
    def launch(self, view_model):
        # type: (DualBrainViewerModel) -> dict

        time_series_index = self.load_entity_by_gid(view_model.time_series)
        self.surface_index = None
        shell_surface_index = None

        if view_model.projection_surface:
            self.surface_index = self.load_entity_by_gid(view_model.projection_surface)

        if view_model.shell_surface:
            shell_surface_index = self.load_entity_by_gid(view_model.shell_surface)

        if isinstance(time_series_index, TimeSeriesSEEGIndex):
            shell_surface_index = ensure_shell_surface(self.current_project_id, shell_surface_index, CORTICAL)

        params = BrainViewer.compute_parameters(self, time_series_index, shell_surface_index)
        eeg_monitor = EegMonitor()
        eeg_monitor.storage_path = self.storage_path
        params.update(eeg_monitor.compute_parameters(time_series_index, is_extended_view=True))

        params['isOneToOneMapping'] = False
        params['brainViewerTemplate'] = 'view.html'

        if isinstance(time_series_index, TimeSeriesSEEGIndex):
            params['brainViewerTemplate'] = "internal_view.html"
            # Mark as None since we only display shell face and no point to load these as well
            params['urlVertices'] = None
            params['isSEEG'] = True

        return self.build_display_result("brain/extendedview", params,
                                         pages=dict(controlPage="brain/extendedcontrols",
                                                    channelsPage="commons/channel_selector.html"))
Exemplo n.º 2
0
    def launch(self, time_series, projection_surface=None, shell_surface=None):

        self.surface_index = projection_surface

        if isinstance(time_series,
                      TimeSeriesSEEGIndex) and shell_surface is None:
            shell_surface = dao.try_load_last_surface_of_type(
                self.current_project_id, CORTICAL)

        params = BrainViewer.compute_parameters(self, time_series,
                                                shell_surface)
        eeg_monitor = EegMonitor()
        eeg_monitor.storage_path = self.storage_path
        params.update(
            eeg_monitor.compute_parameters(time_series, is_extended_view=True))

        params['isOneToOneMapping'] = False
        params['brainViewerTemplate'] = 'view.html'

        if isinstance(time_series, TimeSeriesSEEGIndex):
            params['brainViewerTemplate'] = "internal_view.html"
            # Mark as None since we only display shelf face and no point to load these as well
            params['urlVertices'] = None
            params['isSEEG'] = True

        return self.build_display_result(
            "brain/extendedview",
            params,
            pages=dict(controlPage="brain/extendedcontrols",
                       channelsPage="commons/channel_selector.html"))