zhuangjun1981 / retinotopic_mapping

visual display and analysis python code for retinotopic mapping of rodent visual cortex
http://retinotopic-mapping.readthedocs.io/en/latest/
GNU General Public License v3.0
18 stars 15 forks source link

Camera Output #11

Closed triplem0814 closed 5 years ago

triplem0814 commented 5 years ago

Is there anywhere in the code where you mention camera input to the daq or output from the daq to the camera? If not, how are you lining up the neural recording data with the stimulus timing?

zhuangjun1981 commented 5 years ago

This software does not include the functionality to take camera output. For time alignment, we use the indicator class, it gives a small flashing square at the corner of the monitor which is synchronized with the stimuli. We took a photodiode covering this square and record its output, this output together with camera frame timing output are recorded by a separate daq which allows the timing alignment after recording.

If you want, you can let visual stimulus sent out timing TTL for each frame. The variables to specify this output is

is_sync_pulse
sync_pulse_NI_dev
sync_pulse_NI_port
sync_pulse_NI_line

in the DisplaySequence class. Simply set 'is_sync_pulsetoTrue` and specify the device name, port and line. This will output the computer command timing for each displayed frame. You can record this TTL signal on the same daq which records photodiode and camera timing. This will allow you to do all sorts of timing alignment.

But be aware that the computer command timing will be several tens of ms before your photodiode signal timing because usually there is a delay from the time computer sends command to the time monitor actually displays it. The exact number of this delay depends on your system. On our system it is about 30 ms. We usually treat the photodiode signal as ground truth and for the purpose of retinotopic mapping the photodiode signal along is enough.

triplem0814 commented 5 years ago

Thank you. Then what are the trigger_pulse_NI_dev, trigger_pulse_NI_port, and trigger_pulse_NI_line variables for?

zhuangjun1981 commented 5 years ago

They together with is_triggered and trigger_event are used for the triggering functionality. If you set is_triggered to True. When you run the stimulus, it will wait until it detects the triggering event before start.

triplem0814 commented 5 years ago

Alright, thank you.