[open] N-back task
Hi Dear All,
I've just started using OpenSesame and currently thinking about writing a standard N-back fMRI task to further share it with the whole community (it's one of the most commonly used paradigms and, I'm sure, many researchers will find it useful).
However, the software, my own enthusiasm and limited Python coding skills are everything that I have, so far.
So, I would really appreciate your help with this.
I am uploading this alpha-version of a standard N-back task (with shapes):
https://www.dropbox.com/s/t8myta7597jcw1o/nback_shapes_v0.1.opensesame.tar.gz?dl=0
It has 3 difficulties: N=1 (basically, just visual matching), N=2 and N=3, more levels can be easily added.
Ideally, I would like to implement an opportunity to sync the stimuli with TRs from the MR scanner, but it is not at the top of my list right now.
Here are the things that I'm currently struggling with:
- Cannot find a way to make the trials fixed (e.g. instead of defining "n1" loop based on number of repetitions, it would be nice if the task was still self-paced, but the loop was terminated after, say, every 45 seconds).
- Not sure how to record correct responses in a smart way.. There was another version that had different number of stimuli: 1-back: 1 shape after the 'key' stimulus, 2-back: 2, etc... But I just don't think it's a very elegant solution.
- I removed feedback from this version, as I did not know how to bind it to the correct responses.
Apologies if these things are too basic.. And I welcome any questions and comments you might have!
Best Wishes,
Alex
Comments
Hi Alex,
This is usually enough, Python is quite easy to learn, so if you use your enthusiasm, you should be there in no time.
If you want it to be time-based, you can put the
trial sequence
into aninline_script
in a way similar to this one:The upper script is a good starting point for adding nice correct response logging
You just have to define the correct response in the while loop,and compare it to the actual one. Again, here a way of doing it:
Add another canvas, which only shows feedback text:
I hope these pointers will suffice for you to get started. Btw. I am not sure how exactly the paradigm is supposed to work. I have to versions in my mind, that make both sort of sense, so in case you realize I explained the wrong one, sorry. But still, you should be able to modify the code for your needs.
Good luck,
Eduard
I realized, it might have been better, if I just posted one coherent code snippet.
Here you go!
Hi Dear All,
Thanks a lot for all your help!
After discussing the task with our group, we eventually decided to go for a pseudo-random sequence of events...
The task is running relatively smoothly now I would say... However, I'm still struggling a bit with the logs (will manage it eventually, I hope).
However, there is one particular problem that I still don't know how to fix...
The thing is that I want to provide a feedback indicating which button (1-yes or 2-no) has been pressed without any correct/wrong indication [my experience suggests that without the feedback some subjects often get puzzled with this task]...
The way it is supposed to look is as follows:
However, when I start my paradigm I'm getting this error:
Apologies for bothering... It's probably something straightforward (like incorrect assignment of the variables)...
Could you please suggest what I have to change?
I am attaching two archives:
1.
https://www.dropbox.com/s/zwk23k7rpw6jaek/nback_noFeedback.opensesame.tar.gz?dl=0
[working version without the feedback]
2.
https://www.dropbox.com/s/43fmrsqcmbb246f/nback_wFeedback.opensesame.tar.gz?dl=0
[an effort to implement this feedback with the error]
Thank you very much for your time!
Best,
Alex
Ok..
I think I found a way to implement the feedback eventually...
Here is my working shortened version of n-back: https://www.dropbox.com/s/irvyfzub0j2wqzp/nback_wFeedbackDemoShortened.opensesame.tar.gz?dl=0
However, I am not entirely sure how to fix the logs, which do not seem to generate the output I need...
1. In particular, I'm not sure how to skip the first Ns and not to use them in accuracy calculation...
2. Another issue is that the accuracy seems to be averaged across the trials, whereas I would like to have it calculated separately (e.g. for seq11, seq21, etc)...
Right now the csv-output looks like this: https://www.dropbox.com/s/sndo6um9xzyiixp/subject-777.csv?dl=0
I would really appreciate your suggestions Re these issues...
Thanks a lot,
Alex
Hi Alex,
You can do it pretty much the same way, you decided which feedback to present when. That is, in the
run_if
line of your logger, put something like this:count_OneBack1 >= N
.Opensesame keeps track how often an item is repeated. In your logfile, you will find these
count
-variables. Pick the one that suits you best.The most obvious solution that comes to my mind is defining accuracy yourself. So, on every trial increment a counter of trials per sequence and of correct responses per sequence, calculate the average accuracy, save it as a new variable, e.g.
avg_acc_block
or something similar and finally log it.I suppose, you could also adapt the actual
logger
to make what you want it to, but I think this is more work than necessary.I hope this helped.
Good luck,
Eduard
Hello Alex,
Have you managed to finish your N-back test? I'm trying to implement a visual one but at the moment i'm strugling even to start. Do you still have your version? It would be of great help if could look at one implementation, but unfortunately your links have expired