0

I am trying to import an image as stimuli from an excell spreadsheet. It is at .tiff image and am receiving this eror "targ.setImage(stimuli) NameError:name 'stimuli' is not defined. I named the column in excell 'stimuli' and used 'PsychoPy\VisualCC\Stimuli\targ.tiff' (without the quotations).

In the image properties I named it targ and set the image to $stimuli. From what I can tell this is accurate. Please advise.

Glitch_311

  • I changed the file path to 'PsychoPy\VisualCC\Stimuli\targ.tif' (without the quotations). Deleted the second f in the .tif extension. Though, it is still not working. – Glitch_311 Oct 18 '14 at 06:41

1 Answers1

0

The usual cause for this error is that you need to set the button next to the image field to "set every repeat" rather than "constant".

The variable name "stimuli" only has meaning within the loop that refers to the conditions file containing it, so if the image is set to be constant, when the image is created at the start of the experiment, it tries to use the variable named "stimuli" but it doesn't exist yet.

Michael MacAskill
  • 2,411
  • 1
  • 16
  • 28
  • That will likely fix your first problem (that the "stimuli" variable is unrecognised) but I think then that you will likely find that the path to your image does not look like a valid Windows path. I'm just guessing, but would need to know exactly where you are locating your image files. – Michael MacAskill Oct 18 '14 at 07:09