I’m having a little difficulty with indexing an image from an array that I had previously stored from my encoding phase.
I am trying to randomise the set of 6 (randomly) presented images from the encoding phase and use one of the images for the retrieval phase.
In the end routine of my coding phase I have:
# store the presented shapes for the retrieval phase encStoredShape1= encStoredShape1.append(stimulus1.image) encStoredShape2= encStoredShape2.append(stimulus2.image) encStoredShape3= encStoredShape3.append(stimulus3.image) encStoredShape4= encStoredShape4.append(stimulus4.image) encStoredShape5= encStoredShape5.append(stimulus5.image) encStoredShape6= encStoredShape6.append(stimulus6.image)
In the begin routine of my retrieval phase, I have:
storedShapes = [encStoredShape1, encStoredShape2, encStoredShape3, encStoredShape4, encStoredShape5, encStoredShape6] randShape= retrievalShape= for i in randShape: random.randint(0, len(storedShapes) -1) retrievalShape.append(randShape)
And in the each frame tab I have:
shape_cue = visual.ImageStim(win, image = (retrievalShape)) shape_cue.colorSpace = "rgb" shape_cue.color = [0.168,0.168,0.168] shape_cue.size = 0.3 shape_cue.pos = (0, 0)
I have tried indexing it through: image = shapeValues[retrievalShape] but it throws an indexing error (shapeValues being the array of original stimuli).
Any suggestions on what I could try?