<div dir="ltr">Hi <span style="font-family:verdana,sans-serif">Dženan,</span><div><span style="font-family:verdana,sans-serif"><br></span></div><div><span style="font-family:verdana,sans-serif">Thank you very much!</span></div><div><span style="font-family:verdana,sans-serif">Visual Studio 9 does not recognize </span><span style="font-size:12.8px">decltype(), but </span><span style="font-family:verdana,sans-serif">typeid() worked fine. At least, when you make separate if statements, like you did in your example. When tried to use it in a switch statement, the compiler complained.</span></div><div><span style="font-family:verdana,sans-serif"><br></span></div><div><span style="font-family:verdana,sans-serif">Greetings,</span></div><div><span style="font-family:verdana,sans-serif">Lambert</span></div><div><span style="font-family:verdana,sans-serif"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 15, 2016 at 2:47 PM, Dženan Zukić <span dir="ltr"><<a href="mailto:dzenanz@gmail.com" target="_blank">dzenanz@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Hi Lambert,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">the classic way is using a bunch of if-else's.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div>if (decltype(ValueType)==decltype(int))<br>{<br>//int specific processing<br>}<br>else if (decltype(ValueType)==decltype(itk::RGB<char>))<br>{<br>//RGB<char> specific processing<br>}<div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">else if ...</div><div><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">If you can't use C++11's decltype then use typeid from <typeinfo> header.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Regards,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Dženan</div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Tue, Mar 15, 2016 at 5:48 AM, Lambert Zijp <span dir="ltr"><<a href="mailto:ljzijp@gmail.com" target="_blank">ljzijp@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">I want to write a function that converts an arbitrary ITK image to another format (AVS in my case).<div>It has been suggested that following functionprototype could de the job:</div><div><div>template<typename ValueType,unsigned int Dimension></div><div>int ItkToAvs(AVSfield** ppAvs, typename itk::Image<ValueType,Dimension>::Pointer pItkImage);</div></div><div><br></div><div>Now I want to know whether ValueType equals unsigned char or short or int etc. Also whether the pixels are single numbers or vectors. How does one do that?</div><div><br></div><div>Greetings,</div><div>Lambert</div><div><br></div><div><br></div></div>
<br></div></div>_____________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" rel="noreferrer" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>