Skip to main content

Posts

Showing posts from 2014

How to convert between voxel and mm coordinates using Python

I'm often asked how to go from voxel and mm coordinates using Python. This can be easily achieved using nibabel package with only few lines of code. The following tutorial is based on +Matthew Brettanswer on the nipy mailing list.
Going from voxel to mm coordinatesimport os
import nibabel as nib
Load the NIFTI file defining the space you are interested in. For the purpose of this tutorial we will use a test dataset shipped with nibabel.

data_fname = os.path.join(os.path.dirname(nib.__file__), 'tests', 'data', 'example4d.nii.gz')
img = nib.load(data_fname)
Get the affine matrix and convert the coordinates.


aff = img.get_affine()
real_pt = nib.affines.apply_affine(aff, [22, 34, 12])
real_pt
array([ 73.85510254, 27.1169095 , 29.79324198]) Going from mm to voxel coordinates Going the other direction is even easier.

import numpy.linalg as npl
nib.affines.apply_affine(npl.inv(aff), real_pt)
array([ 22., 34., 12.])

How to embed interactive brain images on your website or blog

We have recently added a new feature to NeuroVault - you can embed statistical maps in external websites and blogs. They look just like this one below:
It's very easy to use. You just need to upload you statistical maps (unthresholded, NIFTI file format in MNI space) to NeuroVault and click on the "Embed" tab. Copy the HTML code snippet and paste it to your blog or website.
This feature has been long awaited by some modern academic journals (like +F1000Research) as well as some neuroimaging bloggers (see +Micah Allenpost about NeuroVault. It is still in beta so we would appreciate your feedback.

This is my brain: sharing the risk

At a recent meeting at Leiden we talked about many issues related to data sharing. Previously I've been covering how to incentivise scientists to share data through data papers on this blog, but during that meeting we also discussed ethical issues. When we are collecting data about our participants (whether those are behavioural measures or MRI scans) we take responsibility for it. We make a pledge that we will make whatever we can to protect the identity of our subjects.

This is easier if we do not share data. Because fewer people have access to the data the likelihood of someone finding a method to connects brain scans to a particular person are lower. In reality this could be done either through a security breach (someone hacking the university network and obtaining the list of participants and their anonymous IDs) or by combining multiple datasets about one person to obtain enough details to be able to identify a person (this however applies only to participants taking part in…

The data sharing revolution has begun

Beginning from 1st of March all papers published in journals run by +Public Library of Science (PLoS) will have to publicly share data. This includes PLoS ONE -  currently the biggest (in terms of volume) academic journal in the world. But is it a big deal? Many leading journal such as Nature, Science, and PNAS for a long time have been requiring their authors to provide data to fellow scientists upon request. Is there a difference between depositing data in a public repository and making it available upon individual requests? Yes there is. There are dozens of excuses researchers can use to delay sharing of the data almost infinitely. Additionally without proper description (which public repositories will enforce) data is useless. I could go on and on how imperfect the "available upon request" solution is, but this video depicts it in a much better way: 
Making data available upon request looks good only on paper, but it just does not work in practice. Public sharing of dat…

"We want to make reviewers look awesome": an interview with Andrew Preston

On a very cold afternoon in Berlin I managed to ask a few questions to Andrew Preston (co-founder of Publons) who was in town for the Academic Publishing Europe 2014 conference:

- Could you tell us a bit more about the platform you are building - publons.com. Where the idea came from? What kind of problems are you trying to solve?
- Absolutely! I did a PhD in physics as well as a postdoc in the US, so I have experience the enjoyment and the trial of publishing papers first hand and I also have been a reviewer. By going through that process as well as talking to colleagues I realized that there must be a better way of doing this. That is the genesis of Publons.

- What actually is a Publon?
Good question! It is a joke in physics where there is a concept of fundamental particles: the electron is the fundamental unit of charge, the photon is the quantum of light etc. The Publon is the facetious term we use to refer to the minimum publishable unit of academic research. We thought it was a co…

The Silo Series and the frequency of novelty

It all started with a good friend of mine +Chris Steele recommending me a trilogy of dystopian sci-fi books - The Silo Series by +Hugh Howey. According to him the book was really really good. I was sceptical to begin with - I was reading a lot at that time, but I have not came across a book that would captivate me the same way as some of the stuff I read in high school. Nonetheless I gave it a try. How wrong I was! The story (spread across three books: Wool, Shift and Dust) takes place in a huge bunker where the remains of the human race are trying to wait until the outside world “gets better” after some kind of a cataclysms. This is literally all I can say about the plot without any spoilers. That is probably the best thing about the book - it keeps you on the edge and violates your previous assumptions almost constantly. I found it hard to put it down: reading till late hours or skipping social occasions just to be able to take in another chapter.
I highly recommend the book. Even …