Skip to content

UI_Video

Page Hayley edited this page Sep 1, 2021 · 20 revisions

VidScorer

Tag video frames with metadata and synchronize videos with electrophysiologic data.

image

Tutorial

See set-up

Video Alignment

Open the video scoring GUI

nigeLab.libs.VidScorer(blockObj.Cameras(1))

The three windows above should open up: a main panel with associated streams, the block video, and a platform for tagging trials and frames

Tools Function
Double Green Arrows Skips between trials
Number Field Jump to trial #
Play/Stop Buttons Control the video
Scroll Bar Adjust playback speed
Blue Arrows Advance/go back a frame
Hand Pan along x-axis
Magnifying glass Zoom in/out on streams
Stretch mode Adjusts for syncing time-scales
Sync mode Allows streams to be aligned

customize keys by accessing +workflow\defaultVideoScoringHotkey.m

Load trials from the digital stream

  • Check the correct digital input under the "Block streams" expandable menu on the right side of the main panel
  • The blue high/low signal should appear in the same window after a moment of loading
  • Check the "show trials" option near the bottom of the main panel and the digital signal should also be filled with a green color
  • Each green block represents a trial as you have determined it in the set-up

Create a video stream for alignment with electrophysiologic data

  • Right-click on video streams on the right of the main panel and select “add stream from video”
  • Two new video frames will open— one to create a ROI box around a signal source which corresponds to the digital input and another to create a larger box as a normalization factor
  • Check the saved video stream in the expanding menu in the main panel to visualize as an orange line in main panel

Align the data streams

  • Highlight streams with ctrl+click in their respective expanding menus
  • Select "sync mode" and shift the video stream
  • Drag orange line to overlap with the high/low points of the blue digital stream
  • Zoom in to increase the accuracy of the match particularly at the beginning of the block
  • If the synchronization is lost over the course of the recording despite aligning at the beginning, there is a mismatch in the timing of the camera
  • Select the "stretch mode" to alter camera timing to fit the digital stream
  • Return to "sync mode" to realign afterwards

Set labels/events

  • Clicking the plus sign under "Events" in the tagging window will flag and label a frame of interest
  • Clicking the plus sign under "Labels" in the tagging window will label the individual trial
  • Events and labels will appear only with the trial they are on
  • After progress is saved, the tags and their timestamps can be accessed in blockObj.Events

Set-up and file association

Set the event structure in +defaults\Event.m to recognize digital streams

  • As a default, there are pars.BeginTrial and pars.EndTrial structures which can be used to indicate the start and stop of a trial based on a digital input. You can change the names of these, the digital signals used to indicate an event, or whether that signal should be high/low/etc.
  • Make sure the name you are using for the digital input matches the stream name contained in the blockObj-- blockObj.Streams.DigIO(1)

Run event detection to segment trials based on the digital input

blockObj.doEventDetection

Match videos to corresponding blocks under +defaults\Video.m

  • Set pars.HasVideo = true; and input the folder containing the videos under pars.VidFilePath
  • pars.UniqueKey.vars should have the metadata from the video name that matches the metadata contained in the recording name
  • pars.NamingConvention works to save the metadata from the video name similar to that done with parsing the initial tank file name set-up

Run blockObj.initVideos to pair the videos to the respective block in pars

  • Check blockObj.Cameras for correct assignment which should result in a structure under the Meta property with the number of cameras by the total number videos

Alternatively, you can pair them manually

path = fullfile('K:\Rat\Video\UnilateralReach\Experimental_Folder\Animal_Folder','R20-99_2020_1_11_0_Left_A_0.mp4');

camObj = nigeLab.libs.nigelCamera(blockObj,{path});

or with multiple video files for the block

path = {'K:\Rat\Video\UnilateralReach\Experimental_Folder\Animal_Folder\R20-99_2020_1_11_0_Left_A_0.mp4', 'K:\Rat\Video\UnilateralReach\Experimental_Folder\Animal_Folder\R20-99_2020_1_11_0_Left_A_1.mp4'};

camObj = nigeLab.libs.nigelCamera(blockObj, path);

Clone this wiki locally