cognitive science
and more

PsychoPy is a powerful Python library for creating the type of stimuli that are frequently used in psychological and neuroscientific experiments. I use it all the time, mostly from within OpenSesame, but I remember that I initially found working with PsychoPy quite daunting. This is because PsychoPy takes a very different approach to stimulus generation than most people are used to. You have to think in terms of patches, textures, and, masks, rather than in conventional drawing primitives, such as rectangles and lines (although newer versions of PsychoPy also support these drawing primitives). Therefore, I decided to write a short tutorial that explains the basics of working with PsychoPy.

In this tutorial, I will explain how to use textures and masks from the ground up. I will assume very little prior knowledge, except a basic understanding of Python. I will assume that you are running OpenSesame, which you can download from here, and comes bundled with all necessary Python libraries. The code snippets below can be pasted directly into an OpenSesame inline_script item. You will probably want to insert a keyboard_response after the inline_script item that contains the code, so you that have the chance to see your stimuli before the experiment finishes!

For your convenience, you can download an OpenSesame template for this tutorial from here:

Overview

Read more »

Happy holidays and an illusory Christmas

In the animation below, you can see a Christmas tree full of baubles. The baubles are arranged in two more-or-less vertical columns, but not quite: Some are shifted a bit to the left, some a bit to the right. Or are they? In actuality, of course, the baubles are arranged in two perfectly straight columns. The apparent displacement is caused by the motion of the stripes on the baubles.

This illusion is a demonstration of motion-induced displacement: the phenomenon that the perceived position of an object is affected by its motion (or motion in the object’s environment, as I’ve shown before). This effect is particularly strong if an object’s position is ill-defined, for example because it has fuzzy edges like our baubles here.

The first to show this (that I know of) were Leonard Matin and his colleagues. They showed that two line-segments that rotated around a central dot appeared to be shifted in the direction of their movement. This is similar to what happens to the perceived position of the ‘baubles’ in the animation shown above: When the texture of the bauble is moving to the right, the position of the bauble appears to shift to the right as well. The fact that the bauble itself is not moving (just its texture) is a nuance that is lost on our visual system: Essentially any kind of nearby motion will ‘grab’ the object and perceptually drag it along.

The obvious question is whether motion-induced displacement serves a …

Read more »

Running psychological experiments on a tablet with OpenSesame

Since this post, the OpenSesame runtime has been ported to Android. This provides an even easier way to run experiments on a tablet device. For more information, see http://osdoc.cogsci.nl/getting-started/android/.

As you can see in the video below, it is possible to run OpenSesame on a tablet! This way you can take your experiments anywhere.

I will post more detailed instructions on the OpenSesame documentation page soon, but for now some basic info should get you started: The operating system that you see in the video is Ubuntu Linux. The tablet is a Nexus 7. Installing Ubuntu onto a Nexus 7 tablet is a straightforward process, and so is restoring the device to it's factory settings. Once you have Ubuntu running on your tablet, you can install OpenSesame directly from the Cogsci.nl PPA.

Read more »

The beauty of being wrong: A plea for post-publication revision

I realize that most of what I will ever write as a scientist is wrong. Not because it is obviously wrong when I write it, or because I don't believe in my own research. But simply because virtually every insight is eventually replaced by some newer and generally more accurate insight. This is true even for the great theories of the likes of Darwin, Einstein, and Newton. And it is certainly true for the minor contributions of the remaining 99.99% of the research population, for whom supersession generally occurs quite rapidly.

Unfortunately, there are no such signs in science

Perhaps this sounds depressing, but it's really not. It's just a (negative) way of describing progress. It's a good thing. Scientists should be encouraged to acknowledge the wrongness of their theories, to find out what's so wrong about them, and to replace them by newer theories that are still wrong, but less so. You could even argue that the possibility of being wrong is what differentiates science from opinionist fields such as philosophy, art, and economics.

But the ideal model of a scientist who continually seeks to disprove himself is not very compatible with human nature. Being human after all, scientists hate to be proven wrong, and will go through great lengths (including plain denial) to avoid this from happening. Nevertheless, given a healthy environment, scientists can, to some extent, overcome their innate dislike of being wrong. But only given a healthy scientific environment. And this is, in my opinion, where things go, well... wrong.

Lately, there has …

Read more »

A name-letter effect in the Dutch elections?

I recently went back home, to Amsterdam, and my visit coincided with the Dutch elections. I voted for GroenLinks, as I always do. But unlike at previous elections, I had some doubts. Why? Not because I was unsure about GroenLinks' political programme. (I haven't read it.) And not because I was disappointed with GroenLinks' past performance. (I don't really keep track.)

Femke Halsema (photo: Harold Pereira)

No. Presumably, I was doubting because Femke Halsema stepped down as GroenLinks' leading lady. Halsema was a very cable woman, but more than anything else she was attractive. She has been replaced by Jolande Sap, who might be equally capable, but is not nearly as attractive.

Of course, I'm not the only person who is influenced by such superficial things as facial attractiveness or perceived competence. Quite a few studies have shown that the outcome of an election can be predicted reasonably well by people's initial reaction to pictures of the candidates' faces. And when I say 'initial' I mean within a few hundred milliseconds.

The nice thing about elections (if you're a geek) is that it gives you a lot of data to play with. In case you're interested, you can obtain the results of the Dutch elections in spreadsheet format from here. Using this data, I figured it would be interesting to see if voting patterns are influenced by another subliminal phenomenon: The name-letter effect.

The name-letter effect refers to the phenomenon that people like their own initials so much that they tend to choose professions and …

Read more »