Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment   Page 8 of 10     «   Prev   5   6   7   8   9   10   Next
Wing

Junior Member
Registered:
Posts: 19
Reply with quote  #176 
Hi Jaewon,

   I have a crash problem when i use eyejoytrack function in MonkeyLogic2(version Mar-23-2018).

   In my customized code, i use this sentence:
###
          eyejoytrack('holdfix',fixation_order, fixation_value,'holdtouch', lever_order, lever_value, time)
###
   to require the subject hold both fixated and holding a lever(set as button1) during the time setted(quite short, 300-700msec).

  The crash doesn't happen often(mostly it works perfect), and I couldn't repeat the crash situation unfortunately.

  However, I can repeat this crash problem if I use the old version MonkeyLogic--- if i release the lever in the required hold time once but pull it soon, like as fast as i can.

  Importantly, in both version, after the crash, same error showed up:

###
Index exceeds matrix dimension

Error stm2_runtime/end_trial (line 1233)
ml_new_fix_point(ml_,😉=median(TrialData.AnalogData.Eye(ML_EyeTargetRecord(ml_,3):ML_EyeTargetRecord(ml_,4),😉,1);

Error stm2_runtime (line 1988)
end_trial;

Error run_trial (line 111)
runtime(MLConfig,TrialRecord,TaskObject,TrialData);

Error monkeylogic/UIcallback (line 1100)
result = run_trial(MLConfig,datafile);

Error while evaluating uicontrol Callback

###

   Do you have any idea what happened?Am i supposed to use other codes rather than the eyejoytrack function?

Thanks!
0
Jaewon

Administrator
Registered:
Posts: 727
Reply with quote  #177 
Hi Wing,

Thank you for letting me know this. I think I figured out what happened. Your detailed description helped a lot.

When you release the lever, the 'holdtouch' requirement is not fulfilled, so eyejoytrack returns early. However, if the eye fixation is not broken, the ontarget status of 'holdfix' remains as 1. This makes ML think that the 'holdfix' succeeded and try to adjust the eye drift. But, if the trial ended immediately after the eyejoytrack, there is no actual eye signal recorded for the given duration due to the early return and the drift correction mechanism fails.

So there are a couple of conditions to be met simultaneously, for this to happen.
1) Eye fixation should be held when the lever is released.
2) The auto drift correction should be turned on.
3) The trial should be aborted immediately when the eyejoytrack returns.

Please let me know if you think this is not the case. I will fix it and update the package as soon as possible.
0
Wing

Junior Member
Registered:
Posts: 19
Reply with quote  #178 
Hi Jaewon,

    Thanks for your quick reply.

    I think that is exactly the case. All 3 conditions are satisfied when the ML2 crashes.  
0
kms

Member
Registered:
Posts: 37
Reply with quote  #179 
Hi Jaewon, 

How can one access the 'data file' name in the timings file? I would like to use the same name while saving my video files.

Thanks.


0
Jaewon

Administrator
Registered:
Posts: 727
Reply with quote  #180 
It is in TrialRecord.DataFile
0
Jaewon

Administrator
Registered:
Posts: 727
Reply with quote  #181 
* Changes in NIMH MonkeyLogic 2 (Mar 26, 2018)

 + The GUI button that opened the runtime folder was replaced with the 'Save
   stimuli' button in Mar 19, 2018. To open the runtime file, double-click the
   name of the timing script in the list from now on. If the runtime file is
   not created yet, it will just open the runtime folder, which is Windows's
   temp directory.

 - A problem that the auto eye drift correction fails under a certain condition
   in which 'holdfix' is concurrently used with other tracking methods in
   eyejoytrack() is fixed. (Thanks to Wing from the ML forum)

 - It seems that buttons didn't work when the threshold was empty ('[]') in the
   eyejoytrack(). That shouldn't be the case, so it is fixed. An empty
   threshold resets the previously used threshold to the default value. (3 for
   analog buttons and 0.5 for digital buttons)

0
kms

Member
Registered:
Posts: 37
Reply with quote  #182 
Thank you, Jaewon. 

I am trying to verify the time of acquisition of my video frames (as given by 'time' and 'metadata' in 'getdata') and their timing with respect to ML task events (as given by eventmarker). Could you clarify how the 'AbsoluteTrialStartTime' & 'TrialDateTime' fields of the 'BHV' structure in a data file are related to the timestamps marked by the event codes? Thanks.
0
Jaewon

Administrator
Registered:
Posts: 727
Reply with quote  #183 
TrialDateTime is just the system clock reading when each trial begins. It is for human reference.

AbsoluteTrialStartTime is the time in milliseconds passed since the task start. Data acquisition begins at the AbsoluteTrialStartTime of each trial and the times of events are counted from it as well. AbsoluteTrialStartTime of Trial 1 is 0.
0
kms

Member
Registered:
Posts: 37
Reply with quote  #184 
Thank you, Jaewon.

As a sanity check, I saved the 'clock' time just after an event is stamped (via eventmarker) in the BHV2 file and tested if this clock time for a given trial is almost equal to (TrialDateTime of 1st trial + AbsoluteTrialStartTime for that trial + event code time in that trial)?

Am I right in this logic? By your estimates, how much deviation from equality is expected/ normal?

Thanks.
0
Jaewon

Administrator
Registered:
Posts: 727
Reply with quote  #185 
Your logic sounds solid, but you won't be able to measure the time interval properly with the 'clock' time, because the precision of the 'clock' time is just ~10 ms, which is why TrialDateTime should be used for human reference only.
0
Wing

Junior Member
Registered:
Posts: 19
Reply with quote  #186 
Thank you, Jaewon. 

   The new ML looks fine now!

   I'll let you know if there is any other problems after i test for a couple of days.

0
Jaewon

Administrator
Registered:
Posts: 727
Reply with quote  #187 
* Changes in NIMH MonkeyLogic 2 (Mar 28, 2018)

 - Multi-selection in the "Blocks to run" dialog did not work when there were
   only two blocks. It is fixed. (Thanks to Keith Purpura)

 - When the "First block to run" was manually selected, the selected block was
   not removed from the available block pool and therefore was run twice during
   the first round. It is fixed. (Thanks to Keith Purpura)
0
kms

Member
Registered:
Posts: 37
Reply with quote  #188 
Thanks, Jaewon. Unfortunately, the image acquisition toolbox gives the time of triggering the video (and subsequent frame acquisitions with respect to it) in clock time. Would it be possible to integrate eventmarker with this to get the trigger time with respect to ML trial start?
0
Jaewon

Administrator
Registered:
Posts: 727
Reply with quote  #189 
Please show me the values of 'time' and 'metadata' that are returned by getdata. From the description in the manual, I think you can use 'time', but I want to see what they look like, to be sure. It seems that metadata.AbsTime is in clock time, but 'time' is not.
0
kms

Member
Registered:
Posts: 37
Reply with quote  #190 
Hi Jaewon, 

I have moved this discussion to the thread on Video Recording. Please find my answer here (http://forums.monkeylogic.org/post/show_single_post?pid=1303709269&postcount=5&forum=454793). Thanks.
0
Jaewon

Administrator
Registered:
Posts: 727
Reply with quote  #191 
* Changes in NIMH MonkeyLogic 2 (Apr 10, 2018)

 + Auto drift correction can be adjusted in the pause menu now.

 - When multiple eventcodes were sent as a vector, some digital bits in higher
   digits were not reset properly after the first code.  So, if the next code
   in the vector was smaller than the preceding one, an incorrect code could
   be stamped.  It is fixed now.

 - An error that occurred in some DAQ board models while setting a default
   input/output voltage range is fixed. (Thanks to Keith Purpura)

 - A problem that, when reading the H5 format file, the types of some variables
   were not set back to their original types is fixed. (Thanks to Daniel Amaya)

 - The timing of screen flips is adjusted so that it becomes closer to the time
   of the eventcode stamped together. (Thanks to Carlos Ponce)
0
Jaewon

Administrator
Registered:
Posts: 727
Reply with quote  #192 
* Changes in NIMH MonkeyLogic 2 (Apr 16, 2018)

 + A tool for tuning screen presentation timing is included. Users can use this
   tool to minimize the latency from the screen flip command to the photo
   detector response. It is required to turn on the photodiode trigger and
   assign the photodiode signal to an analog input channel, to use this tool.
   The detailed instructions of how to use the tool is in the following link.

http://forums.monkeylogic.org/post/a-delay-between-event-marker-and-stimuli-presentation-on-the-screen-9710796?pid=1303915680

0
aboharbf

Member
Registered:
Posts: 68
Reply with quote  #193 
Hey Jaewon,

What is the magnitude of the signal that needs to be used for the Analog Input? a friend of mine in the lab doesn't use a 5V battery with his photodiode, would this set up be acceptable? If not, is there a means of producing a constant 5V pulse through an Analog Out to power the Photodiode? Thanks!
0
Jaewon

Administrator
Registered:
Posts: 727
Reply with quote  #194 
The tool will say that it fails to detect the pulse, if the difference between the max and min voltages is less than 0.1V. For your own analysis, it doesn't matter as long as you can see where rising occurs.
0
aboharbf

Member
Registered:
Posts: 68
Reply with quote  #195 
So is there anyway to allocate an Analog Out port for the sake of powering one?
0
Jaewon

Administrator
Registered:
Posts: 727
Reply with quote  #196 
It may work, since a diode does not require much current, but I wouldn't use analog output to power anything. The DAQ board probably has +5V lines already, so you can try with them.
0
Jaewon

Administrator
Registered:
Posts: 727
Reply with quote  #197 
* Changes in NIMH MonkeyLogic 2 (Apr 23, 2018)

 + The photodiode tuning tool is improved to use the falling edges as well to
   determine the tuning state.

 + When reading a BHV2 file fails, mlbhv2 shows a warning, instead of an error,
   and returns the data that is read until the problem occurs.

 + The Origin & Gain calibration method displays the counts of attempted
   trials and acquired fixation on the screen now.
0
Herrick

Junior Member
Registered:
Posts: 7
Reply with quote  #198 
Hi Jaewon,

I have a problem with the editable() function.

for example, I defined 2 conditions in the condition file Fixation.txt

Condition         Frequency         Block         Timing File         TaskObject#1         TaskObject#2                 TaskObject#3                 TaskObject#4
1                 1                 1         HT                 fix(10,10)
2                 1                 2         FIX                 fix(10,10)         mov(sgr_1_45,4.73,8.46)         mov(sgr_1_135,4.5,6.3)         mov(sgr_1_45,8.3,6.8)

These two conditions belongs to different timing scripts: HT & Fix. In those scripts, I claim the editable variables like ML1 respectively.

For timing script HT
editable('HT_Fix_fp_win','HT_Fix_hold_fix','HT_initial_fix_fp','HT_Fix_reward_dur');
% check-window radius for fixation (degrees)
HT_Fix_fp_win = 2;
HT_Fix_reward_dur = 700;
HT_Fix_hold_fix = 1800; % hold fixation on fp
HT_initial_fix_fp = 200; % initial fixation on fp

For For timing script FIX
% define editable variable
editable('Fix_fp_win','Fix_hold_fix','Fix_reward_dur')
% check-window radius for fixation (degrees)
Fix_fp_win = 3;
Fix_reward_dur = 700;
Fix_hold_fix = 1000; % hold fixation on fp

But ML2 would only recognize what were sclaimed in script HT.m, the FIX.m was ignored. Besides even I changed the editable variables of HT in "Edit timing file variables" option in control screen, and stored to the cfg2.mat, they would become original value that were defined in HT.m.

I found a solution that is to copy the same part of sclaiming editable variables and giving them values in FIX.m to HT.m. ML2 would recognize them, and change values in "Edit timing file variables" option could take effect. However, the stored values would be overwritten to original ones when next session starts.

I just begins to use ML2, that would work fine in ML1.

Do you have any idea how that happened? And what can be done to fix it? Any help from you will be really appreciated!
0
Jaewon

Administrator
Registered:
Posts: 727
Reply with quote  #199 
Thank you for reporting this, Herrick. I am aware of this problem. I meant to fix it someday but forgot to do so. Let me think about how to make this work neatly.

A quick fix is to just define the same variables and register them with editable() in both scripts. In other words, list all of them in both scripts and put all of them to editable() in both scripts.
0
Herrick

Junior Member
Registered:
Posts: 7
Reply with quote  #200 
Quote:
Originally Posted by Jaewon
Thank you for reporting this, Herrick. I am aware of this problem. I meant to fix it someday but forgot to do so. Let me think about how to make this work neatly.

A quick fix is to just define the same variables and register them with editable() in both scripts. In other words, list all of them in both scripts and put all of them to editable() in both scripts.


Thanks Jaewon. It worked!

And Another problem is about movie streaming.

My system information: Win7(32-bit),Matlab R2015b(32-bit),RAM 6GB

I wrote a function to generate avi files to display drifting grating stimuli which were not larger than 1MB. But after exactly 33 trials, as soon as ML2 starts 34th trial, it crashed and poped out error information as below:

Error using mgladdmovie (line 15)
(1)MovieGraphic, There is no video frame in this file.

(2)MovieGraphic, Unsupported media type!

Error in mltaskobject/createobj (line 527)
obj.ID(m) = mgladdmovie(a{2});

Error in mltaskobject (line 33)
if isfield(taskobj,'Attribute'),
createobj(obj,taskobj,MLConfig,TrialRecord); else
createobj_from_struct(obj,taskobj,MLConfig,TrialRecord); end

Error in run_trial (line 95)
TaskObject = mltaskobject(taskobject,MLConfig,TrialRecord);

Error in monkeylogic/UIcallback (line 1128)
result = run_trial(MLConfig,datafile);

Error while evaluating UIControl Callback

Usually (1) appeared first, then I tried to run anther session to see what would happen without restarting ML2 and Matlab, (2) would appear.

I thought it may be related to the memory and found at that time if I hit the button on the menu to test subject screen, it showed somthing about "out of memory" in the matlab. And I check MaxPossibleArrayBytes in the end of every trial and observed it constantly drop 32MB from 1850MB until run out. That was the time ML2 crashed. However, if I change to block which just use static stimuli and ran less than 100 trials, the values kept changing in a range of 10MB and showed no sign of dramatic memory consumption.

I was so confused and tested the same experiment on an x64-win10 computer with both 32-bit &64-bit Matlab R2015b installed. It was found out that large memory consumption in task using movie stimuli just happened to 32-bit Matlab. 64-bit Matlab consumed 40MB during 50 trials, but it would release some now and again. Should I change to use 64-bit Matlab or there's any way to fix it?

By the way, does it means the movie streaming method that ML2 used actually supports way better in 64-bit Matlab? Because I saw that max latency & cycle-rate showed differently:
a) (32-bit Matlab, 32-bit win7, ML2)Max latency: > 13ms / Cycle-rate: ~1000Hz
b) (32-bit Matlab, 32-bit win7, ML1 - NIMH DAQ Toolbox)Max latency: ~6.5ms / Cycle-rate: ~1800Hz - 2000Hz
c) (32-bit Matlab, 64-bit win10, ML2)Max latency: ~7ms / Cycle-rate: ~2000Hz
d) (64-bit Matlab, 64-bit win10, ML2)Max latency: ~6ms / Cycle-rate: ~2100Hz

Appreciate your time and replay!
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.