Howdy, Stranger!

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

Supported by

gabor patches in a code (v 4.0.4/5)

Hi everyone

I'm trying to create an enumeration task with equal luminance for all conditions and for that I want to use Gabor elements. I used Sigmund AI to write the code, but whatever I'm doing, it always sends errors about wrong use of colors. Every time Sigmund corrects it, I'm getting the same error, so I'm in this terrible loop.

Is it a bug? Is it me? I'll appreciate any insight...


Best,

Tali

Comments

  • edited March 22

    Hi @labovich,

    I couldn't recreate your error with colour unfortunately. I got some errors about your canvas and keyboard items instead. Here's a corrected version that goes through your loop without any issue, but with the values you set in the script, the patches show up in the right corner of the screen, which I'm pretty sure isn't what you had in mind.

    Can you tell me what the gabor patches should look like? Do you still get the error about colours with this version? If yes, could you send it to me?

    Claire

  • Hi @cvanbuck

    Thank you so much for the code!

    I tried to run it (current version, windows 10), and right after the welcome slide got this error message:


    Traceback (most recent call last):
      File "<new_inline_script.prepare>", line 68, in <module>
      File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\openexp\_canvas\canvas.py", line 1014, in gabor
        self += Gabor(x, y, orient, freq, env=env, size=size,
      File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\openexp\_canvas\canvas.py", line 382, in __iadd__
        self['stim%d' % self._stimnr] = element
        ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\openexp\_canvas\canvas.py", line 351, in __setitem__
        value = value.construct(self)
                ^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\openexp\canvas_elements.py", line 36, in construct
        return cls(canvas, *self._args, **self._kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\openexp\_canvas\_gabor\gabor.py", line 29, in __init__
        Element.__init__(self, canvas, x=x, y=y, orient=orient, freq=freq,
      File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\openexp\_canvas\_element\element.py", line 60, in __init__
        self.prepare()
      File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\openexp\_canvas\_gabor\legacy.py", line 30, in prepare
        im = canvas._gabor(
             ^^^^^^^^^^^^^^
      File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\openexp\_canvas\canvas.py", line 1171, in _gabor
        col1 = _color(col1)
               ^^^^^^^^^^^^
      File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\openexp\_canvas\canvas.py", line 1121, in _color
        return Legacy(None, col).backend_color
               ^^^^^^^^^^^^^^^^^
      File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\openexp\_color\color.py", line 66, in __init__
        self.hexcolor = self.to_hex(self.colorspec)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\openexp\_color\color.py", line 99, in to_hex
        raise InvalidColor(colorspec)
    libopensesame.exceptions.InvalidColor: 
    Error: InvalidColor
    
    Invalid color specification: #ffffff
    
    This error occurred in the prepare phase of item new_inline_script.
    


  • edited 12:49PM

    Hi @labovich,

    I see; have you tried putting 'white' (between quotes) instead of #ffffff already? (for the col1 parameter)

    Claire

  • yes...

    Error: PythonError

    Error while executing inline script (prepare phase)

    This error occurred on line 99 in the prepare phase of item new_inline_script.

    Traceback (most recent call last):
      File "
    


  • edited 1:07PM

    Weird... Both work for me... Maybe try uninstalling Opensesame completely, and reinstalling it with the installer package if this hasn't been done before? Are you up-to-date with your Python version too?

  • Thanks @cvanbuck ! re-installing actually worked!

  • edited 1:47PM

    No worries, it might just have been some corrupted files or whatever, glad it works now! :)

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games