Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

How can I import a image file in inline script

Hi,

How can I import a image file in an inline script and determinate the right coordinates where the file should appear ?

Thanks for reading !

Comments

  • Hi,

    I think this part of the documentation web site might be of help:

    If you have any further questions, please let us know.

    Cheers,

    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • Hi,
    thanks for answering, i found this documentation, but i have to face another problem now.

    I want to display images and just after display a sample, but they have to be displayed in parallel, because I need to collect keyboard response (the task is to identified the instrument playing in the sample, the image are display to help figure out which instrument it is). I discovered that I cant do this with user interface, but im new to programing, so I don't really know what to do in inline script.

    So I have 2 questions :

    Is it possible to call files in an inline script from the pool file with that : [name_of_the_variable] (defined in the loop).

    If not, how can I do it ?

    Thanks

  • Hi Osmose,

    One option:
    Create two images. Both of them include both of your images. Just the position (right/left) is switched.
    Tell your participants to press the 's' (left) or the 'l' key (right) on the keyboard.
    --> You need to present only one image. Just select it randomly.

    How to call in inline_script from pool.

    #this part in prepare phase
    instr_L = canvas()
    path = pool['position_left.tif']
    instr_L.image(path)
    # this part in run phase    
    instr_L.show()
    kb= keyboard(keylist = ['s','l'])
    kb.get_key()
    

    see also http://osdoc.cogsci.nl/3.1/manual/python/canvas/

    Stephan

Sign In or Register to comment.