Templated on pixel type.
Fixes
Continued updates.
Merge pull request #1 from bakercp/templated_on_pixel_type

Templated on pixel type