Images in a reaction time experiment

401 views
Skip to first unread message

Samuel Gauthier

unread,
Aug 28, 2013, 9:41:09 AM8/28/13
to psychop...@googlegroups.com

Hi everyone, I'm new to Psychopy wonderful world. I'm building a reaction time experiment with randomized pictures using the Builder approach. I run the whole thing on my Mac (Mountain lion and Psychopy v1.76.00). I downloaded 1.78.00 but haven't run my experiment on that version cause I built it last spring on 1.76.


Here's where I need some advise.  When I run the experiment I have no problem seeing my text section. It stops when the 'trial' (image projection) is suppose start. No image has even dare to say hello to my screen or to me…. My image couldn't be find. Following is the message error that pops.



 Running: /Users/samuelgauthier/Desktop/PsychoPy/expRecherche/MentalRotationTest_lastrun.py 

5.2178 ERROR Couldn't find image file 'image'; check path?

Traceback (most recent call last):

  File "/Users/samuelgauthier/Desktop/PsychoPy/expRecherche/MentalRotationTest_lastrun.py", line 169, in <module>

    target.setImage(u'image')

  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual.py", line 5482, in setImage

    maskParams=self.maskParams, forcePOW2=False)

  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual.py", line 7272, in createTexture

    % (tex, os.path.abspath(tex))#ensure we quit

OSError: Couldn't find image file 'image'; check path? (tried: /Users/samuelgauthier/Desktop/PsychoPy/expRecherche/image)



My images are .png

I use excel (.xlsx) for my conditions. Four columns (image; reverse; orientation; corrAns).


Any hint for me?


Michael MacAskill

unread,
Aug 28, 2013, 8:18:21 PM8/28/13
to psychop...@googlegroups.com
Dear Samuel,

Try putting:
$image

rather than:
image

In the box specifying the filename. The '$' symbol indicates that you want to use the column name 'image' from your .xlsx file rather than a specific file literally called 'image'.

Regards,

Michael
> --
> You received this message because you are subscribed to the Google Groups "psychopy-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-user...@googlegroups.com.
> To post to this group, send email to psychop...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/0ab3588a-729c-4dc3-81e2-5164fbd929c4%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Samuel Gauthier

unread,
Aug 29, 2013, 8:48:09 AM8/29/13
to psychop...@googlegroups.com
Thanks for the advise Michael. I really appreciate you taking the time.

I had already tried that one out and didn't have any positive results. The error message gives pretty much the same indications. Here is what I get when I type $ in front of 'image' in the target properties :

Running: /Users/samuelgauthier/Desktop/PsychoPy/expRecherche/MentalRotationTest_lastrun.py 
10.4672 ERROR Couldn't find image file 'RP.png'; check path?
Traceback (most recent call last):
  File "/Users/samuelgauthier/Desktop/PsychoPy/expRecherche/MentalRotationTest_lastrun.py", line 169, in <module>
    target.setImage(image)
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual.py", line 5482, in setImage
    maskParams=self.maskParams, forcePOW2=False)
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual.py", line 7272, in createTexture
    % (tex, os.path.abspath(tex))#ensure we quit
OSError: Couldn't find image file 'RP.png'; check path? (tried: /Users/samuelgauthier/Desktop/PsychoPy/expRecherche/RP.png)

Are you thinking of anything else that could be wrong? I read through past questions relied to images stuff and didn't find any solution by now.

Samuel

Samuel Gauthier

unread,
Aug 29, 2013, 8:52:22 AM8/29/13
to psychop...@googlegroups.com
Oh, by the way, I my images are in the same folder as my experiment.

Jared Roberts

unread,
Aug 29, 2013, 9:53:15 AM8/29/13
to psychop...@googlegroups.com
Hi Samuel,

You're getting a different error which signifies progress.  :)  It seems that it's correctly reading from your conditions file, so there is something up with the image path.  Based on your path structure, I'm guessing that you're using a Mac.  In any unix based os (including mac) files are case sensitive.  Double check that the case of your file names match exactly with what you have in your conditions file, including the case of the extensions.  Also, Python will not automatically check subfolders for files, so if you have your image files in a subfolder of your experiment directory (maybe "images") you would need to specify that in your conditions file (images\RD.png).  Otherwise, you may want to check the permissions on the file to ensure that you have read permissions.



--
Jared Roberts
Graduate Student
The Yassa Learning and Memory Laboratory
Johns Hopkins University
"A lost cause can be as spiritually satisfying as a victory." - Robert Heinlein

Samuel Gauthier

unread,
Aug 29, 2013, 12:11:08 PM8/29/13
to psychop...@googlegroups.com
Hi Jared,

Thank you very much for these suggestions. Following them I re-doubled checked my file names and made sure the read permission was on my (image) folder. Everything was OK. This whole programming thing is not my 'Forté'. So I tried a few combinaision concerning the subfolder issue you mentionned.

Subfolder:
My .png are in the (image) folder that is in (expRecherche) folder. Thinking that it is a subfolder like you suggested, I tried different labelling in my conditions file : Changing my A1 cell for image\image and image/image didn't work. Even tried labelling each line of my (image) column the same manner. After these trials, my A1 is back to image. Like it use to be.

Tried also having my .png straight in (expRecherche) folder and deleting my (image) folder. That made my Trial part desappeared when I run the experience. Now everything is back the way it was. In the (image) folder. 

So I figure that thing are doing good in a way, the case sensitive possibility is checked, the permission issue too. Any other ideas where the problem may be?

Thank you very much for you help!
Samuel


Jared Roberts

unread,
Aug 29, 2013, 3:32:59 PM8/29/13
to psychop...@googlegroups.com

Hi Samuel,

In your conditions file in each cell in front of the filename, try adding image\.  So the cell should say image\RD.png.  If that doesn't work, do .\image\RD.png

--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

Michael MacAskill

unread,
Aug 29, 2013, 6:05:07 PM8/29/13
to psychop...@googlegroups.com
Except those should probably be forward slashes rather than back slashes:

> image/RD.png

etc.

Cheers.

Mike

Jared Roberts

unread,
Aug 29, 2013, 6:36:35 PM8/29/13
to psychop...@googlegroups.com
I switch operating systems WAY too much.  :)




--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.

Samuel Gauthier

unread,
Aug 30, 2013, 9:12:00 AM8/30/13
to psychop...@googlegroups.com
Thank you guys,

In every cell I tried these 3 versions (and also tried back slashes) :
image/RD.png (psycho py quit without message error)
./image/RD.png (psycho py quit without error message)
/image/RD.png (got error message below)


Running: /Users/samuelgauthier/Desktop/PsychoPy/expRecherche/MentalRotationTest_lastrun.py 

 Running: /Users/samuelgauthier/Desktop/PsychoPy/expRecherche/MentalRotationTest_lastrun.py 
3.9447 ERROR Couldn't find image file '/image/RD.png'; check path?
Traceback (most recent call last):
  File "/Users/samuelgauthier/Desktop/PsychoPy/expRecherche/MentalRotationTest_lastrun.py", line 169, in <module>
    target.setImage(image)
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual.py", line 5482, in setImage
    maskParams=self.maskParams, forcePOW2=False)
  File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual.py", line 7272, in createTexture
    % (tex, os.path.abspath(tex))#ensure we quit
OSError: Couldn't find image file '/image/RD.png'; check path? (tried: /image/RD.png)


Still not getting my images. Any other ideas?
I greatly appreciate your help.
Samuel

Jared Roberts

unread,
Aug 30, 2013, 11:26:57 AM8/30/13
to psychop...@googlegroups.com
Hi Samuel,

When you say that it exits without an error message, what exactly do you mean?  Does it just display a blank screen for some time, then exit normally?  Have you set the display duration,display size,  or display position of the image component?  I'm wondering if it's creating the image objects, but only displaying them either for a few frames or off screen or too small to perceive.

Perhaps sending a screen shot of the properties dialog for your image component would be helpful.

Michael MacAskill

unread,
Aug 30, 2013, 8:13:34 PM8/30/13
to psychop...@googlegroups.com

On 31 Aug, 2013, at 01:12, Samuel Gauthier <samuelga...@gmail.com> wrote:

> In every cell I tried these 3 versions (and also tried back slashes) :
> image/RD.png (psycho py quit without message error)
> ./image/RD.png (psycho py quit without error message)
> /image/RD.png (got error message below)

The last one fails because the path is wrong (it is trying to find a folder called "image" at the root level of your disk, which doesn't exist). That this error doesn't occur in the other cases is useful, as it rules out problems with the filename etc.

The thing to do now is just paste in "image/RD.png" (without the quotes) as the filename for the image stimulus. i.e. don't use the column header variable name from your xlsx file. Does this constant image display properly?

Mike

Michael MacAskill

unread,
Aug 30, 2013, 8:34:25 PM8/30/13
to psychop...@googlegroups.com
I only just saw Jared's message. I think he is right: If there is no error message, it is probably just cycling through very quickly, or displaying at a tiny size due to the other values in the component.

Mike

Samuel Gauthier

unread,
Sep 2, 2013, 9:52:02 AM9/2/13
to psychop...@googlegroups.com
Hi Jared, Hi Mike,

Here's the big picture of my experiment : introduction (text only; pressing any key on the keyboard brings us to trial) - trial (pictures randomized) - thanks (text only)

Here's more details for when I say "quits without message error." When I start the experiment Introduction stays posted (keys seemed unactivate so I can't skip to trial) psycho py quits asking if it has to send a report. That is it.

I just made a screen shot of my image properties and of my xlsx component (N.B. To follow what I understood of Mike's last suggestion I tried image/RD.png and images/RD.png for the filename in the Image column. Both gives the same scenario described in the previous paragraph). Hope that'll help.

Thanks again for those precious suggestions.

Samuel

Capture d’écran 2013-09-02 à 09.38.29.png
Capture d’écran 2013-09-02 à 09.47.20.png
Reply all
Reply to author
Forward
0 new messages