Archive for September, 2011

3D-printed vertebrae!

September 26, 2011

WARNING: This post contains very intimate images of parts of my anatomy 😉

I was unlucky enough to have an accident in a circus class in June, and fractured my spine. There followed a dull 3 months wearing a spine brace, but fortunately there doesn’t seem to be any long-term damage.

Being a geek, I asked the hospital for a digital copy of my CT scans, which they gave me on a DVD. The DVD comes with a basic HTML front-end to view the pictures, like this.

That’s not very informative, without several years of medical training, and there was a whole bunch of other stuff on the disk which, I assumed, were the original source files from the CT scanner. So, I had a look for an open source viewer for that data.

I found OsiriX which is a truly amazing program. After a few minutes of fiddling, I was playing with a 3D representation of my spine, rotating it, zooming in and out.

(You can see the damage to the lower of the 2 vertebrae shown – it should be the same size and shape as the one above)

So, that was fun. But then I decided to geek it up a level and see if I could get a 3D print.

You can export from OsiriX in a number of standard 3D formats. By exporting a .obj file, I could pull that into Meshlab, another great open source program, and clean up the 3D model a bit – deleting some “floating” parts and closing a couple of holes. I’m by no means a 3D modelling expert, and it shows, but I managed to tidy things up a little bit. You’ll need a fairly powerful machine – the vertex map of my scan had nearly 600,000 vertices, which takes quite a bit of memory and CPU to manipulate.

Finally, I had a clean enough .obj file to send off to be printed.

I chose i.materialise Their “3D Print Lab” has a really nice interface and lets you change scale and choose from several printing materials, allowing you to see the costs and properties of each. I chose to print my model at 50% scale in polyamide, which came in at around €35.

After submitting the job, Dmitriy at i.materialise was really helpful, further cleaning up the model before sending it to print (it turns out my ribs would have fallen off – who knew?)

So, here’s the finished product.

It’s of no practical use whatsoever, but it was a fun bit of geeking about.

PS: Don’t ever fracture your spine – it’s a really bad idea.

Advertisements

IP Ranges gem

September 10, 2011

I just published a gem to help manage ranges of IP numbers.

It allows you to take lots of arbitrary IP data like this;

  • 1.2.3.4
  • 1.2.1.254..1.3.4.4
  • 1.2.0.0/16

…and find out which ranges include or overlap with others. In this case, it provides output like this;

1.2.3.4 is contained by range 1.2.1.254..1.3.4.4
1.2.3.4 is contained by range 1.2.0.0/16
1.2.1.254..1.3.4.4 overlaps with 1.2.0.0/16

Here’s the source.