Welcome! Log In Create A New Profile

Advanced

Issues recording TTL pulses during inter-trial interval

Posted by Lizzy_zyr 
Issues recording TTL pulses during inter-trial interval
March 17, 2025 09:24PM
Hello Jaewon,

I've run into a few issues while trying to record signals during the inter-trial interval (ITI) and would really appreciate your help.

1. Program crashes when "record signals" during ITI is enabled:
Every time I run the experiment with the "record signals" during ITI option checked, the program crashes as soon as I click "Quit" to end the run. (Please see the attached screenshot of the crash report.) The same script runs without issue when this option is unchecked.
I'm currently running a version 2 timing file in MonkeyLogic version 2.2.37 on MATLAB R2022b. Could this issue be related to the MonkeyLogic or MATLAB version?

2. Difficulty recording digital TTL pulses during ITI:
Despite the crash mentioned above, the .bhv file still saves successfully. However, button presses (digital TTL pulses) during ITI don't appear to be recorded. To align each MRI-acquired volume precisely with subject behavior, we've configured button 1 in MonkeyLogic to detect the scanner's digital TTL pulses. Within each trial, MonkeyLogic correctly detects these pulses and logs the appropriate behavioral codes. However, pulses during the ITI appear to be lost.
I'm wondering if the "record signals" during ITI option might be limited to recording analog inputs only. Is there another way to capture digital TTL inputs during the ITI periods?

3. Concatenating behavioral codes and timestamps across trials:
I understand that mlconcatenate combines trial-by-trial analog data into a continuous matrix with adjusted timestamps. Is there a way (or existing functionality) to similarly concatenate behavioral codes and timestamps from individual trials? Ideally, we would like to know precisely when each trial starts and ends, and how each TTL pulse aligns within the overall timing of a session.

Thank you so much in advance for your time and any insights you can provide regarding these!

Lizzy
Attachments:
open | download - CrashReporter.jpg (72.4 KB)
Re: Issues recording TTL pulses during inter-trial interval
March 18, 2025 07:15PM
1. NIMH ML and, as far as I know, MATLAB itself are not dependent on Qt. The error is likely to come from another software that you run together.

2. You know that a new trial begins with ITI when the ITI recording is enabled, don't you?
https://monkeylogic.nimh.nih.gov/docs_MainMenu.html#Task
Did you compare the signal length between analog inputs and the button?

3. Have you actually run mlconcatenate? Behavioral codes and timestamps are not "concatenated" into a long vector, exactly because you still need to know which trial they belong to. However, the timestamps are all recalculated relative to the beginning of the first trial, so their values are not the same as those returned by mlread.

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.