Monday, November 28, 2011

Where the Worlds of Dentistry and Cartography Collide

As I was getting a root canal last week, my dental X-Rays reminded me anew of an optical illusion that stumped us for a short time recently when we were developing our heatmapping engine.

My X-Rays, before during and after a recent root canal.  They reminded me, of course, about cartography.

Dentists, or at least dental radiologists looking at dental X-Rays, are probably familiar with the pesky phenomena of Mach Banding.  It is an optical illusion that presents itself when contrasting tones are viewed right next to each other in the context of lightness gradients.  The intersection appears to have a spike in contrast -the light side gets an even brighter stripe and the dark side appears to have a darkened stripe.  See for yourself in this Wikipedia image...

What's the deal with that?  Turns out, it's all in your head (literally).  Our human visual systems maximize contrast in a scene in order to sharpen patterns (perhaps to get a jump on the lurking tiger in the tall grass).  When a neuron in the retina is stimulated, its neighbors are inhibited and don't fire -the result is a sharpened picture (we do the same thing with contrast filters in image processing).  That's pretty impressive eyeball hardware -but the usually-helpful optical illusion can lead to the perception of visual variation in a gradient that isn't really there.  This impacts dental radiologists and those who look at heat maps.  Here's what we saw...

It really looks like there are a couple of edge artifacts where these two hotspot gradients intersect.  But there's not.  You are crazy -but we're all crazy in the same way.  Rub your eyes a little; still crazy.

This is something that heatmap makers (whether it is a Visual Fusion heatmap, a kernel density plot in R, or some other engine that spits out gradient overlays) should be aware of -even if it's just to avoid the hours spent needlessly tweaking your code and/or your eyeballs.  There's not a whole lot you can do about it...other than to break up the gradient by showing it atop some nice background context (like a basemap or aerial imagery), which I'd hope you were planning on doing all along anyway.

Stuff in the background breaks up the isolated brightness gradation and nukes the Mach banding, which is nice.

Here's slightly more, partially redundant, reading on the subject as it relates to our heatmapping engine.


  1. How about adding a bit of gaussian/uniform noise to the output?

  2. Thanks Hadley! Also, your discussion on the topic is excellent, thanks for the resource!

  3. Israel "izzy" CohenNovember 30, 2011 at 5:27 PM

    Over 3000 years ago, the world of anatomy provided toponyms for the world of cartography.

    Phoenician names for geographic areas are still being used in west Asia and north Africa. Because Phoenician was also a Western Semitic language, these names sound quite Hebraic.

    These names were derived by configuring the gigantic body of a god or goddess over the surface of the area to be mapped. The name of each part of that body became the name of the area under it. This produced a scale 1:1 map-without-paper ... an ancient GIS ... on which the name of a place indicated its approximate location and direction with respect to all other places on the same map whose name was derived in this manner.

    For more information on this topic, see

  4. This is a very interesting post and an excellent resources. How about adding a bit of gaussian noise to the output?

    denture repair

  5. Seeing a dentist regularly helps to keep your mouth in top shape and allows your dentist to watch for developments that may point to other health issues. A dental exam can also detect poor nutrition and hygiene, growth and development problems and improper jaw alignment.

    fullerton dentist

  6. It's amazing how you related your teeth x-ray to optical illusion and then heatmapping engine. I think I'll try to visualize this one too when I get to my dentist Sydney clinic. Thanks for the idea!

  7. Its' really nice to know that you got inspired by looking at your dental x-ray. Very cool indeed.

  8. Lovely website! I am loving it!! Will come back again. I am bookmarking your feeds also
    Invisalign, Barnegat, NJ