Welcome! Log In Create A New Profile

Advanced

Pre-loading images using MGL

Posted by curiousgeorge 
Pre-loading images using MGL
March 22, 2023 10:27AM
Hi Jaewon,

Background
I'd like to show a sequence of images using ImageChanger, and for this I am trying to pre-load the images before the 1st trial and re-use them through out the session.

I have read through the MGL docs, examples in the tutorials, as well as following this specific forum post where you have shown how to do it for the dms task
[monkeylogic.nimh.nih.gov]


Issue
I get an MGL object ID for each picture using mgladdbitmap and then use that in the timing script with ImageChanger. Issue is that after displaying an object ID once, the ID gets discarded and that stimuli can never be displayed again.

I have used the mglgetallobjects to get all the ids and their status' during the task, and it has confirmed this. The ids are missing after being displayed once.
Also if I use mgladdbitmap on every trial and make a new id every trial, this issue is fixed.


Is there any way to resolve this issue and is there something that I'm missing?

Thank you
Re: Pre-loading images using MGL
March 22, 2023 11:22AM
Try the example in the post you linked. If you see the same problem with the example, check if your NIMH ML is up-to-date. If it is up-to-date, there may be something wrong in what you wrote. However, I cannot tell what you might miss, since you did not show any of your code.

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.