Category Archives: Hardware

Psychology experiments enter the post-PC era: OpenSesame now runs on Android

smartphones-picard-uses-androidI’ve mentioned OpenSesame briefly on here before, but for those of you who weren’t keeping up, it’s a pretty awesome, free psychology experiment-developing application, built using the Python programming language, and it has a lot in common with PsychoPy (which is also awesome).

The recently-released new version of OpenSesame has just taken an important step, in that it now supports the Android mobile operating system, meaning that it can run natively on Android tablets and smartphones. As far as I’m aware, this is the first time that a psychology-experimental application has been compiled (and released to the masses) for a mobile OS.

This is cool for lots of reasons. It’s an interesting technical achievement; Android is a very different implementation to a desktop OS, being focused heavily on touch interfaces. Such interfaces are now ubiquitous, and are much more accessible, in the sense that people who may struggle with a traditional mouse/keyboard can use them relatively easily. Running psychology experiments on touch-tablets may enable the study of populations (e.g., the very young, very old, or various patient groups) that would be very difficult with a more ‘traditional’ system. Similarly, conducting ‘field’ studies might be much more effective; I can imagine handing a participant a tablet for them to complete some kind of task in the street, or in a shopping mall, for instance. Also, it may open up the possibility of using the variety of sensors in modern mobile devices (light, proximity, accelerometers, magnetometers) in interesting and creative ways. Finally, the hardware is relatively cheap, and (of course) portable.

I’m itching to try this out, but unfortunately don’t have an Android tablet. I love my iPad mini for lots of reasons, but the more restricted nature of Apple’s OS means that it’s unlikely we’ll see a similar system on iOS anytime soon.

So, very exciting times. Here’s a brief demo video of OpenSesame running on a Google Nexus 7 tablet (in the demo the tablet is actually running a version of Ubuntu Linux, but with the new version of OpenSesame it shouldn’t be necessary to replace the Android OS). Let me know in the comments if you have any experience with tablet-experiments, or if you can think of any other creative ways they could be used.

TTFN.

 

Another miscellaneous grab-bag of goodies, links ‘n’ stuff

the-linksIn lieu of a ‘proper’ post (forgive me, dear readers, the vicious task-masters at my proper job have been wielding the whip with particular alacrity recently) I’m putting together a list of links to cool things that I’ve come across lately.

So, in no particular order:

Tal Yarkoni’s outstanding Neurosynth website has now gone modular and open-source, meaning you can embed the code for the brain-image viewer into any website, and use it to present your own data – this is seriously cool. Check out his blog-post for the details.

An interesting little comment on “Why Google isn’t good enough for academic search”. Google scholar tends to be my first port of call these days, but the points made in this discussion are pretty much bang-on.

A fantastic PNAS paper by Kosinski et al. (2013; PDF) that demonstrates that personal attributes such as sexual orientation, ethnicity, religious and political views, some aspects of personality, intelligence and many others, can be automatically and accurately (to a fairly startling degree, actually) predicted merely from analysis of Facebook ‘Likes’. A fantastic result, that really demonstrates the value of doing research using online data.

Next up is Google Refine – an interesting little idea from Google intended to assist with cleaning up and re-formatting messy data. Looks like it could be promisingly useful.

A really seriously great website on the stats language R, designed to make the transition for SPSS and SAS users as easy as possible – very clear, very nicely explained. Beautiful stuff.

Another cool website called citethisforme.com; you fill in fields (author, title, etc.) for sources you wish to cite, and it creates a perfectly formatted bibliography for you in the style (APA, Harvard etc.) you choose. A cool idea, but in practice, filling out the fields would be incredibly tedious for anything more than a few sources. Good place to learn about how to format things for different types of reference though.

I’ve previously written about the use of U-HID boards for building USB response devices; I’ve just been made aware of a similar product called Labjack, which looks even more powerful and flexible. A Labjack package is included in the standard distribution of PsychoPy too, which is cool. I’m becoming more and more a fan of PsychoPy by the way – I’m now using it on a couple of projects, and it’s working very well indeed for me.

Now a trio of mobile apps to check out. Reference ME is available for both iOS and Android, and creates a citation in a specific style (Harvard, APA, etc.) when you scan the barcode of a book – very handy! The citations can then be emailed to you for pasting into essays or whatever.

The Great Brain Experiment is a free app from the Wellcome Trust (download links for both iOS and Android here) created in collaboration with UCL. The aim is to crowdsource a massive database on memory, impulsivity, risk-taking and other things. Give it a whirl – it’s free!

Lastly Codea is a very cool-looking iPad-only app that uses the Lua programming language to enable the (relatively) easy development and deployment of ‘proper’ code, entirely on the iPad. Very cool – Wired called it ‘the Garage Band of coding’, and while it’s probably not quite that easy to use, it’s definitely worth checking out if you want to use your iPad as a serious development tool.

If you’re still hungry for more internet goodies, I encourage you most heartily to check out my Links page, which is currently in an ongoing phase of rolling development (meaning, whenever I find something cool, I put it up there).

TTFN.

 

Website of the week: Cogsci.nl. OpenSesame, illusions, online experiments, and more.

A quick post to point you towards a great website with a lot of really cool content (if you’re into that kind of thing, which if you’re reading this blog, then I assume you probably are… anyway, I digress; I apologise, it was my lab’s Christmas party last night and I’m in a somewhat rambling mood. Anyway, back to the point).

So, the website is called cogsci.nl, and is run by a post-doc at the University of Aix-Marseille called  Sebastiaan Mathôt. It’s notable in that it’s the homepage of OpenSesame -  a very nice-looking, Python-based graphical experiment builder that I’ve mentioned before on these very pages. There’s a lot of other cool stuff on the site though, including more software (featuring a really cool online tool for instantly creating Gabor patch stimuli), a list of links to stimulus sets, and a selection of really-cool optical illusions. Really worth spending 20 minutes of your time poking around a little and seeing what’s there.

I’ll leave you with a video of Sebastiaan demonstrating an experimental program, written in his OpenSesame system, running on a Google Nexus 7 Tablet (using Ubuntu linux as an OS). The future! It’s here!

Buying some new gadgets for college? Engadget has you covered.

So, it’s the time of year when A-level results come out (in the UK, anyway) and students’ thoughts fondly turn to the start of the college/University year in October when they can finally experience some spatial (if perhaps not financial) independence from their parents. And these days, if you aren’t already fully equipped with all the tools necessary to make a success of your time at University then it’s time to start smiling sweetly at Mum and Dad to make sure they’ll give you what you need in time for the start of term. And by ‘tools’ I mean technology, not a six-foot bong and a jumbo-pack of prophylactics.*

Fortunately, Engadget has you covered for all your gadget-related decisions with their excellent annual back-to-school guides. These are short reviews of the top picks by the editors at Engadget in a variety of categories of gadgets/technology such as laptops, digital cameras and electronic readers. Useful stuff if you’re pondering a new purchase to get you through the school year, and there’ll be more to come in the next few weeks so keep checking Engadget.

TTFN.

*Though, those wouldn’t hurt as well.

Tablet computers (iPad, Nexus 7, etc.) for children with developmental disorders

A very minimal post merely to point any interested readers towards an interesting discussion going on in the comments section of a post on Engadget here. A reader asked for suggestions for a tablet and/or apps for his developmentally-delayed daughter, and a large number of people have contributed some useful ideas and links. Just try to ignore the (inevitable *sigh*) Android vs. iOS fan-boy squabbling.

Seriously cool toys – Tobii mobile eye-tracking glasses, Pivothead HD video-recording eye-wear, and the Affectiva Q-sensor

The Tobii mobile eye-tracking system. Awesome.

The other day I was lucky enough to be able to help out with a bit of data-collection in a well-known London department store, being run by the magnificent Tim Holmes of Acuity Intelligence. This meant that I got to examine some seriously cool bits of new hardware – and new gadgets (especially scientific ones) are basically my kryptonite, so it was generally pretty exciting.

The first thing we used was a mobile eye-tracking system designed and built by Tobii. These have two cameras in – one front-facing to record video of what the participant is looking at, and another infra-red camera to record the participant’s exact eye-position. They can also capture sound in real-time too, and record the eye-tracking data at 30Hz. The system comes with a clip-on box where the data is actually recorded (in the background of the picture on the right) and which is also used for the (fairly brief and painless) initial calibration. It seems like a really great system – the glasses are very light, comfortable and unobtrusive – and could have a really broad range of applications for research, both scientific and marketing-related.

The next cool toy I got to play with was a pair of these:

Pivothead ‘Durango’ HD video-recording glasses. Double awesome.

These are glasses with a camera lens in the centre of the frame (between the eye-lenses) which can record full high-definition video – full 1080p at 30 fps, using an 8Mp sensor. Amazing! They have an 8GB onboard memory which is good for about an hour of recording time, and also have a couple of discreet buttons on the top of the right arm which can be used for taking still pictures in 5-picture burst or 6-picture time-lapse mode. They’re made by a company called Pivothead, and seem to be more intended for casual/recreational/sports use rather than as a research technology (hence the ‘cool’ styling). They’re a reasonably bulky pair of specs, but very light and comfortable, and I don’t think you’d attract much attention filming with them. It’s worth checking out the videos page at their website for examples of what they can do. They’re also only $349 – a lot for a pair of sunglasses, but if you can think of a good use for them, that seems like a snip. If you’re in the UK, they’re also available direct from the Acuity Intelligence website for £299, inc. VAT. I wonder how long it’ll be before they start showing up in law-enforcement/military situations?

The third device I got to geek-out over was one of these little beauties:

The Affectiva mobile, wrist-worn, bluetooth GSR sensor. Triple awesome.

This is a ‘Q-Sensor’, made by a company called Affectiva and is about the size of an averagely chunky wristwatch. It has two little dry-contact electrodes on the back which make contact with the skin on the underside of the wrist, and also contains a 3-axis accelerometer and a temperature sensor. This little baby claims to be able to log skin conductance data (plus data from the other sensors) for 24 hours straight on a single charge, and will even stream the data ‘live’ via Bluetooth to a connected system for on-the-fly analysis. It seems like Affectiva are mainly pitching it as a market research tool, but I can think of a few good ‘proper’ research ideas that this would enable as well. This is seriously cool technology.

That’s all folks – TTFN.

The effects of hardware, software, and operating system on brain imaging results

A recent paper (Gronenschild et al., 2012) has caused a modicum of concern amongst neuroimaging researchers. The paper documents a set of results based on analysis of anatomical MRI images using a popular free software tool called FreeSurfer, and essentially reports that there are (sometimes quite substantive) differences in the results that it produces, depending on the exact version of the software used, and whether the analyses were carried out on a Mac (running OS X) or a Hewlett Packard PC (running Linux). In fact, even the exact version of OS X on the Mac systems was also shown to be important in replicating results precisely.

Figure 3 of Gronenschild et al. (2012) showing the effect of different versions of FreeSurfer on obtained grey-matter volume results. Percentage scale at the top, p-values on the bottom.

The fact that results differ from one version of FreeSurfer to another is perhaps not so surprising – after all, we expect that newer versions of software should be ‘improved’ in important ways, otherwise, what would be the point in releasing them? However, the fact that results differ between operating systems is a little more worrying – in theory any operating system capable of running the software should produce the same result. The authors recommendations are that 1) Researchers should not switch from one version/operating system/platform to another in the middle of a research project, and 2) that when reporting results software version numbers, and the workstation/OS used should all be documented. This seems broadly sensible.

It got me thinking about neuroimaging software more generally as well though. In general, people don’t do detailed evaluations of software of the kind reported by Gronenschild et al. (2012).  As an enthusiastic user of several fMRI-related packages (I’m currently using SPM, FSL and BrainVoyager, all on different projects) I’ve often wondered what the real differences were between them, in terms of the results they produce. Given how many people around the world use brain imaging software, you might think that some detailed evaluations would be floating around, but in fact there are very few.

I think there are several reasons for this:

1. It’s (perhaps understandably) regarded as a waste of time. After all, we (meaning researchers who use this software) are generally more interested in how the brain works, than by how software works. Neuroimaging is difficult and time-consuming and we all need to publish papers to survive – it makes more sense to spend our time on ‘real’ brain-related research.

2. Most people have one (or at most two) pieces of software that they like to use for neuroimaging, and they stick with it; I’m somewhat unusual in this respect. The fact that most people use just one package more-or-less exclusively means there’s a dearth of people who actually have the skills necessary to do cross-evaluation of packages. Again, this is understandable – why take the time to learn a new system, if you’re happy with the one you’re using?

3. The differences between the packages make precise comparison of end-results difficult. Even though all the packages use an application of the General Linear Model for basic analysis, other differences in pre-processing conceivably play a role. For instance, FSL handles the spatial transformation of functional data somewhat differently to other packages.

Having said that, there have been a few papers which have tried to do these kind of evaluations. Two examples are here (on motion correction) and here (on segmentation). Another somewhat instructive paper is this one, which summarises the results of a functional-imaging analysis contest held as part of the Human Brain Mapping meeting in Toronto in 2005; developers of popular neuroimaging software were all given the same set of data and asked to analyse it as best they could. Interesting stuff, but as the contestants all used somewhat different methods to get the most out of the data, it’s hard to draw direct comparisons.

If there’s a moral to this story, it’s that (as the recent Gronenschild et al. paper demonstrates) we need to pay close attention to this kind of thing. As responsible researchers we cannot simply assume our results will be replicable with different hardware and software, and detailed reporting of not just the analysis procedures, but also the tools used to achieve the results seems a simple and robust way of at least acknowledging the issue and enabling more precise replicability. Actually solving the issues involved is a substantially more difficult problem, and may be a job for future generations of researchers and developers.

See also:
My previous post on comparisons of different fMRI software: Herehere and here.
Neuroskeptic has also written a short piece on the recent paper mentioned above.

TTFN.

iPad app for generating visual psychophysics stimuli

I’ve been meaning to write a new post which would be an update to my previous one on good psychology-related iPhone/iPad apps for a while now, but I just came across one app which is just too good not to share immediately. It’s a free app called RFSpotter, written by Nicolas Cottaris of the  IRCS and Dept. of Psychology at The University of Pennsylvania, and it generates simple visual psychophysics stimuli for use in mapping receptive fields and the tuning properties thereof. It has a very slick interface, where stimulus size, position and rotation can all be controlled by the usual iOS finger-gestures (e.g. pinch-to-zoom to change stimulus size, two-finger rotation for orientation) with many other parameters editable through a pop-up menu. It will do gratings, patches, dot-clouds, coloured stimuli – all kinds of things! Very, very neat indeed.

See this page for more details and a video of it in action, and visit the iTunes store here to download it.

Some screenshots:

The iPad really has the potential to be a serious platform for research, and it’s tools like this that will make it possible to do some really interesting work with it – here’s hoping we see many more specialist, research-oriented apps like this in the future!

More on response hardware: parallel port and USB.

I received a couple of e-mails this week from the inimitable, the mighty, the intrepid Prof. Chris Rorden, related to one of my earlier posts about parallel port response boxes. This pleased me greatly a) because he sent me a butt-load of really great information and links that I hadn’t been aware of, and b) because it’s exactly the kind of interaction with researchers that I was hoping that this blog would initiate.

Anyway, he pointed out a lot of new information. First of all, the paper that I cited from 2007 was essentially a re-tread of an older paper from 1992 which also has some nice circuit diagrams in, as well as some useful Turbo Pascal code (does anyone use Turbo Pascal anymore? I guess someone must…). He also directed me to this page which has a lot of information and circuit diagrams for experimental control of a PC.

Another hint he passed on was that on some computers the D0-D7 pins on the parallel port are not bidirectional – so may not work well for some applications, but the C0-C3 pins apparently always work for this kind of application (bottom right in the diagram below).

Parallel port pin diagram showing the three registers (data, status and control) and the ground pins (in green)

Regarding using USB input – he pointed me to this fascinating paper (PDF here) which has some theoretical analyses related to the relationship between true and measured RT, with limited resolution clocks. The surprising conclusion is that even with a clock with only a 30ms resolution, the effect on measured RT is negligible. This means that the 125Hz/8ms default USB-polling rate might not be such a big problem after all. Of course one should still be very careful about using ‘standard’ USB devices (i.e. keyboards, mice) for response timing as they can introduce significant errors as well.

Most interestingly, he pointed me towards a really sexy little device board from a company called U-HID.

The U-HID board – takes an input and transforms it into any kind of ‘standard’ computer input (key press, mouse-click, game-pad button – whatever!). Awesome.

What this does, in Chris’ words is:

“This allows 8 digital inputs to be read through the USB port. What is great is that it comes with software that allows you to assign any input to any keyboard or mouse button. The included software allows you to flash these changes to the device, so afterwards any computer will see the mappings you assigned. By default, this has a pretty good polling rate of 5ms.”

So, you can attach any kind of switch or input on one end, and when that switch is closed, the computer will see it as a key-press, a mouse-click, or whatever else you assign to it. The ‘Nano’ version of the board is really tiny, and is available from this site for only $35! This looks to be an incredibly useful bit of kit, and is probably the best solution I’ve seen for hooking up arbitrary devices to a USB input – really cool. Chris mentioned that he uses these boards for collecting responses in experiments, and also for reading the optical triggers from a Siemens Trio MRI scanner with his EZlog software (described here).

So – fantastically useful information – many thanks Chris! I’m a fan of keeping things simple, and parallel port inputs for collecting reaction times are certainly a good and easy solution; unfortunately parallel ports are largely obsolete these days, and most new computers don’t have them. The cards are still available for desktops, but in a few years these simple in-out ports may be completely unavailable. We’ll all have to move to USB devices at some point, and the U-HID boards are definitely the best-looking (and cheapest!) solution I’ve seen. I am definitely going to order a couple to try out.

Anyone else have any experience with the U-HID boards? Let me know in the comments. TTFN.

How to make your own parallel port response boxes

I’ve previously written about the importance of response hardware for doing timing-accurate experiments – in a nutshell, anything you connect via USB is likely to be sub-optimal,* because the operating system only polls (or looks for an input) on the USB port some of the time – in Windows the USB polling rate is 125Hz, or every 8ms.

So, for accurate timing of responses, we want to use something other than the USB port. There are various options – my personal favourite is to use the 25-pin parallel (or ‘printer’) port. Some newer desktop models unfortunately don’t have parallel ports anymore, as they’re largely obsolete for connecting peripherals, however any model older than two or three years should have one – and you generally don’t need a super-fast, up-to-date computer for running stimulus programs and collecting data.

I needed a couple of response boxes for a project recently, and decided to just make them up myself. I came across this fantastic little paper  (PDF) which describes a simple method of taking apart a couple of standard computer mice, and rewiring the switches into a parallel port plug – this gives you up to six buttons. The circuit diagram is really, really simple:

Circuit Diagram for a six-button, parallel port response box. Reproduced from Voss, Leonhart and Stahl (2007).

It’s just the switches, and a 100-ohm resistor for each one, wired up to different pins on the data register of the port, with a common ground (pin 18). Honestly, if you were being lazy, you could even just forget about the resistors and it would still work fine. I decided not to take apart any mice, but just to use some buttons I bought off-the-shelf, as I only needed two for each box. Getting the right buttons is really important for this kind of thing – you want them to be a decent size, and have a good clicky-action, without being too difficult to depress. I also got some small plastic boxes, some multi-core cable (I used standard network cable as it’s quite stiff and robust, but almost anything will do), and some parallel port plugs. You can buy everything you need from Maplin or Radio Spares (Radio Shack, if you’re in the US) for about £10-15. I just drilled some holes in the boxes fairly roughly and secured the buttons there with a dab of epoxy resin, but you can get as fancy as you want in that respect.

The only really tricky bit is deciding which pins on the parallel port you want to wire your switches up to. This will largely be determined by which pins the software you’re going to use can read from. Psychology software like Inquisit or E-prime is able to read inputs from pins 2-9 on the data register (see below diagram) but it’s worth doing a bit of reading about the different pins on the parallel port and what they’re used for. A good place to start is here. Probably what you want to do is use one of the data pins for one pole of each switch, and wire the other pole to a common ground pin, as in the above diagram.

Parallel port pin diagram showing the three registers (data, status and control) and the ground pins (in green)

So there you have it – the most simple, inexpensive and accurate solution for recording response times in cognitive experiments. If you’re at all handy with a soldering iron you can probably knock up a couple of these in half an hour or so. If you’ve never done any electronics or soldering before, then this would be an ideal first project to get started with! This was my finished article:

Nice, huh? Happy soldering! TTFN.

*Not quite true – some of the expensive button-boxes you can buy from psychology software companies are USB, but have their own electronics inside them to get around this and time things accurately.

Follow

Get every new post delivered to your Inbox.

Join 122 other followers