visual_behavior_analysis icon indicating copy to clipboard operation
visual_behavior_analysis copied to clipboard

ophys frames : time of the frame onset?

Open farznaj opened this issue 6 years ago • 2 comments

@matchings @jeromelecoq

I'd like to know if the values in ophys_frame indicate the time at the onset of a frame? the time at the middle of a frame? or the time at the offset of a frame?

Another way to put this question: Lets say, dataset.timestamps['ophys_frames'] = [ 7.85277, 7.94601, 8.03926, 8.1325 ...] does it mean that the first frame is from 7.85277 to 7.94601 sec?

I saw the following in the "convert" code, which makes me think the values indicate the onset of the frames, but I'd like to make sure. Thanks.

vs2p_r = sync_dataset.get_rising_edges('2p_vsync')
vs2p_f = sync_dataset.get_falling_edges(
    '2p_vsync', )  # new sync may be able to do units = 'sec', so conversion can be skipped
vs2p_rsec = vs2p_r / sample_freq
vs2p_fsec = vs2p_f / sample_freq
if use_acq_trigger:  # if 2P6, filter out solenoid artifacts
    vs2p_r_filtered, vs2p_f_filtered = filter_digital(vs2p_rsec, vs2p_fsec, threshold=0.01)
    frames_2p = vs2p_r_filtered
else:  # dont need to filter out artifacts in pipeline data
    frames_2p = vs2p_rsec
# use rising edge for Scientifica, falling edge for Nikon http://confluence.corp.alleninstitute.org/display/IT/Ophys+Time+Sync
# Convert to seconds - skip if using units in get_falling_edges, otherwise convert before doing filter digital

farznaj avatar Jun 17 '19 21:06 farznaj

I think this is will depend on how scan image store this value. Perhaps @nataliaorlova can answer this directly. I am not sure I remember how scan image usually time each frame.

jeromelecoq avatar Jun 20 '19 21:06 jeromelecoq

@jeromelecoq @nataliaorlova @farznaj Did we figure out the answer to this question?

nickponvert avatar Jan 22 '20 19:01 nickponvert