Howdy, Stranger!

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

Supported by

Error visual analogue scale surface resolution

We have built a visual analogue scale (10 questions) for our fMRI experiment. It seemed to work on our office computer, however when running the experiment on the stimulus pc at the MRI scanner we got an error after the participant tried to answer 0 (scale 0%-100%). Attached a screenshot of the error, apparently it has something to do with the resolution. We already changed the resolution (both in the experiment itself and the monitor of the stimulus pc) but didn't solve the problem.

Does anyone have an idea how to fix this?


Anne Verhallen


  • Hi Anne,

    I think the problem is the variable slider_fill. When the slider is at 0, this variable also has the value zero. And then the width of the rectangle is actually negative (-2) as you can see here:

    my_canvas.rect(slider_x+1, slider_y+1, slider_fill-2, slider_h-2, fill=True)

    This probably gives rise to the error message about invalid dimensions (although it seems version or perhaps operating-system specific, because it doesn't happen for me).

    A few other suboptimalities:

    • You're not clearing or updating the Canvas , but rather continuously adding new elements to it. This may slow things down a lot.
    • You have a 1 ms timeout on the Keyboard, but that's not necessary, because nothing happens unless the participant presses a key.



    There's much bigger issues in the world, I know. But I first have to take care of the world I know.

Sign In or Register to comment.