Howdy, Stranger!

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

Supported by

[open] LineWidth incorrect?

edited March 2015 in PyGaze

Hi folks

If I use 'psychopy' DISPTYPE and perform something like

tscr.draw_line(BGC,spos=(0,503),epos=(constants.DISPSIZE[0],503),pw=1)
tscr.draw_rect(colour=FGC, x=0, y=600, w=constants.DISPSIZE[0], h=1, pw=1, fill=True)

the draw_line produces a 2 pixels wide line whereas the draw_rect produces the desired 1 pixel wide straight line.

If I use 'pygame' I get the correct 1 pixel wide straight line, but at the end the program crashes with
Fatal Python error: (pygame parachute) Segmentation Fault

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

As I am using a simple GUI built with guidata, this crash is not acceptable, so I am forced to use psychopy, but this should work correctly.

Any idea of how to deal with this?

Thanks!

Comments

  • edited 6:48PM

    Hi Rjoos,

    I don't know what causes the 2 pixel width in this line of code. Will it become 4 pixels if you enter pw=2, and would it perhaps accept pw=0.5 to produce pixelwidth 1..?

    Anyway, you could try this: self.screen.append(Line(pygaze.expdisplay, start=(0,503), end=(constants.DISPSIZE[0],503), lineColor=colour, lineColorSpace='rgb', lineWidth=1))

    Or:
    stim = ShapeStim(pygaze.expdisplay, lineWidth=1, vertices=[spos, epos], lineColor='your_colour')

    self.screen.append(stim)

    Let me know if any of this works; otherwise we could turn to a developper to inquire about this!
    Good luck, cheers,
    Josh

  • edited 6:48PM

    Hi Josh

    Maybe I misunderstood your idea; however, if I try

    tscr.append(Line(pygaze.expdisplay, start=(0,530), end=(constants.DISPSIZE[0],530), lineColor=GBC, lineColorSpace='rgb', lineWidth=1))

    I get the error message:

    AttributeError: PsychoPyScreen instance has no attribute 'append'

    Did I implement it the wrong way?

    Roland

  • edited 6:48PM

    Hi Roland,

    The correct snippet would be the following:

    tscr.screen.append(Line(pygaze.expdisplay, start=(0,530), end=(constants.DISPSIZE[0],530), lineColor=GBC, lineColorSpace='rgb', lineWidth=1))
    

    In addition, we have moved away from using the Line class, as it was dysfunctional in newer versions of PsychoPy (not sure whether that is fixed yet). Instead, we opted for using the ShapeStim class with two vertices (starting and ending point of the line). You could try to use the Line class, and I would be very interested in knowing if this a) works and b) fixes your problem.

    If lines are invisible with a penwidth of 1, or aren't wide enough, than this is due to the underlying PsychoPy class. I suggest using a penwidth of 2 (or 3), if this isn't an issue in your GUI design. Alternatively, you could raise the issue on the PsychoPy mailing list.

    On the segfault in your PyGame script: that's a curious one, which most often occurs when PyQt4 and PyGame interact somehow. I am not familiar with the GUI library you mentioned, but this could result in a similar conflict. This is rather unsatisfying, but I don't know how to solve it (or even where to start looking).

    Good luck!

    Edwin

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