How Can I combine c++template with vtkimage scalartype?

Hi groups,

I wrote a imgprocess class with c++ template.
But when i use it, I have to use switch to judge the scalartype, and change it to class or class.

Is there anyway to skip this switch? otherwise I have to write switch{…} for every warpper function.

Thank you!