Exemple #1
0
    def init_ui(self):
        self.add_menu()
        # lets make a menu entry in the sidebar
        self.menu.label = 'View and edit annotations'
        self.menu.append(
            ui.Info_Text(
                "Annotations recorded with capture are displayed when this plugin is loaded. New annotations can be added with the interface below."
            ))
        self.menu.append(
            ui.Info_Text(
                "If you want to revert annotations to the recorded state, stop player, delete the annotations file in the recording and reopen player."
            ))

        self.menu.append(ui.Text_Input('new_annotation_name', self))
        self.menu.append(ui.Text_Input('new_annotation_hotkey', self))
        self.menu.append(ui.Button('add annotation type', self.add_annotation))
        self.sub_menu = ui.Growing_Menu('Events - click to remove')
        self.menu.append(self.sub_menu)
        self.update_buttons()
Exemple #2
0
    def init_ui(self):
        self.add_menu()
        self.menu.label = 'Batch Export Recordings'

        self.menu.append(ui.Info_Text('Search will walk through the source directory recursively and detect available Pupil recordings.'))
        self.menu.append(ui.Text_Input('source_dir', self, label='Source directory', setter=self.set_src_dir))

        self.search_button = ui.Button('Search', self.detect_recordings)
        self.menu.append(self.search_button)

        self.avail_recs_menu = ui.Growing_Menu('Available Recordings')
        self._update_avail_recs_menu()
        self.menu.append(self.avail_recs_menu)

        self.menu.append(ui.Text_Input('destination_dir', self, label='Destination directory', setter=self.set_dest_dir))
        self.menu.append(ui.Button('Export selected', self.queue_selected))
        self.menu.append(ui.Button('Clear search results', self._clear_avail))
        self.menu.append(ui.Separator())
        self.menu.append(ui.Button('Cancel all exports', self.cancel_all))
Exemple #3
0
    def update_menu(self):

        del self.menu.elements[:]

        def close():
            self.alive = False

        def set_iface(use_primary_interface):
            self.use_primary_interface = use_primary_interface
            self.update_menu()

        if self.use_primary_interface:
            def set_port(new_port):
                new_address = '*:'+new_port
                self.start_server(new_address)
                self.update_menu()

            try:
                ip = socket.gethostbyname(socket.gethostname())
            except:
                ip = 'Your external ip'

        else:
            def set_address(new_address):
                if new_address.count(":") != 1:
                    logger.error("address format not correct")
                    return
                self.start_server(new_address)
                self.update_menu()



        help_str = 'Pupil Remote using ZeroMQ REQ REP scheme.'
        self.menu.append(ui.Button('Close',close))
        self.menu.append(ui.Info_Text(help_str))
        self.menu.append(ui.Switch('use_primary_interface',self,setter=set_iface,label="Use primary network interface"))
        if self.use_primary_interface:
            self.menu.append(ui.Text_Input('port',self,setter=set_port,label='Port'))
            self.menu.append(ui.Info_Text('Connect localy:   "tcp://%s:%s" ' %('127.0.0.1',self.port)))
            self.menu.append(ui.Info_Text('Connect remotely: "tcp://%s:%s" '%(ip,self.port)))
        else:
            self.menu.append(ui.Text_Input('host',setter=set_address,getter=lambda : self.host+':'+self.port, label='Address'))
            self.menu.append(ui.Info_Text('Bound to: "tcp://%s:%s" ' %(self.host,self.port)))
Exemple #4
0
 def append_preferred_session_name_setter(self):
     self.menu.append(
         ui.Text_Input("preferred_session_name",
                       self,
                       label="Preferred session name"))
     self.menu.append(
         ui.Button(
             "Broadcast preferred session name",
             self.broadcast_preferred_session_name,
         ))
Exemple #5
0
    def init_ui(self):
        self.add_menu()
        self.menu.label = 'File Source: {}'.format(
            os.path.split(self.source_path)[-1])
        from pyglui import ui

        self.menu.append(
            ui.Info_Text(
                'The file source plugin loads and displays video from a given file.'
            ))

        if self.g_pool.app == 'capture':

            def toggle_looping(val):
                self.loop = val
                if val:
                    self.play = True

            self.menu.append(ui.Switch('loop', self, setter=toggle_looping))

        self.menu.append(
            ui.Text_Input('source_path',
                          self,
                          label='Full path',
                          setter=lambda x: None))

        self.menu.append(
            ui.Text_Input('frame_size',
                          label='Frame size',
                          setter=lambda x: None,
                          getter=lambda: '{} x {}'.format(*self.frame_size)))

        self.menu.append(
            ui.Text_Input('frame_rate',
                          label='Frame rate',
                          setter=lambda x: None,
                          getter=lambda: '{:.0f} FPS'.format(self.frame_rate)))

        self.menu.append(
            ui.Text_Input('frame_num',
                          label='Number of frames',
                          setter=lambda x: None,
                          getter=lambda: self.get_frame_count()))
Exemple #6
0
    def init_ui(self):
        self.add_menu()
        self.menu.label = 'Recorder'
        self.menu_icon.order = 0.29

        self.menu.append(ui.Info_Text('Pupil recordings are saved like this: "path_to_recordings/recording_session_name/nnn" where "nnn" is an increasing number to avoid overwrites. You can use "/" in your session name to create subdirectories.'))
        self.menu.append(ui.Info_Text('Recordings are saved to "~/pupil_recordings". You can change the path here but note that invalid input will be ignored.'))
        self.menu.append(ui.Text_Input('rec_dir', self, setter=self.set_rec_dir, label='Path to recordings'))
        self.menu.append(ui.Text_Input('session_name', self, setter=self.set_session_name, label='Recording session name'))
        self.menu.append(ui.Switch('show_info_menu', self, on_val=True, off_val=False, label='Request additional user info'))
        self.menu.append(ui.Selector('raw_jpeg', self, selection=[True, False], labels=["bigger file, less CPU", "smaller file, more CPU"], label='Compression'))
        self.menu.append(ui.Info_Text('Recording the raw eye video is optional. We use it for debugging.'))
        self.menu.append(ui.Switch('record_eye', self, on_val=True, off_val=False, label='Record eye'))
        self.button = ui.Thumb('running', self, setter=self.toggle, label='R', hotkey='r')
        self.button.on_color[:] = (1, .0, .0, .8)
        self.g_pool.quickbar.insert(2, self.button)

        self.low_disk_space_thumb = ui.Thumb('low_disk_warn', label='!', getter=lambda: True, setter=lambda x: None)
        self.low_disk_space_thumb.on_color[:] = (1, .0, .0, .8)
        self.low_disk_space_thumb.status_text = 'Low disk space'
Exemple #7
0
 def init_gui(self):
     help_str = 'Pupil Remote using REQ RREP schemme'
     self.menu = ui.Growing_Menu('Pupil Remote')
     self.menu.append(ui.Info_Text(help_str))
     self.menu.append(
         ui.Text_Input('address',
                       self,
                       setter=self.set_server,
                       label='Address'))
     self.menu.append(ui.Button('Close', self.close))
     self.g_pool.sidebar.append(self.menu)
Exemple #8
0
 def init_gui(self):
     help_str = "Synchonize behaviour of Pupil captures across the local network."
     self.menu = ui.Growing_Menu('Pupil Sync')
     self.menu.append(ui.Button('Close', self.close))
     self.menu.append(ui.Info_Text(help_str))
     self.menu.append(
         ui.Text_Input('name', self, setter=self.set_name, label='Name'))
     self.menu.append(
         ui.Text_Input('group', self, setter=self.set_group, label='Group'))
     help_str = "All pupil nodes of one group share a Master clock."
     self.menu.append(ui.Info_Text(help_str))
     self.menu.append(
         ui.Text_Input('sync status',
                       getter=self.sync_status_info,
                       setter=lambda _: _))
     # self.menu[-1].read_only = True
     self.group_menu = ui.Growing_Menu('Other Pupils')
     self.menu.append(self.group_menu)
     self.g_pool.sidebar.append(self.menu)
     self.update_gui()
Exemple #9
0
    def init_gui(self):
        if self.g_pool.app == 'capture':
            self.menu = ui.Growing_Menu("Pupil Broadcast Server")
            self.g_pool.sidebar.append(self.menu)
        elif self.g_pool.app == 'player':
            self.menu = ui.Scrolling_Menu("Pupil Broadcast Server")
            self.g_pool.gui.append(self.menu)

        self.menu.append(ui.Button('Close',self.close))
        help_str = "Pupil Message server: Using ZMQ and the *Publish-Subscribe* scheme"
        self.menu.append(ui.Info_Text(help_str))
        self.menu.append(ui.Text_Input('address',self,setter=self.set_server,label='Address'))
Exemple #10
0
    def init_ui(self):
        super().init_ui()
        self.menu.label = "Offline Pupil Detector"
        self.menu.append(ui.Info_Text('Detects pupil positions from the recording\'s eye videos.'))
        self.menu.append(ui.Selector('detection_method', self, label='Detection Method',
                                     selection=['2d', '3d'], setter=self.set_detection_mapping_mode))
        self.menu.append(ui.Switch('detection_paused', self, label='Pause detection'))
        self.menu.append(ui.Button('Redetect', self.redetect))
        self.menu.append(ui.Text_Input("0", label='eye0:', getter=lambda: self.detection_status[0], setter=lambda _: _))
        self.menu.append(ui.Text_Input("1", label='eye1:', getter=lambda: self.detection_status[1], setter=lambda _: _))

        def detection_progress():
            total = sum(self.eye_frame_num)
            return 100 * len(self.pupil_positions) / total if total else 0.

        progress_slider = ui.Slider('detection_progress',
                                    label='Detection Progress',
                                    getter=detection_progress,
                                    setter=lambda _: _)
        progress_slider.display_format = '%3.0f%%'
        self.menu.append(progress_slider)
Exemple #11
0
    def init_gui(self):
        self.menu = ui.Scrolling_Menu('Raw Data Exporter')
        self.g_pool.gui.append(self.menu)

        def close():
            self.alive = False

        self.menu.append(ui.Button('Close',close))
        self.menu.append(ui.Info_Text('Export Raw Pupil Capture data into .csv files.'))
        self.menu.append(ui.Info_Text('Select your export frame range using the trim marks in the seek bar. This will affect all exporting plugins.'))
        self.menu.append(ui.Info_Text('Select your export frame range using the trim marks in the seek bar. This will affect all exporting plugins.'))
        self.menu.append(ui.Text_Input('in_mark',getter=self.g_pool.trim_marks.get_string,setter=self.g_pool.trim_marks.set_string,label='frame range to export'))
        self.menu.append(ui.Info_Text("Press the export button or type 'e' to start the export."))
Exemple #12
0
    def init_gui(self):
        #lets make a menu entry in the sidebar
        self.menu = ui.Scrolling_Menu('view add edit annotations')
        self.g_pool.gui.append(self.menu)

        #add a button to close the plugin
        self.menu.append(ui.Button('close',self.close))
        self.menu.append(ui.Text_Input('new_annotation_name',self))
        self.menu.append(ui.Text_Input('new_annotation_hotkey',self))
        self.menu.append(ui.Button('add annotation type',self.add_annotation))
        self.sub_menu = ui.Growing_Menu('Events - click to remove')
        self.menu.append(self.sub_menu)
        self.update_buttons()


        self.on_window_resize(glfwGetCurrentContext(),*glfwGetWindowSize(glfwGetCurrentContext()))

        self.glfont = fontstash.Context()
        self.glfont.add_font('opensans',get_opensans_font_path())
        self.glfont.set_size(24)
        #self.glfont.set_color_float((0.2,0.5,0.9,1.0))
        self.glfont.set_align_string(v_align='center',h_align='middle')
Exemple #13
0
    def update_menu(self):

        del self.menu.elements[:]

        def set_iface(use_primary_interface):
            self.use_primary_interface = use_primary_interface
            self.update_menu()

        if self.use_primary_interface:
            def set_port(new_port):
                new_address = ':'+new_port
                self.start_server(new_address)
                self.update_menu()

            try:
                ip = socket.gethostbyname(socket.gethostname())
            except Exception:
                ip = 'Your external ip'

        else:
            def set_address(new_address):
                if new_address.count(":") != 1:
                    logger.error("address format not correct")
                    return
                self.start_server(new_address)
                self.update_menu()

        help_str = 'The Hololens Relay is the bridge between Pupil Capture and the Hololens client. It uses UDP sockets to relay data.'
        self.menu.append(ui.Info_Text(help_str))
        self.menu.append(ui.Switch('use_primary_interface', self, setter=set_iface,
                                   label="Use primary network interface"))
        if self.use_primary_interface:
            self.menu.append(ui.Text_Input('port', self, setter=set_port, label='Port'))
            self.menu.append(ui.Info_Text('Connect locally:   "127.0.0.1:{}"'.format(self.port)))
            self.menu.append(ui.Info_Text('Connect remotely: "{}:{}"'.format(ip, self.port)))
        else:
            self.menu.append(ui.Text_Input('host', setter=set_address, label='Address',
                                           getter=lambda: '{}:{}'.format(self.host, self.port)))
            self.menu.append(ui.Info_Text('Bound to: "{}:{}"'.format(self.host, self.port)))
Exemple #14
0
    def init_gui(self):
        def close():
            self.alive = False

        help_str = 'Pupil Remote using ZeroMQ REQ REP scheme.'
        self.menu = ui.Growing_Menu('Pupil Remote')
        self.menu.append(ui.Button('Close', close))
        self.menu.append(ui.Info_Text(help_str))
        self.menu.append(
            ui.Text_Input('address',
                          self,
                          setter=self.start_server,
                          label='Address'))
        self.g_pool.sidebar.append(self.menu)
Exemple #15
0
    def init_ui(self):
        self.add_menu()
        self.menu.label = 'Remote Recorder'
        self.menu.append(ui.Info_Text('Starts a recording session on each connected Pupil Mobile source.'))
        self.menu.append(ui.Text_Input('session_name', self))
        self.menu_toggle = ui.Button('Start Recording', self.toggle_recording)
        # ↴: Unicode: U+21B4, UTF-8: E2 86 B4
        self.quickbar_toggle = ui.Thumb('running', self, setter=self.toggle_recording,
                                        label=chr(0xe04b), label_font='pupil_icons',
                                        label_offset_size=-30, hotkey='e')
        self.quickbar_toggle.on_color[:] = (1, .0, .0, .8)

        self.menu.append(self.menu_toggle)
        self.g_pool.quickbar.append(self.quickbar_toggle)
Exemple #16
0
 def init_ui(self):
     super().init_ui()
     self.menu.label = "Offline Pupil Detector"
     self.menu.append(ui.Info_Text('Detects pupil positions from the recording\'s eye videos.'))
     self.menu.append(ui.Selector('detection_method', self, label='Detection Method',
                                  selection=['2d', '3d'], setter=self.set_detection_mapping_mode))
     self.menu.append(ui.Button('Redetect', self.redetect))
     self.menu.append(ui.Text_Input("0",label='eye0:',getter=lambda :self.detection_status[0],
                                 setter=lambda _: _))
     progress_slider = ui.Slider('0',
                                 label='Progress Eye 0',
                                 getter=lambda :self.detection_progress[0],
                                 setter=lambda _: _)
     progress_slider.display_format = '%3.0f%%'
     self.menu.append(progress_slider)
     self.menu.append(ui.Text_Input("1",label='eye1:',getter=lambda :self.detection_status[1],
                                 setter=lambda _: _))
     progress_slider = ui.Slider('1',
                                 label='Progress Eye 1',
                                 getter=lambda :self.detection_progress[1],
                                 setter=lambda _: _)
     progress_slider.display_format = '%3.0f%%'
     self.menu.append(progress_slider)
Exemple #17
0
    def _update_ui(self):
        del self.menu.elements[:]
        self.menu.append(
            ui.Info_Text(
                'Supply export video recording name. The export will be in the recording dir. If you give a path the export will end up there instead.'
            ))
        self.menu.append(ui.Text_Input('rec_name', self, label='Export name'))
        self.menu.append(
            ui.Info_Text(
                'Select your export frame range using the trim marks in the seek bar. This will affect all exporting plugins.'
            ))
        self.menu.append(
            ui.Text_Input(
                'trim_section',
                getter=self.g_pool.seek_control.get_trim_range_string,
                setter=self.g_pool.seek_control.set_trim_range_string,
                label='Frame range to export'))
        self.menu.append(
            ui.Info_Text(
                "Press the export button or type 'e' to start the export."))

        for job in self.exports[::-1]:
            submenu = ui.Growing_Menu(job.out_file_path)
            submenu.append(
                ui.Text_Input('status',
                              job,
                              label='Status',
                              setter=lambda x: None))
            progress_bar = ui.Slider('progress',
                                     job,
                                     min=0,
                                     max=job.frames_to_export,
                                     label='Progress')
            progress_bar.read_only = True
            submenu.append(progress_bar)
            submenu.append(ui.Button('Cancel', job.cancel))
            self.menu.append(submenu)
Exemple #18
0
    def update_gui_markers(self):
        def close():
            self.alive=False

        def set_min_marker_perimeter(val):
            self.min_marker_perimeter = val
            self.notify_all({'subject':'min_marker_perimeter_changed','delay':1})

        def set_invert_image(val):
            self.invert_image = val
            self.invalidate_marker_cache()
            self.invalidate_surface_caches()

        self.menu.elements[:] = []
        self.menu.append(ui.Button('Close',close))
        self.menu.append(ui.Switch('invert_image',self,setter=set_invert_image,label='Use inverted markers'))
        self.menu.append(ui.Slider('min_marker_perimeter',self,min=20,max=500,step=1,setter=set_min_marker_perimeter))
        self.menu.append(ui.Info_Text('The offline surface tracker will look for markers in the entire video. By default it uses surfaces defined in capture. You can change and add more surfaces here.'))
        self.menu.append(ui.Info_Text("Press the export button or type 'e' to start the export."))
        self.menu.append(ui.Selector('mode',self,label='Mode',selection=["Show Markers and Surfaces","Show marker IDs","Show Heatmaps","Show Metrics"] ))
        self.menu.append(ui.Info_Text('To see heatmap or surface metrics visualizations, click (re)-calculate gaze distributions. Set "X size" and "Y size" for each surface to see heatmap visualizations.'))
        self.menu.append(ui.Button("(Re)-calculate gaze distributions", self.recalculate))
        self.menu.append(ui.Button("Add surface", lambda:self.add_surface()))
        for s in self.surfaces:
            idx = self.surfaces.index(s)
            s_menu = ui.Growing_Menu("Surface {}".format(idx))
            s_menu.collapsed=True
            s_menu.append(ui.Text_Input('name',s))
            s_menu.append(ui.Text_Input('x',s.real_world_size,label='X size'))
            s_menu.append(ui.Text_Input('y',s.real_world_size,label='Y size'))
            s_menu.append(ui.Button('Open Debug Window',s.open_close_window))
            #closure to encapsulate idx
            def make_remove_s(i):
                return lambda: self.remove_surface(i)
            remove_s = make_remove_s(idx)
            s_menu.append(ui.Button('remove',remove_s))
            self.menu.append(s_menu)
Exemple #19
0
 def init_ui(self):
     try:
         # lets make a menu entry in the sidebar
         self.add_menu()
         # add a label to the menu
         self.menu.label = 'GCvlc Player'
         # add info text
         self.menu.append(ui.Info_Text('This Plugin creates a VLC Player instance that can be controlled by the User via Gaze. Look at the video to play it. The Player will pause automatically, if the User looks away. The four-marker surface spawned by this plugin has to be tracked using Pupil Labs\' surface tracker and the chosen name of this surface has to be typed into the surface name field.'))
         # add a text field to specify a video file
         self.menu.append(ui.Text_Input('video_file', self, setter=self.set_video_file, label='Video file:'))
         # add a text field to specify the surface
         self.menu.append(ui.Text_Input('surface_name', self, setter=self.set_surface_name, label='Surface name:'))
         # add slider to change marker size
         self.menu.append(ui.Slider('m_size',  self, 
                          label='Marker size [pixels]', 
                          min=1,  max=500, step=1))
         # add button to start the VLC player
         self.menu.append(ui.Button('Start GCvlc Player', self.start_gcvlc_player))
         #self.g_pool.sidebar.append(self.menu)
         
         # open new window for the VLC player
         self.open_window('GCVLC_MarkerScreen')
     except:
         logger.error("Unexpected error: {}".format(sys.exc_info()))
Exemple #20
0
 def init_ui(self):
     self.add_menu()
     # uniqueness = 'not_unique' -> Automatic `Close` button
     # -> Rename to `Cancel`
     export_name = os.path.split(self.out_file_path)[-1]
     self.menu.label = "Batch Export {}".format(export_name)
     self.menu[0].label = "Cancel"
     self.menu_icon.indicator_start = 0.0
     self.menu_icon.indicator_stop = 0.1
     self.menu_icon.tooltip = export_name
     self.menu.append(
         ui.Text_Input("rec_dir", self, label="Recording", setter=lambda x: None)
     )
     self.menu.append(
         ui.Text_Input("out_file_path", self, label="Output", setter=lambda x: None)
     )
     self.menu.append(
         ui.Text_Input("status", self, label="Status", setter=lambda x: None)
     )
     progress_bar = ui.Slider(
         "progress", self, min=0, max=self.frames_to_export, label="Progress"
     )
     progress_bar.read_only = True
     self.menu.append(progress_bar)
Exemple #21
0
    def init_ui(self):
        self.add_menu()
        self.menu.label = "Static Image Source"

        text = ui.Info_Text("This plugin displays a static image.")
        self.menu.append(text)

        self.menu.append(
            ui.Text_Input(
                "frame_size",
                label="Frame size",
                setter=lambda x: None,
                getter=lambda: "{} x {}".format(*self.frame_size),
            )
        )

        self.menu.append(
            ui.Text_Input(
                "frame_rate",
                label="Frame rate",
                setter=lambda x: None,
                getter=lambda: "{:.0f} FPS".format(self.frame_rate),
            )
        )

        if self.g_pool.app == "player":
            # get_frame_count() is not constant in Capture and would trigger
            # a redraw on each frame
            self.menu.append(
                ui.Text_Input(
                    "frame_num",
                    label="Number of frames",
                    setter=lambda x: None,
                    getter=lambda: self.get_frame_count(),
                )
            )
Exemple #22
0
 def _init(self, managed_task):
     self.menu.append(
         ui.Text_Input("status",
                       managed_task,
                       label="Status",
                       setter=lambda x: None))
     progress_bar = ui.Slider(
         "progress",
         managed_task,
         min=managed_task.min_progress,
         max=managed_task.max_progress,
         label="Progress",
     )
     progress_bar.read_only = True
     self.menu.append(progress_bar)
     self.menu.append(ui.Button("Cancel", managed_task.cancel))
Exemple #23
0
    def init_ui(self):
        self.add_menu()
        self.menu.label = 'Fixation Detector'

        def set_max_dispersion(new_value):
            self.max_dispersion = new_value
            self.notify_all({'subject': 'fixation_detector.should_recalculate', 'delay': 1.})

        def set_min_duration(new_value):
            self.min_duration = new_value
            self.notify_all({'subject': 'fixation_detector.should_recalculate', 'delay': 1.})

        def set_max_duration(new_value):
            self.max_duration = new_value
            self.notify_all({'subject': 'fixation_detector.should_recalculate', 'delay': 1.})

        def jump_next_fixation(_):
            ts = self.last_frame_ts
            for f in self.g_pool.fixations:
                if f['timestamp'] > ts:
                    self.g_pool.capture.seek_to_frame(f['mid_frame_index'])
                    self.g_pool.new_seek = True
                    return
            logger.error('No further fixation available')

        for help_block in self.__doc__.split('\n\n'):
            help_str = help_block.replace('\n', ' ').replace('  ', '').strip()
            self.menu.append(ui.Info_Text(help_str))
        self.menu.append(ui.Info_Text("Press the export button or type 'e' to start the export."))

        self.menu.append(ui.Slider('max_dispersion', self, min=0.01, step=0.1, max=5.,
                                   label='Maximum Dispersion [degrees]', setter=set_max_dispersion))
        self.menu.append(ui.Slider('min_duration', self, min=10, step=10, max=1500,
                                   label='Minimum Duration [milliseconds]', setter=set_min_duration))
        self.menu.append(ui.Slider('max_duration', self, min=10, step=10, max=1500,
                                   label='Maximum Duration [milliseconds]', setter=set_max_duration))
        self.menu.append(ui.Text_Input('status', self, label='Detection progress:', setter=lambda x: None))
        self.menu.append(ui.Switch('show_fixations', self, label='Show fixations'))
        self.current_fixation_details = ui.Info_Text('')
        self.menu.append(self.current_fixation_details)

        self.add_button = ui.Thumb('jump_next_fixation', setter=jump_next_fixation,
                                   getter=lambda: False, label=chr(0xe044), hotkey='f',
                                   label_font='pupil_icons')
        self.add_button.status_text = 'Next Fixation'
        self.g_pool.quickbar.append(self.add_button)
Exemple #24
0
    def open_info_menu(self):
        self.info_menu = ui.Growing_Menu('additional Recording Info',size=(300,300),pos=(300,300))
        self.info_menu.configuration = self.info_menu_conf

        def populate_info_menu():
            self.info_menu.elements[:-2] = []
            for name in self.user_info.iterkeys():
                self.info_menu.insert(0,ui.Text_Input(name,self.user_info))

        def set_user_info(new_string):
            self.user_info = new_string
            populate_info_menu()

        populate_info_menu()
        self.info_menu.append(ui.Info_Text('Use the *user info* field to add/remove additional fields and their values. The format must be a valid Python dictionary. For example -- {"key":"value"}. You can add as many fields as you require. Your custom fields will be saved for your next session.'))
        self.info_menu.append(ui.Text_Input('user_info',self,setter=set_user_info,label="User info"))
        self.g_pool.gui.append(self.info_menu)
Exemple #25
0
 def init_gui(self):
     super().init_gui()
     self.menu.append(
         ui.Text_Input('store_duration', self, label='Duration'))
     self.menu.append(
         ui.Slider('min_alpha',
                   self,
                   label='Min. Alpha',
                   min=0.,
                   max=1.,
                   step=0.05))
     self.menu.append(
         ui.Slider('max_alpha',
                   self,
                   label='Max. Alpha',
                   min=0.,
                   max=1.,
                   step=0.05))
Exemple #26
0
    def init_gui(self):
        from pyglui import ui
        ui_elements = []
        ui_elements.append(
            ui.Info_Text(
                'Enter a folder to enumerate all eligible video files. Be aware that entering folders with a lot of files can slow down Pupil Capture.'
            ))

        def set_root(folder):
            if not os.path.isdir(folder):
                logger.error('`%s` is not a valid folder path.' % folder)
            else:
                self.root_folder = folder

        ui_elements.append(
            ui.Text_Input('root_folder',
                          self,
                          label='Source Folder',
                          setter=set_root))

        def split_enumeration():
            eligible_files = self.enumerate_folder(self.root_folder)
            eligible_files.insert(0, (None, 'Select to activate'))
            return zip(*eligible_files)

        def activate(full_path):
            if not full_path:
                return
            settings = {
                'source_class_name': File_Source.class_name(),
                'frame_size': self.g_pool.capture.frame_size,
                'frame_rate': self.g_pool.capture.frame_rate,
                'source_path': full_path
            }
            self.activate_source(settings)

        ui_elements.append(
            ui.Selector('selected_file',
                        selection_getter=split_enumeration,
                        getter=lambda: None,
                        setter=activate,
                        label='Video File'))

        self.g_pool.capture_selector_menu.extend(ui_elements)
Exemple #27
0
    def add_to_menu(self, menu):

        self._detection_status_input = gl_ui.Text_Input(
            "detection_status", self, label="Detection progress:", setter=lambda _: None
        )

        self._show_segmentation_switch = gl_ui.Switch(
            "show_segmentation", self, label="Show segmentation"
        )

        self._current_segment_details = gl_ui.Info_Text("")

        menu.label = self.label_text

        for paragraph in self._info_paragraphs():
            paragraph_ui = gl_ui.Info_Text(paragraph)
            menu.append(paragraph_ui)

        menu.append(self._detection_status_input)
        menu.append(self._show_segmentation_switch)
        menu.append(self._current_segment_details)
Exemple #28
0
 def init_ui(self):
     self.add_menu()
     self.menu.label = 'Raw Data Exporter'
     self.menu.append(
         ui.Info_Text('Export Raw Pupil Capture data into .csv files.'))
     self.menu.append(
         ui.Info_Text(
             'Select your export frame range using the trim marks in the seek bar. This will affect all exporting plugins.'
         ))
     self.menu.append(
         ui.Info_Text(
             'Select your export frame range using the trim marks in the seek bar. This will affect all exporting plugins.'
         ))
     self.menu.append(
         ui.Text_Input(
             'in_mark',
             getter=self.g_pool.seek_control.get_trim_range_string,
             setter=self.g_pool.seek_control.set_trim_range_string,
             label='frame range to export'))
     self.menu.append(
         ui.Info_Text(
             "Press the export button or type 'e' to start the export."))
 def init_gui(self):
     # initialize the menu
     self.menu = ui.Scrolling_Menu('Usybus controller')
     # add menu to the window
     self.g_pool.gui.append(self.menu)
     self.menu.append(ui.Button('Close', self.unset_alive))
     self.menu.append(ui.Button('Reset', self.reset))
     self.menu.append(ui.Switch('send_tc', self, label='Send TC'))
     self.menu.append(ui.Switch('send_gaze', self, label='Send Gaze'))
     self.menu.append(
         ui.Switch('out_of_srf_gaze', self, label='Out of surface gaze'))
     self.menu.append(
         ui.Text_Input('device_id',
                       self,
                       setter=PupilUsybusController.set_device_id))
     self.menu.append(
         ui.Slider('confidence',
                   self,
                   min=0.1,
                   step=0.01,
                   max=1.0,
                   label='Confidence'))
Exemple #30
0
    def init_gui(self):
        def close():
            self.alive = False

        def sync_status_info():
            if self.time_sync_node is None:
                return 'Waiting for time sync msg.'
            else:
                return str(self.time_sync_node)

        help_str = "Synchonize time of Pupil captures across the local network."
        self.menu = ui.Growing_Menu('Network Time Sync')
        self.menu.append(ui.Button('Close', close))
        self.menu.append(ui.Info_Text(help_str))
        help_str = "All pupil nodes of one group share a Master clock."
        self.menu.append(ui.Info_Text(help_str))
        self.menu.append(
            ui.Text_Input('sync status',
                          getter=sync_status_info,
                          setter=lambda _: _))
        # self.menu[-1].read_only = True
        self.g_pool.sidebar.append(self.menu)