Order of operations

Over the past month or so, I’ve been dealing with a frustrating problem: my motion-correction seems to make images worse, instead of better, when operating in certain orientations, but works fairly well in others. Last night I may have finally pinned down the problem.

The position and orientation of the image slice plane are conveyed through a number of different programs. It turns that in some of these programs, the convention is “translate, and then rotate”, while in others it is “rotate, and then translate”. The order of operations completely changes the meaning of the data, and so in many cases I was actually moving the image along entirely the wrong axis.

Frustrating, but easily cured.


It looks like Fidelity “provisionally” refunded the charges against my account this weekend. I think that makes the total time from theft to return just over two weeks. Not bad, I suppose, but not ideal.


Last week, I walked out after to work to find my rear bicycle tube mysteriously, entirely flat. Yesterday I finally had time to replace the tube, which had a small but visible hole near the valve stem.

I rode the bicycle to a bar, locked it outside, and when I came back two hours later, the rear tube was totally flat, again.

I now have three bicycles, and none of them are in working order.


Saturday we went rafting. That means inflatable dinghies, paddles, helmets, 7 guests in a boat, and a river so shallow our guide occasionally had to get out and push. That’s not to say that it wasn’t exciting. Although it was called the beginner cruise, there was enough whitewater that several people very nearly went swimming despite the toeholds sewn into the raft’s floor. It was good clean fun of the highest order, and also a testament to the effectiveness of Neutrogena’s SPF-45 spray-on sunblock (when applied liberally).

We showed up a bit early, and decided to make a rushed tour through the Argo Gold Mine and Mill, a long-defunct gold mine converted into a decrepit second-rate roadside attraction. As an educational experience it left something to be desired. The gold mine in question is virtually a hallway, carved into the rock with hand tools by maybe two men, and for that it’s impressive enough. It’s not the world’s most exciting hallway, though.

There’s also a 4-mile-long tunnel through the mountain to Central City, but the tunnel is long abandoned and has become a sort of heavily contaminated spring. You can’t even get a good look in, because the entrance is all flowing water. The site is strewn with rusting mining equipment of widely varying vintage, largely unlabeled, and some unrecognizable. There are mining carts still on their tracks, huge engine-driven tumblers, and even one of the enormous slow-moving pumps that pushed air through the long tunnel. (It looks like the other one was torn off its foundations for salvage.)

The centerpiece is the gold mill, a factory for separating the trace amount of gold from a huge volume of rock. The mill has an especially eerie air, a dark wooden maze, half-filled with enormous rusting (or rotting) equipment whose labels, where occasionally present, are poorly spelled and strangely worded.

I’m not sure the place is worth $13.50 (with AAA discount) for its educational value… but maybe for the ambience, of a graveyard for the machines of a long passed era.

District 9

Most science fiction movies, I think, are a bit politically “conservative”. This comes in many forms, following the many strands of conservative political thought.

One strand is the Establishmentarians of Star Trek, where the cast’s derring-do is done on behalf of an inter-species interplanetary government, the Federation. In Star Trek, when the men with guns need to figure out what to do, they consult the legal principles laid out by their democratically controlled bureaucracy. Loyalty is highly prized.

Another frequent theme is the reverse: Anarchism, or Revolutionism(?), in the form of the Rand/Nietzche superman who causes change singlehandedly by virtue of tremendous superiority. (Conservative ideology and science fiction are both very flexible). Sometimes there is a small team, but rarely is it a team of equals.

From this perspective, District 9 is very unusual. It is, to my mind, quite clearly a liberal science fiction movie. If you see it, keep an eye out for barely veiled commentary on poverty, racism, apartheid, segregation, corporate accountability, corruption in the judicial system, religious extremists, the HIV/AIDS epidemic, the use of mercenaries in Iraq, and the tendency of governments to turn every new technology into a weapon.

If you enjoy ultraviolent whizbang science-fiction action movies, I highly recommend it. Especially if you’re a hippie peacenik liberal.

Kernel PCA

I’ve finally managed to understand nonlinear Kernel PCA and Reproducing Kernel Hilbert Spaces. In machine learning, this is called “the kernel trick”, and tricky is right.

The idea is almost hilarious. You have a technique (like PCA) that allows you to provide some linear (or in this case bilinear) function, and you have some arbitrary nonlinear function that doesn’t meet the criterion. With the kernel trick, you can make this work. All you have to do is increase the number of dimensions. A lot. Specifically, you can just move to a space where there is an independent dimension for every single possible input to the function.

Once you’ve made such a mapping, any function can be represented as a linear operation, because every possible input is completely independent. Of course, if your function takes a continuous range of inputs, this requires an infinite-dimensional space, such as a Hilbert space, and one would prefer to avoid doing computations in such a space. For many applications, such as PCA, all you need is an inner product, which you can compute in the original (low-dimensional) space; it’s just the nonlinear kernel function.

It’s a kind of insane trick, but brilliant. Hopefully it’ll work for my image-processing problem.


I’m flying to Colorado to visit my brother Jeff on Thursday, and then flying back on Sunday. I think that might make this my shortest ever airplane round-trip, though I’m not entirely sure. It’s certainly not as bad as one of my friends from college, who was at one point a professional sports photographer. On several occasions, he flew from Boston to Los Angeles to shoot a Red Sox game, and then flew back the same day.

Anyway, if there’s something in Boulder that you wish were in Boston, or vice versa, let me know by R.


For as long as I can remember, I’ve felt a compulsion to harmonize with machines. I mean this in a literal sense. Lawnmowers, microwave ovens, humming air conditioners… they all produce a steady drone, like the base note of a bagpipe, that presents a key and begs for melody. The pitch and timbre of the drone restrict the tune, and so it’s an amusing subconscious game, to find the song to fit the sound.

Lawnmowers were perhaps my best source of drones, for many years. When someone is mowing a lawn, they’re likely to keep at it for a long time, and the pitch is surprisingly constant. Doppler effects are minimal. Lawnmowers, though, have recently been surpassed.

My new best accompanist is an MRI machine. MRI machines build up images by successively acquiring data representative of each location in the imaging volume. Each acquisition requires a new position encoding, which is performed by the “gradient coils”, three oddly shaped electromagnets that live inside the MRI bore. Different image types require these coils to be pulsed in different ways.

A pulsed electromagnet, combined with a strong permanent magnet, is exactly the design of any speaker, like the one in a telephone or a movie theater. Pulsing the electromagnet inside the main static magnetic field produces a force, which creates a vibration. The resulting sound in an MRI machine is tremendously loud, because the magnetic fields and electric currents are both designed to be as large as possible. In MRI, stronger magnets mean faster images, and speed is critical in MRI.

Patients being scanned typically wear earplugs to prevent hearing damage, and the scanner room is mostly soundproofed, perhaps as a convenient side effect of the electromagnetic shielding. However, my experiments require me to run motors outside the room, and so I have been running long scans with the door open.

My experiment on Friday was using GE’s FIESTA sequence, a gradient-echo single-shot free precession sequence. It makes an image about once every two seconds, providing both a drone and a metronome.

It makes three hours alone with a scanner a lot more palatable.


I had a meeting with some friends tonight. We’re thinking about starting a club at Harvard for scientist interested in political issues… but there’s already a marginally active science policy club, so maybe we’ll just try to join up with them.

I tested basic through-plane motion correction working, and got a seriously ugly result. I think I might know why, but I’m not sure. I have scan time tomorrow afternoon, when I can hopefully figure out what’s going on.

I haven’t heard anything more from the bank, or the postal service, but maybe my affidavit will arrive in North Carolina tomorrow.


I sent my response to the affidavit as certified mail. It cost me $5.54. I’m still a little unclear on what certified mail certifies. I guess it certifies that it didn’t get lost in the mail, which, given the stern wording of the form, would be a very bad thing.

The form said I could fax it, but somehow I don’t trust fax machines as much as I trust a certified letter by the US Postal Service.

Now I must go to sleep. I got my annual [mild] sunburn at a picnic this weekend, which makes it even harder to get any rest in this cursed malarial swamp.