Tinker

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!

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...

Dear B.T.

Dear B.T.

In which I moan about BT...

Dear British Telecom (BT),

Last year I had the pleasure of enjoying BT Infinity. In a student house of five I don't recall ever experiencing slow internet or any outages. Naturally when I moved to a new house I was more than happy to start a contract with you. I was even looking forward to having a landline for the first time.

AjaXplorer on FreeNAS 8.3

AjaXplorer on FreeNAS 8.3

In which I set-up a nice web GUI for my home server...

So I recently invested in a HP ProLiant MicroServer N54L to backup my PC to. Also it should be quite useful as a media server etc. I've installed FreeNAS as my OS but wanted to have a easy-to-use Web interface for accessing my files over my Network. I followed the guide here: http://forums.freenas.org/threads/howto-ajaxplorer-with-nginx-in-plugin-jail-mysql-optional-webdav.10297/ but a few things need changing as always.

Chrome Problems

In which Chrome causes some problems for once...

So my work computer has been playing up a lot recently. It's been so slow that I've even had to hard reset several times. I've tried the usual tips and tricks:

  • turning off unnecessary services
  • turning off unnecessary startup programs
  • uninstalling unecessary programs

None of this worked. Starting up Task Manager I found that Chrome was using about 60% of my CPU even when I wasn't actively using it. This was odd so I had a quick Google...

Plugin Problems

Chrome runs plugins as separate processes (which is why there are so many processes in Task Manager called chrome.exe). If one of these has a high CPU usage you can end the process and chrome will give you an error that the plugin has crashed. You can then disable that plugin.

Annoyingly it was Adobe Flash Player causing the problems. Since I use this all the time I couldn't just uninstall it. The problem was luckily easy to solve - I had enabled hardware acceleration to fix a YouTube bug a few weeks back. Turning that off sped the computer up significantly.

Chrome's Malware Feature

Sorting out Flash did reduce the load Chrome was putting on the CPU but didn't remove all of it. It turns out that Chrome has a real time anti-malware protection feature which can use a lot of processing power. You can disable it in Settings>Privacy>Enable phishing and malware protection. This didn't have as much of an effect as the Flash problem but has helped speed up my computer. *

*If you're worried about not having the protection I've found Lavasoft Adaware to be more than ample against malware.

Related Articles

Tom Out!

Steam on (Gentoo) Linux

Steam on (Gentoo) Linux

In which I install Steam on Linux...

Steam is now officially supported on Linux! I decided to try it out.

Hold your horses!

Firstly - there are only 78 games supported* at the moment. So just be aware some of your faves might not be there yet.

Secondly - if you are running an Nvidia card you need to have x11-drivers/nvidia-drivers version 304.4 or higher installed. Steam will install but it won't get past login if you don't do this. You can solve this on Gentoo quite simply:

  • emerge x11-drivers/nvidia-drivers -avuDN

Installing QT Creator

In which I setup an IDE for my coding...

As with most of my Tinker posts to do with computers this is a guide to something I might need to do again in the future. You can probably find out how to do it online but I struggled with bits and am putting it here for my own and other's reference.

I am currently demonstrating a C++ lab at the University and it's good to be able to run the example code myself ahead of time. Also I am continuing to teach myself C++ as part of Project Euler.

Project Euler

In which I get back into coding in C...

I did a programming course* during my undergrad but it's fallen by the wayside recently. In an effort to improve my coding skills, and my understanding of maths, I have started on Project Euler.

*I took two actually but only had time for the coursework in one - I might upload my program for it later.

Project Euler

Project Euler (http://projecteuler.net/) is a website which sets maths problems and asks you to solve them with programming. There are currently 410 problems for you to solve.

They usually give an example or two and then ask for a harder calculation. Par example, the 6th prime number is 13 - now find the 15,000th.

This has been very helpful for re-learning my coding skills. You have to break down the maths problem into steps and then work out how the hell you would code that. Also it's fun and challenging!

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.

2012 in Review & New Year's Resolutions

In which I look back on a year (ish) of blogging and look ahead to 2013...

That Was The Year That Was!

Firstly WordPress have provided this nice summary of my year in blogging: http://tinkertailorsoldiersponge.com/2012/annual-report

So this is my first proper year of blogging (I posted a few things before but wasn't really regular at all). It's been a lot of fun and I'm definitely here to stay :) I've managed the majority of my 3,000 odd views this year :)

Let the summarising commence!

Tinker

I've messed about with Linux and Windows. I upgraded to Windows 8 and enjoyed it (it hasn't pissed me off yet!). I've also spent a fair amount of time learning $latex LaTeX$.

Tailor

The main event was Project Thor which was a lot of fun and helped keep me in shape.

Soldier

I didn't do much in the way of Airsoft this year :(

Sponge

Due to foolishly agreeing to bake a cake for every CAOS rehearsal in order to become Social Secretary I have baked a lot of cakes this year. Also there was the annual Pudding Party!

PhD

I've had a placement at AstraZeneca which has been very useful and is still on going. I've also started looking into PostDoc options.

Reviews

I reviewed a board game based on a TV show you might just have heard of. I also made an advent calendar full of alternative Christmas songs :)

Tea

I drank lots of tea and so it was a good year :)

I got featured on http://www.reddit.com/r/tea/ which was awesome! This is thanks to the Great British Tea Test 2012 :)

On to 2013!

Having survived the apocalypse let's have a few New Year's Resolutions:

Tinker

I'll keep tinkering. No particular promises here but expect some more $latex LaTeX$ and Linux stuff along with anything interesting I find out :)

Tailor

  • There will be some cryptic updates to Project 0 soon!
  • ManSSAGO is hosting the Manchester 2013 Cartoon Rally in February which I intend to have a costume for (I'm thinking Inspector Gadget).
  • Project Reynolds has a slight delay due to the party being moved back. This Project will be finished by mid-February.
  • I intend to get down to 13 stone for Project Reynolds and then down to 12½ stone by October.
  • There will be more sotumes later in the year :)

Soldier

  • I will definitely airsoft more next year!
  • There will be some site reviews!

Sponge

I'm 'contractually obliged' to make cakes until March sometime once a week so expect more cake making. It'll give me an excuse to use my new Mason Cash mixing bowl and silicon utensils :D

PhD

  • I'll finish my placement at AZ.
  • I will get a paper written (and hopefully published).
  • I will collect all of the data!
  • I will probably decide on PostDocs/future plans.

Reviews

I'm expecting to get the following things* to review next year:

*I should go on KickStarter less!

Tea

Armed with my trusty new leaf tea, teapot and a new review style I will continue to drink lots of tea!

Tom Out!

Christmas Trees & White Balance

Christmas Trees & White Balance

In which I mess about with exposure and white balance for some Christmas photographs...

So I'm going to cover some basics settings for photographing a Christmas tree and also show the difference between white balance settings and how it affects your pictures.

Christmas Trees

Auto mode doesn't really capture Christmas Trees at all well so stick to Manual mode. Below is a picture of my first attempt before I re-positioned to counteract the reflections from the windows. I also turned the lights off to make the shot easier. As you will be using long exposure times a tripod comes in very handy!

(Just over) A fortnight of Windows 8

In which I review the Windows 8 experience so far...

So I installed Windows 8 about two and a half weeks ago. In brief - it's a slightly improved version of Windows 7 with a few quirks and a start-up screen that require getting used to. In more detail:

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

LaTeX: Document Details

In which I perfect a macro for listing document details in LaTeX.

The Problem

I've been using $latex LaTeX$ to typeset my MRI Glossary (see previous PhD post). I really wanted an Appendix which listed system info and $latex LaTeX$ version.*

*Wordpress.com supports native $latex LaTeX$ - which is awesome

Solution

After much googling I couldn't figure out how to do this so I asked the kind folks at tex.stackexchange.com and Heiko Oberdiek & Ivan Griffin responded with two macros which I've now combined as follows†: usepackage{hologo} usepackage{ifluatex} usepackage{ifxetex} usepackage{ifvtex}

makeatletter

newcommand{ShowOsVersion}{% immediatewrite18{systeminfo | findstr /B /C:"OS Version" > OSv.tex}% input{OSv}immediatewrite18{rm OSv.tex}% }

newcommand{ShowOsName}{% immediatewrite18{systeminfo | findstr /B /C:"OS Name"> OSn.tex}% input{OSn}immediatewrite18{rm OSn.tex}% }

newcommand*{InfoLaTeX}{% hologo{fmtname} textlessfmtversiontextgreater } newcommand*{InfoTeX}{% ifxetex hologo{XeTeX}-% theXeTeXversionXeTeXrevision else ifluatex hologo{LuaTeX}-% begingroup count@=luatexversion dividecount@ by 100 % edefx{thecount@}% count@=-xrelax multiplycount@ by 100 % advancecount@ by luatexversion x.thecount@.luatexrevision endgroup else @ifundefined{pdftexversion}{% ifvtex hologo{VTeX}% @ifundefined{VTeXversion}{% }{% begingroup count@VTeXversion dividecount@ 100 % space vthecount@ multiplycount@ -100 % advancecount@VTeXversion .two@digitscount@ endgroup }% else hologo{TeX}% fi }{% hologo{pdfTeX}-% ifnumpdftexversion thepdftexversion.pdftexrevision else ifnumpdftexversion expandafter@carthepdftexversion@empty@nil.% expandafter@cdrthepdftexversion@empty@nil pdftexrevision else expandafter@carthepdftexversion@empty@nil.% expandafter@cdrthepdftexversion@empty@nil.% pdftexrevision fi fi }% fi fi }

I then call this at the end of my document with:

appendix chapter{Document Details}

Compiled by: InfoTeX hologo{LaTeX} version: InfoLaTeX ShowOsName ShowOsVersion

end{document}

This produces the following output:

Compiled by: pdf $latex TeX$-1.40.13 $latex LaTeX$ version: $latex LaTeX$2e OS Name: Microsoft Windows 7 Professional OS Version: 6.1.7601 Service Pack 1 Build 7601

†This requires you to use the -shell-escape option when compiling

Tom Out!

P.S. http://tex.stackexchange.com/questions/78334/print-system-information-in-latex-doc

Good Internet, Bad Internet

In which I discuss poor internet connections.

Slow Internet

Today at work I was using a terribly slow internet connection. What interested me was which programs and websites worked on a slow connection and which ones didn't.

These programs/sites worked well:

These didn't:

  • Outlook
  • Outlook web
  • Wunderlist
  • Ctrl-Alt-Delete

Google Mail & Calendar were intermittent.

Why should this be? I'm not sure and would have hazarded a guess that sites and programs which send less data would work better. However, Wunderlist only needs to send short strings of text (calendar events) when Evernote was syncing complete documents. Also with the websites both CAD and Xkcd require images to load. Xkcd managed it easily but I haven't seen today's CAD yet. Maybe the ones which loaded were just better coded/written!?!

Good Wi-Fi

Currently I'm writing this from the comfort of First Class with a complimentary glass of Merlot :-) The free Wi-Fi is excellent and speedy - the upgrade was definitely worth it (£2 to upgrade which gets me the normally £6 Wi-Fi, free wine and dinner). My new Archos G9 101 tablet is working very well and for a quick trip like this it's so much better than a laptop.*

So my first post written entirely on a tablet has gone well, also having a 250Gb HDD means I've done so to excellent musical accompaniment (LotR and TMBG among others).

*Although I did need to re-calibrate the screen after a recent update.

Tom Out!