Howdy, Stranger!

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

Supported by

Eye-tracking sentence reading: definition of areas of interest

Hi all,

I know similar questions have been asked before, but I couldn't really find a thread on this issue – apologies in advance if I've missed it or it's something very basic that I'm missing.
I'm quite new to programming eye-tracking experiments in OpenSesame (and I'm not an OpenSesame expert in general), and I'm currently trying to program quite a basic sentence reading task.
All sentences contain different words, but follow this basic structure:
[chunk1] [chunk2] [chunk3] [chunk4] [chunk5] [chunk6] [chunk7] [chunk8]
In each sentence, our target items – that should be areas of interest – are chunk4 and chunk5, which occupy different positions in each sentence, based on the length of those words and of the previous ones. Therefore, defining interest areas based on x and y coordinates doesn't seem to help much, here, as they vary every time.
So, here's the core of my question: I'd like to know if it's possible to define as areas of interest certain parts of each sentence, as defined by the labels we adopted (in our case, say, the words that occupy chunk4 and chunk5 in each sentence).
Also having an interest area for all of the 8 chunks would be fine, of course, as I can select a posteriori which interest areas I want to analyze, in terms of eye movement measures.

Any suggestion or advice is most welcome.

Thanks a lot,
Valentina

Comments

  • Hi Valentina,

    That's a a good question. As of v3.2, Canvas elements can have a name, and you can therefore use them to define regions of interest (ROIs). The next question is then how to define ROIs for separate words in a sentence. There are many ways to do this, but one way is to split the sentence into individual words, see how much space they take up, and then define a region of interest for each word through a named Rect() element.

    The script below shows a function (draw_roi_text()) that does this. The end product is a Canvas object with named elements that you can subsequently use, in whatever way you need to, for an ROI analysis.

    Cheers!
    Sebastiaan

    def draw_roi_text(c, text, x=0, y=0, show=False, **kwargs):
    
        """Draws text to a Canvas and additionally defines an ROI for each word and
        following space. The ROIs are named Canvas elements. The show keyword
        indicates whether the ROIs should be colored for visual debugging.
        """
    
        roi_x = x
        roi_y = y
        for i, word in enumerate(text.split()):
            # Words
            w, h = c.text_size(
                u'<span style="background:red;">%s</span>' % word,
                center=False,
                **kwargs
            )
            # Define ROI for word
            c['word%d' % i] = Rect(
                roi_x,
                roi_y,
                w,
                h,
                color='red' if show else var.background,
                fill=True
            )
            roi_x += w
            # Spaces
            w, h = c.text_size(
                u'<span style="background:red;">&nbsp;</span>',
                center=False,
                **kwargs
            )
            # Define ROI for word
            c['space%d' % i] = Rect(
                roi_x,
                roi_y,
                w,
                h,
                color='green' if show else var.background,
                fill=True
            )
            roi_x += w      
        c.text(text, x=x, y=y, center=False, **kwargs)
    
    
    c = Canvas()
    draw_roi_text(c, 'This is a string', show=False)
    c.show()
    
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