Does anyone know if it is possible to make a glowing boundary/edge appear around an imagestim after a mouse click event? What function can I use?
--
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/036dfb4e-25ff-4017-b4ca-6d5b64694b40%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thanks for the reply, a highlighted edge will certainly be fine. However, I need to have multiple image stimuli be selectable and deselectable. Why would this be particularly difficult?
I have a similar usage for glowing/highlighting a stim-image. I have two side-by-side pictures, and have the participants pick either by pressing a designated key on the keyboard. This is going in a loop a couple of times. Any idea on how to code such a thing?
--On Sunday, March 1, 2015 at 9:43:21 PM UTC-5, Jeremy wrote:Hi Colby,There's not built-in function but a simple highlight is easy with a little code.If your image is defined like this:img = visual.ImageStim(win, 'image.png')you can define a boundary like this (at the start of a routine, prior to a drawing loop):border = visual.ShapeStim(win, vertices=img.verticesPix, units='pix', lineColor='red')Then inside a draw-loop (Every frame) you can doif mouse.isPressedIn(img):border.autoDraw = TrueTo get a "glowing" highlight would be more effort, because you need to update the border's appearance on every frame. To be able to "unselect" the image is also more complex for a couple reasons.--JeremyOn Sun, Mar 1, 2015 at 9:20 PM, Colby Tibbets <colby....@gmail.com> wrote:Does anyone know if it is possible to make a glowing boundary/edge appear around an imagestim after a mouse click event? What function can I use?--
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/036dfb4e-25ff-4017-b4ca-6d5b64694b40%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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/dc0fad14-3efd-4302-9f2f-ffb45f286aed%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/7fa4eb87-77c6-4c9f-8c35-886fe0cd5ea4%40googlegroups.com.
I think that I like better the highlight solution, but I can't get it to work.Just for the context - I have a csv file with two columns filled with different pictures. In this trial, pairs of pictures from both columns are presented, and the participant is asked to pick either by pressing left/right key.In the Begin Routine part of the code I inserted this:border = visual.ShapeStim(win, vertices=iimage.verticesPix, units='pix', lineColor='red') ### iimage is the name of the image stimuli.
Then, in the Each Frame part I inserted this:if key_resp_2=="left": ### key_resp_2 is the keyborder.autoDraw=True
I've also tried the code that you wrote for glowing effect instead of what below, but that didn't work either.What am I doing wrong?
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/47845436-7ac5-42fb-92d6-3ffcf7fe39bb%40googlegroups.com.
OK sorry, the highlighting works well (had a minor typo - was supposed to be: key_resp_2.keys=='left')- Is there a way to make the highlighting line a bit thicker?
I still can't get the glowing effect to work...
- The highlighting persists throughout the entire sets of pairs - that is, though the picture itself changes, its frame continues to be highlighted. How can I make the highlight persist for a second and then go back to normal (until the next time a certain key is being pressed)?
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/e3ccde4d-9e49-4c56-8b63-699a9ee53a12%40googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "psychopy-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/psychopy-users/Rv3VnQulnrQ/unsubscribe.
To unsubscribe from this group and all its topics, 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/CANqwJFgPf1dvzN-7pm9ULGy_99DnNKyo%2BSm1wUHF9tvWntG3Yg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/CAMBcNxd4AD_BhhfNiTb3cWtLMOaeXVF%2BNPYtt0_UwPY4qpY2bA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/CANqwJFj41rUKux3QFMHv9fgV1zqp-udgjXcpZ3pKoTYRWC7qPA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/CAMBcNxegirEx94f6nSJ-n2egk7V3CnBxiHD1Eaa__wxR2Us62g%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/CANqwJFidexndy4MqKoCGirgDmHaWRA-mjG4Ey1Y%2BmvvYni%3DzhQ%40mail.gmail.com.
Thanks, but that brings me back to the same problem - now the line doesn't appear at all. It is as if the newest addition automatically and immediately cancels out the drawing of the line.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/CAMBcNxffi-ceAPA-MUTj9Q8Y%3DJu8UrhrC9qe%2BvboYBTMv9VUbQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/CANqwJFitiPPhNZdUmfF7Na2ubWsi45YeDEUq_R%2B4bQ__vp_QDg%40mail.gmail.com.
OK - that solved the border problem! Now the border stays with the picture, disappears in the right time, and comes back to the new picture given a key pressed. Beautiful!
However - even after I press a key (left or right), I still have to press 'space' in order to finish/end the routine. Otherwise, I'm stuck at the same step. Any advise on that?
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/CAMBcNxdk%2B4owsR80ntCxvm9d5k4NvZSghXvhrdSSN7dNT7wBLA%40mail.gmail.com.
OK - that solved the border problem! Now the border stays with the picture, disappears in the right time, and comes back to the new picture given a key pressed. Beautiful!
However - even after I press a key (left or right), I still have to press 'space' in order to finish/end the routine. Otherwise, I'm stuck at the same step. Any advise on that?
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/CAMBcNxdk%2B4owsR80ntCxvm9d5k4NvZSghXvhrdSSN7dNT7wBLA%40mail.gmail.com.