nn8.nl

Dentist data conversion script

Recently I was surprised by the clever use of technology at my dentist. Not only do they send me reminders through e-mail and SMS, they also gave me a USB thumbdrive containing the data of CT-like scan of my teeth. The drive included a (Windows-only) viewer, but of course I wanted play with the data myself, having a background in medical visualization. So a project was born to try to set the data free. The short version is it turned out to be relatively easy and it resulted in a simple python script that converts the data to better documented formats. Github has the code. In the rest of this post I’ll describe what I found.

First some information on the viewer that came with the data. The program is called “GALILEO Viewer” and the readme file that came with it reveals it was made by the German company Sirona Dental Systems GmbH.

On the drive, one directory caught my attention:

f321000000000000000000000000000000009944d453_vol_0

Inside, there were 512 sequentially numbered files which I assumed contained volumetric slice data:

f321000000000000000000000000000000009944d453_vol_0_000
f321000000000000000000000000000000009944d453_vol_0_001
...
f321000000000000000000000000000000009944d453_vol_0_512

The sizes of the files varied quite a bit, which was a clear indication that the data in these files were compressed. Luckily, the compression method used is fairly standard; filtering such a file through gunzip revealed a 524288 bytes long file. This file size made 512 x 512 (16 bit) slices very probable.

All this guess-work proved correct, as some more poking revealed that the one file without a number

f321000000000000000000000000000000009944d453_vol_0

is a gzipped XML-file that specifies, among other details, that the volume has 512 x 512 x 512 voxels.

With all that figured out, I had enough information to create a simple Python script that converts this data to three, more open formats: Nrrd, MetaImage (mhd), and nifti. Although the probability of someone else needing such a script is not very high, I still decided to share it with the rest of the world and put the source code on github.