Preparing for Bayesian Mathematics in Python

Preparing for Bayesian Mathematics in Python

In which I run through setting up a Python environment on Windows...

I'm going to preface this post by saying I'm not breaking any new ground here. As is often the case, though, a beginner wanting to set-up an environment to do this will have to go to multiple websites to collect this info so I'm going to distil it into one post.

I am going to talk about Python 2.7 as currently it has the most support for libraries. This method should work equally well for Python 3 but I have not tested this.

Fancy Thesis Tables in LaTeX: An Idiots Guide

Fancy Thesis Tables in LaTeX: An Idiots Guide

In which I provide a template for generating fancy, production quality tables for theses...

LaTeX as I've mentioned previously, is a document preparation system well known for its brilliant equations and can also be utilised to make very nice looking diagrams. The tables it generates, however, while neat are a little lacklustre.  This is aimed as a very simple guide to editing tables (regular LaTeX users may find this tutorial very basic).

Tom 3.5 & Life Plan 2014

In which I talk about fitness and the road ahead...

Tom 3.5

So once again I am unhappy with my level of physical fitness having let it slide a lot with work and other stress getting in the way. I need a new ridiculous goal but first I need to get back to my old fitness levels. I'm back on the old horse having started running everyday again and I've rejoined the gym. Expect a longer post in about 2 weeks time about how things are going.

I'm thinking my next "ridiculous challenge" should either be Tough Mudder or an ultra marathon (~40 miles not one of the 100 mile ones).

Why Tom 3.5? Well my last fitness drive was Tom 3.0. This isn't entirely a new leaf it's just me reminding myself to get back to what I was doing and hopefully take it further.

Life Plan (2014)

These are my goals for the next 10 years. I'm going to start posting the one year goals each January instead of having fixed New Year's Resolutions.

This Year:

  • Start learning Guitar (again)
  • Start learning Piano
  • Get a job
  • Finish my PhD
  • Don’t have a fat graduation photo
  • Receive my QSA at Windsor
  • Receive my DofE Gold
  • Write more short stories
  • Enroll on another marathon/Tough Mudder

In 5 Years:

  • Be earning £40k+
  • Be married or almost married
  • Have a published book
  • Have worked towards grades in Piano
  • Grade 5 music theory

In 10 Years:

  • Have children
  • Grade 8 Piano
  • Have several published novels


So I'm in full thesis writing mode at the moment but that doesn't mean I'm constantly writing. I do procrastinate (though usually with other jobs I need to get done) and this brilliant article explains why that's helpful:

State of the Thesis

The thesis is currently 122 pages long with 29,206 words and 154,203 characters.

Tom Out!

Word 2010: Footnotes and Mendeley

Word 2010: Footnotes and Mendeley

In which I discuss getting footnotes and Mendeley references to look nice in Word...

I may not have mentioned it before on this blog but I am a Mendeley advisor and a strong advocate of this free reference manager. In fact I cover the pros and cons of it in this video:

Proper Gradients for MetaPost Pulse Sequences

Proper Gradients for MetaPost Pulse Sequences

In which I improve upon the previous post...

In yesterday's post I talked about using MetaPost to generate Pulse Sequence Diagrams for MRI documents. I have been using this to make nice diagrams for my Thesis. There is one problem, however, with the pulse sequence file provided on Mark's website - it generates square gradients.

Pulse Sequence Diagrams Using Metapost

Pulse Sequence Diagrams Using Metapost

In which I use MetaPost to generate publication quality pulse sequence diagrams...

Pulse sequences are the series of radio-frequency pulses required to generate an MR image. If you are an MR Physicist you will see these a lot and probably wondered how can I generate nice pulse sequences for my thesis, papers etc. Well handily using MetaPost and these files you can!

Osmanthus Green: Thesis, YouTube, Update!

Osmanthus Green: Thesis, YouTube, Update!

In which I review some floral green tea and update you on my life...

Thesis Writing

So thesis writing is fully under-way  now and my supervisors assure me that writing will get harder and longer as it continues - fun, fun, fun!

It takes me a while to get into writing but I expect I'll make a video about Thesis writing soon. I actually quite enjoy writing though so I hope I'll be able to keep the pace up and stay on schedule :)

Word 2010: How to Insert Numbered Equations Properly

Word 2010: How to Insert Numbered Equations Properly

In which I run through a useful tip that Microsoft managed to just miss explaining...

The Problem

If you, like me, are in the process of writing a long scientific document which requires multiple reviewers to be able to view changes you may sadly be saddled with using Microsoft Word.* Now, in defence of Microsoft, they have definitely improved the way Word works. Using track changes, Mendeley and with a little bit of tinkering you can have a passable writing experience and be able to send documents out for review by your supervisors. They've even included an equation editor that allows you to put equations in your document and save them for later use.

Sadly in formal scientific writing we often like things to look nice, pretty and numbered like this...

Warming Camomile & PhD 3rd Year Retrospective

In which I talk about my approaching final year and try a warming tea...

So in a few days I should be officially into my fourth and final year of my PhD.  That means I'm hopefully one year away from wearing these crazy robes...

ImageJ and Volume Measurement

In which I describe the complexities of analysing 3D images...

3D image analysis just seems to be one of those things that is harder to do than I'd like it to be.

Before starting it is worth pointing out that with MRI you can acquire volumes in two ways - traditional 2D with multiple slices or a 3D scan. As far as this blog post is concerned these are the same.*

A common measure in clinical MRI is the volume of an organ or part of an organ. After all when someone has brain cancer - "How big is the tumour?" can be a very important question. Here are my experiences of trying to measure volumes on MRI images.

*There are differences between these two methods of acquisition but that would require a whole blog post on it's own.

The Great British Tea Test 2012

The Great British Tea Test 2012

That tea review data in full...

So we set out to try all the major and supermarket brand teas and decide which was the best this year.

The Tea & The Cakes

We tried the following teas:

  • ASDA red label
  • Clipper
  • Lancashire
  • Marks & Spencer everyday
  • Morrisons red label
  • PG Tips
  • Sainsbury's red label
  • Tesco red label
  • Tetley
  • Twinings
  • Typhoo
  • Whittard
  • Yorkshire

Postdoc Options

In which I discuss my thoughts on a career in research at the present time. In which I cover the options open to me both from a research point of view and location.

I still currently plan to have an academic research career as opposed to an industrial research career but I'm open to the possibility my AZ placement may change my mind.

A Career in Research?

So far I've enjoyed my PhD and the working environment that is academia. There are always problems with any working environment but I've only encountered minor niggles so far and there is a lot of freedom to carry out your work in a manner that suits you (as long as it gets done :) ).

From the few people I've spoken to about Postdocs so far it is clear that getting at least one publication published by the end of my 4 year programme is a must. While it is possible to continue my research career without a publication under my belt it will make applying for good jobs significantly easier. This is the world of "

Publish or Perish

" after all.

Location, Location, Location

There is a general rule in research - move! The majority* of academics suggest you change institution between PhD and postdoc (the same has been said about undergrad to PhD too) unless you truly are at the best institute in the world for what you are doing. This, of course, gives me something to start ruminating about and also a great opportunity to visit a completely new city for several years.

Obviously the UK† is always an option but this is probably my best opportunity to live abroad for a short while.‡ And there is quite a lot of choice open to me. With my current language skills I could easily look at Australia, Belgium, Canada, France and the US. If I learn one of the two languages I most wish I knew then I'd open up opportunities in Germany or Japan as well.

I've also been told that, besides English, the best languages I could be learning at the moment for research are Chinese (Mandarin) and Japanese. This definitely gives Japan some bonus points. Not only is it a very interesting place that I've always wanted to visit but if I'm going to invest the time in learning the language I might as well put it to use in that country.

*That I've spoken to.

†Unless something drastically changes I expect I'll always want to return to the UK. It's not just the tea, I generally enjoy it here.

‡Postdocs are usually a few years.

Changes to the Site

I've added a links/cool stuff section to the blog which you can find here:

MRI Glossary

. It includes my very much under-development MRI glossary :)

Tom Out!



Starting 3rd Year/So You Want To Do A PhD?

So I thought as my third year looms it might be worth reviewing my PhD experience and giving new or potential PhD students my thoughts.

2 Years In

So how do I feel now that I'm successfully onto the 3rd year of my programme?

In general, I am enjoying my PhD and I am very grateful for the opportunity I have been given. There are of course downsides but the majority are minor or would be the case in any job (such as delays beyond your control etc.). I am really looking forward to my upcoming industrial placement as it will be a nice change of pace and will (fingers crossed) lead to a publication.

As far as progress goes I could be a little further ahead but with the potential for publications this year and my first oral presentation at BC-ISMRM next week I'm very excited for my third year. There's always a bit of worry from being half-way through something but I'm coping well at the moment.

So You Want To Do A PhD?

There are already books[1] on getting a PhD but I think I'll summarise the general points below.

Why should you do one?

  • You want to get into academia/research - it's still the standard route.
  • You're really interested in a specific research area - if you enjoy it, do it!
  • You need a higher level qualification for your ideal job - though you still need to be interested!

Why shouldn't you do one?

  • Just for the title
  • Because you're afraid of getting a real job
  • You want to stay a student forever

So if you've decided you want to do a PhD there's still a lot of choice for doctoral courses, which one should you pick?

PhD Types

  • Traditional PhD/DPhil - Normally 3 years funded* (in the UK) and takes around 3.5 years, the traditional model with topic usually being set at the beginning by your supervisors. Funding from the research councils is currently £13,590 (tax free).†
  • EngD etc. - 4 years including taught elements and industrial placements.
  • DTC based PhD - usually 4 years with taught elements. Often you don't pick a research topic straight away choosing it between 3-12 months in.
  • Industrial CASE PhD - usually 4 years funded with a 3-6 month industrial placement. These include an increase to the normal PhD stipend of up to ~£7,000

I'm on an Industrial CASE PhD so there's the possibility I'm slightly wrong about the differences between the others.

Once you've decided your research field/topic, the type of PhD you want to do and double checked that your really want to do one - start applying!

Most PhD positions are advertised from January onwards with interviews around February. If there is funding though PhD positions need to be filled and there will be positions advertised all year. Summer tends to have a large number of PhD places which weren't filled early in the year on offer.§

So You're In For The Long Haul?

What can you expect from your time doing a PhD then?

1st Year

Regardless of your programme you are going to have to review the literature. This normally takes around 3 months and is sometimes publishable as a paper if your field is in an interesting niche.

You will learn how to use the lab equipment/computers/databases/blackboards you need for your continued research.

You will probably narrow down the topic area and methods to be used in future years.

You may get trained on something really specific (I was flown out to Bruker in Germany to learn how to program MRI scanners).

You will have some sort of report to get through to the next year. I had to have a full-on viva but other departments have a simple meeting with supervisors to see if you should continue.

2nd Year

This is usually your method development year. For CASE students you may go on your first placement.

If method development is quick you can start collecting useful data.

3rd Year

This is your data collection year. People on a '3 year' programme will need all their data pretty much by the end of this year.

4th Year

On a 3 year programme you will be writing the thesis until your agree viva date. On a 4 year programme you will finish data collection then write the thesis.


Graduate! :D

* This is for Sciences PhDs - it is a lot harder to get funding in the Humanities.

†Funding bodies will also pay your tuition fees.‡

‡I believe Wellcome Trust provide the best at the moment with total stipend of around £21,000

§You can see available positions on respective universities' websites and at

You will write a fair amount of certain thesis sections ahead of this time. Some people write up throughout and continue collecting data well into the traditional data collection phase.

Tom out!

[1] Phillips, E.M. and Pugh, D.S., 2000. How to Get a PhD: A Handbook for Students and Their Supervisors. 3rd ed. Maidenhead: Open University Press.