psychopy.org | Reference | Downloads | Github

Not all images displaying properly

I am creating an experiment where I display images for .6s and record a response. I have a piece of code the I wrote in the GUI code component that selects the variables that determine what image should show and how long the ITI after it should be for. From my debugging I can tell that the variable selection is working and sometimes the images do display the way I want. Other times it skips images or the screen is blank for awhile.

Let me know what details would be useful for answering.

Thanks in advance for any suggestions!

For a start, post the code you are using. Please put three backticks (i.e. ` ) before and after so that it gets formatted properly.

1 Like

Most of the program is in the GUI, but I have several code components…should I put just my code components here? Since posting this question I think it is a problem with not preloading images during a static period. When I create one of the static periods through the GUI, psychopy creates code that refers to a component name. For example:

        if t >= 0.0 and ISI.status == NOT_STARTED:
            # keep track of start time/frame for later
            ISI.tStart = t
            ISI.frameNStart = frameN  # exact frame index
            ISI.start(0.3)
        elif ISI.status == STARTED:  # one frame should pass before updating params and completing
            # updating other components during *ISI*
            display.setImage(image)
            # component updates done
            ISI.complete()  # finish the static period

Display is what I named the image component in the GUI. If my code to display images in my actual experiment is in the code component, what would replace display in the line of code that says display.setImage(image)?

Here is an example of image display code in my code component:

    if t >= 0.0 and thisGo1Shape.status == NOT_STARTED:
        # keep track of start time/frame for later and set image to show
        thisGo1Shape.tStart = t
        thisGo1Shape.frameNStart = frameN  # exact frame index
        thisGo1Shape.setAutoDraw(True)
    frameRemains = 0.0 + 0.6- win.monitorFramePeriod * 0.75  # most of one frame period left
    if thisGo1Shape.status == STARTED and t >= frameRemains:
        thisGo1Shape.setAutoDraw(False)

thisGo1Shape is a variable selected in a previous routine

I think these users better get at the issue I am having (I have made progress at implementing the static component and image display through the GUI, so some of what I wrote before is not relevant now. Has this issue been resolved: https://github.com/psychopy/psychopy/issues/871