Show all posts by user
ML programming tips
What is the digital input option used on the Blackrock side? Do you know how frequently your Blackrock scans the digital input? I mean the sample rate.
What do you mean by "they will occur at the same time of the original behavioral code"? Are their Blackrock timestamps exactly the same?
Do the codes and times of the original events recorded by Blackrock match those from NIMH ML,
by
Jaewon
-
Questions and Answers
I see. Then you do need a custom adapter.
I tried making one. Since this adapter does not make sure that the LED is off at the end, you need to add it again with NotAdapter when you want to keep the LED off. See the following code.
btn = SingleButton(button_);
btn.Button = 1;
ind = OnOffIndicator(btn);
ind.Port = 1; % TTL #1
tc = TimeCounter(ind);
tc.Duration = 5000;
sc
by
Jaewon
-
Questions and Answers
Use normal USB cameras.
https://monkeylogic.nimh.nih.gov/docs_MainMenu.html#Webcam
by
Jaewon
-
Questions and Answers
I think your method is way more complex than it needs to be. If the LED can be driven by TTL, you can just connect it (and probably a 1-kOhm resistor as well) to the button in series. The intervention of NIMH ML is not necessary.
by
Jaewon
-
Questions and Answers
You got only a 1-by-2 vector, because you ran the task in the simulation mode. You will get a long 2-column matrix with an actual eye tracker.
To get the data that is being collected in the current trial, use get_analog_data(). The function returns a given number of samples acquired most recently.
https://monkeylogic.nimh.nih.gov/docs_RuntimeFunctions.html#get_analog_data
The function does
by
Jaewon
-
Questions and Answers
Obviously you tried to save a variable that did not exist. Place bhv_variable() at the end of the script or after the variable is created.
Timing script functions are available only in the timing script. I do not know why you want to get a key input in the userloop, but you need to use a different method to do so. Please read the manual, if you did not.
https://monkeylogic.nimh.nih.gov/docs_C
by
Jaewon
-
Questions and Answers
Use bhv_variable().
https://monkeylogic.nimh.nih.gov/docs_RuntimeFunctions.html#bhv_variable
by
Jaewon
-
Questions and Answers
I assume you know how the scene framework works. If not, please read the following manual page.
https://monkeylogic.nimh.nih.gov/docs_CreatingTask.html#RuntimeVersion2_Background
Another thing that you need to understand is the difference between stimulus events and behavioral events. For stimuli, it is you that determine when they will be presented, so you can set an eventcode in advance and
by
Jaewon
-
Questions and Answers
Please explain what the problems are and ask any question (related to NIMH ML) here.
by
Jaewon
-
Questions and Answers
* Changes in 2.2.43 (Jan 12, 2024)
+ The port number for the TOM-rs eye tracker can be changed in the UI menu.
(Thanks to Amirali Soltani Tehrani)
- It is fixed that WaitThenHold and FreeThenHold did not set AcquiredTime and
RT correctly when there were intervening adapters between SingleTarget and
them. (Thanks to Yidong_YANG from the NIMH ML forum)
by
Jaewon
-
News
I made some modifications. Please download the package again. AcquiredTime and RT will be correctly recorded, even though there are intervening adapters between WaitThenHold and SingleTarget.
Thanks for letting me know what I overlooked.
by
Jaewon
-
Questions and Answers
You are right, but using Concurrent is not how I want to fix it. I am working on this and will upload a fix soon.
by
Jaewon
-
Questions and Answers
Your OnOffMarkers are not included in the chains. See below.
Also note that SingleTarget does not succeed until the tracker signal stays in the threshold window at least for one entire frame, while the Time property of SingleTarget indicates the time of the signal crossing the threshold. Therefore, the timestamp of OnOffMarker's eventcode is always later than the Time of SingleTarget. See
by
Jaewon
-
Questions and Answers
Neither. NIMH ML has the waveform ready for immediate play, before the scene starts. However, there is still an internal delay in Windows audio architecture that cannot be avoided. My paper about this is in review. The actual delay is dependent on many factors, but, if you are using XAudio2, it is usually about 37 ms.
https://monkeylogic.nimh.nih.gov/docs_AudioEngine.html
AudioSound ends the
by
Jaewon
-
Questions and Answers
The version 2.2.42 (Dec 15, 2023) supports the polynomial transformation in the [2-D Spatial Transformation] calibration tool.
While a linear transformation (e.g., projective transformation) fails when the voltage points (red circles) are not on straight lines, the polynomial transformation works well even though the voltage points are aligned in a curved shape.
by
Jaewon
-
Tips
* Changes in 2.2.42 (Dec 15, 2023)
+ The polynomial transform is supported in the [2-D Spatial Transformation]
calibration tool. This transform allows mapping a curved voltage space to a
rectangular eye space.
https://monkeylogic.nimh.nih.gov/board/read.php?2,1775
- Minor fixes.
by
Jaewon
-
News
Please answer my questions in your previous post. I need the information to fix your problem.
https://monkeylogic.nimh.nih.gov/board/read.php?3,1664,1689#msg-1689
by
Jaewon
-
Questions and Answers
Use WaitThenHold, instead of TimeCounter, like the following.
leave_fix = SingleTarget(eye_);
not_fixing = NotAdapter(leave_fix);
leave_timer = WaitThenHold(not_fixing);
leave_timer.WaitTime = target_wait_time;
leave_timer.HoldTime = target_limit_time;
By adding NotAdapter, not_fixing succeeds when the eye is not on the target. Therefore, what leave_timer does is to await the fixation br
by
Jaewon
-
Questions and Answers
The digital lines of NI boards are basically TTLs. So you are using TTLs by setting up Behavioral Codes and Strobe Bit. Not just one, but so many of them.
by
Jaewon
-
Questions and Answers
I think you misunderstood something. Behavioral Codes and Strobe Bit are there exactly for timestamping the electrophysiology data. NIMH ML always records eventmarkers, whether you set them up or not.
When you read time from a TTL signal, what matters is when it goes HI (rising edge) or LO (falling edge), not its duration.
See the manual of your Blockrock device (and the following link) and
by
Jaewon
-
Questions and Answers
You can choose a lower sample rate in the menu, but it does not change NIMH ML's internal sample rate. It can just reduce the amount of data stored in the data file. This option is not available though, if ITI recording is turned on.
https://monkeylogic.nimh.nih.gov/docs_MainMenu.html#AISampleRate
If you are not using SSDs, I suggest getting one. You do not need to touch any existing com
by
Jaewon
-
Questions and Answers
* Changes in 2.2.41 (Nov 29, 2023)
+ A new timing script fuction, include(), is added. It includes other script
files into the current script.
https://monkeylogic.nimh.nih.gov/docs_RuntimeFunctions.html#include
by
Jaewon
-
News
The TTLOutput manual explains how to turn off a TTL in an arbitrary time. However, you may not want to use the method for an eventmarker, since the onset time of the TTL can vary slightly as mentioned in the remark.
Is there a reason for using a TTL, instead of the Behavioral Codes and Strobe Bit?
You didn't say why a 10-ms pulse is okay, but a 16-ms pulse is not. The difference doesn&
by
Jaewon
-
Questions and Answers
Your figure shows 3 columns. Because of the timestamps, the saved LSL data is supposed to have one more column than what you choose in the LSL menu of NIMH ML. Is that the case in your data file? Did you choose 2 LSL streams to save?
No. What I said above is still applied and it is possible to get a different number of samples. However, the difference should be 1 or 2 samples at most.
If yo
by
Jaewon
-
Questions and Answers
That is how the scene framework is designed.
https://monkeylogic.nimh.nih.gov/docs_CreatingTask.html#RuntimeVersion2_Background
What is the purpose of this TTL output? Why is 16 ms not acceptable?
Did you read the TTLOutput manual for the changes that I mentioned above?
https://monkeylogic.nimh.nih.gov/docs_RuntimeFunctions.html#TTLOutput
by
Jaewon
-
Questions and Answers
First of all, the code 9 is not the trial start time.
https://monkeylogic.nimh.nih.gov/board/read.php?2,1551,1551#msg-1551
Your 1st column does not look like timestamps. The unit of the timestamp is supposed to be milliseconds. What is the sample rate of the LSL data? Are you using the latest NIMH ML?
by
Jaewon
-
Questions and Answers
It is the Bioplux acquisition system that collects samples from the sensor and sends to LSL. NIMH ML simply imports data stored in LSL when a trial ends. Considering the clock difference and the network speed, there is no guarantee that you get the same number of samples from both streams.
NIMH ML clears LSL when starting each trial (or when starting the 1st trial if using ITI recording), so t
by
Jaewon
-
Questions and Answers
There are so many different ways to program it. For the code you posted, I would count the number like this, for example.
tbl = tabulate(conditions(find(0==TrialRecord.TrialErrors),1))
You need to keep the history of played conditions somewhere, to do this calculation. You are using TrialRecord.NextCondition to store the next trial number redundantly, but that variable is supposed to indicat
by
Jaewon
-
Questions and Answers
I made a new function for it. Download the NIMH ML package again. Then you will be able to use include().
https://monkeylogic.nimh.nih.gov/docs_RuntimeFunctions.html#include
You can define the wrapper in the timing script.
by
Jaewon
-
Questions and Answers
Read the manual.
https://monkeylogic.nimh.nih.gov/docs_ScriptingScenes.html#AdapterAggregators
by
Jaewon
-
Questions and Answers