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

**URL:** https://discourse.vtk.org/t/how-can-i-combine-c-template-with-vtkimage-scalartype/6445
**Category:** Support
**Created:** [August 23, 2021, 3:56am UTC](https://discourse.vtk.org/t/how-can-i-combine-c-template-with-vtkimage-scalartype/6445 "2021-08-23T03:56:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![WailmerPail](https://discourse.vtk.org/user_avatar/discourse.vtk.org/wailmerpail/32/3356_2.png) [@WailmerPail](https://discourse.vtk.org/u/WailmerPail)
#### Post date: [August 23, 2021, 3:56am UTC](https://discourse.vtk.org/t/how-can-i-combine-c-template-with-vtkimage-scalartype/6445/1 "2021-08-23T03:56:43Z")

</div>

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!
