psychopy.org | Reference | Downloads | Github

Show Picture for 3 Frames


#1

URL of experiment: https://pavlovia.org/run/huppfi/essensstudie/html/

Description of the problem: I am trying to show my Stimulus Picture for 3 frames. Now I know that I should be preloading all of the images necessary so that is actually possible.

My code for that is as follows(primelistA is just a list of the image paths):

image

Side question here how would I access member Variables of the ImageStim class? E.g get the name of the image file.

Now that I preloaded all the images I want to show them in another routine like this:

image

This however raises following error:

I feel like I am doing the Draw call wrong but I have no idea what the right way is.


#2

Hi @huppfi, have you tried setting autodraw? E.g., stim.setAutoDraw(true);. Also, you may want to declare your variables in your for loops e.g., for (var file of primelistA) {


#3

@dvbridges thanks that seems to work now! But setting the AutoDraw to false does not make the picture disappear. Is there a way to do that without setting the opacity to 0.0?

Also do you have any Idea how to get the Image name from a ImageStim object?


#4

Sure, have you tried image.name or image.getName()? Or are you trying to get the actual filename?


#5

@dvbridges yeah I am trying to get the actual Filename. getName works fine for getting the name of the ImageStim.

But it’s more important that I get the Picture off my screen again after stim.setAutoDraw(true);
it just stays there eventhough I set opacity to 0.


#6

@dvbridges I think I figured out the problem.

Currently I just have a code component that draws the Stimulus. And in that component I do the following:

I believe that Psychopy is immediately skipping over the Routine and it never gets to Frame 3. Is there a way I can force it to wait for 3 frames?


#7

Im having trouble debugging your exp at the minute because stimname is not defined. You might want to define this as let stimname = ...etc or var stimname - ...etc.