<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">The attached project compiles and links without a problem.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">

On Fri, Jan 10, 2014 at 7:34 AM, Massinissa Bandou <span dir="ltr">&lt;<a href="mailto:Massinissa.Bandou@usherbrooke.ca" target="_blank">Massinissa.Bandou@usherbrooke.ca</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi Dženan Zukić,<br>
<br>
I just want to know what&#39;s wrong with the code below because I have 5<br>
errors:<br>
<br>
<br>
Error   2       error C2146: syntax error : missing &#39;;&#39; before identifier<br>
&#39;ComponentType&#39; c:\program<br>
files\itk\include\itk-4.4\itkDefaultConvertPixelTraits.h        45      1<br>
TomoRegistration<br>
Error   4       error C2602:<br>
&#39;itk::DefaultConvertPixelTraits&lt;PixelType&gt;::ComponentType&#39; is not a member<br>
of a base class of &#39;itk::DefaultConvertPixelTraits&lt;PixelType&gt;&#39;  c:\program<br>
files\itk\include\itk-4.4\itkDefaultConvertPixelTraits.h        45      1<br>
TomoRegistration<br>
Error   1       error C2838: &#39;ComponentType&#39; : illegal qualified name in member<br>
declaration     c:\program<br>
files\itk\include\itk-4.4\itkDefaultConvertPixelTraits.h        45      1<br>
TomoRegistration<br>
Error   5       error C2868:<br>
&#39;itk::DefaultConvertPixelTraits&lt;PixelType&gt;::ComponentType&#39; : illegal syntax<br>
for using-declaration; expected qualified-name  c:\program<br>
files\itk\include\itk-4.4\itkDefaultConvertPixelTraits.h        45      1<br>
TomoRegistration<br>
Error   3       error C4430: missing type specifier - int assumed. Note: C++ does<br>
not support default-int c:\program<br>
files\itk\include\itk-4.4\itkDefaultConvertPixelTraits.h        45      1<br>
TomoRegistration<br>
<div class="im"><br>
<br>
<br>
<br>
        typedef itk::ImageIOBase::IOComponentType ScalarPixelType;<br>
</div>        itk::ImageIOBase::Pointer imageIOsource =<br>
itk::ImageIOFactory::CreateImageIO(&quot;writesource.mhd&quot;,itk::ImageIOFactory::ReadMode);<br>
        imageIOsource-&gt;SetFileName(&quot;writesource.mhd&quot;);<br>
        imageIOsource-&gt;ReadImageInformation();<br>
        const ScalarPixelType pixelTypeSource = imageIOsource-&gt;GetComponentType();<br>
<br>
        itk::ImageIOBase::Pointer imageIOtarget =<br>
itk::ImageIOFactory::CreateImageIO(&quot;writetarget.mhd&quot;,itk::ImageIOFactory::ReadMode);<br>
        imageIOtarget-&gt;SetFileName(&quot;writetarget.mhd&quot;);<br>
        imageIOtarget-&gt;ReadImageInformation();<br>
        const ScalarPixelType pixelTypeTarget = imageIOtarget-&gt;GetComponentType();<br>
<br>
       myClass* a= new myClass;<br>
       a-&gt;VolumeRegistration(pixelTypeSource,pixelTypeTarget);<br>
<br>
class myClass<br>
{<br>
        ....<br>
        template&lt;typename pixelType1, typename pixelType2&gt;<br>
        void VolumeRegistration(pixelType1,pixelType2)<br>
        {<br>
                typedef itk::Image&lt; pixelType1, 3 &gt;  FixedImageType;<br>
                typedef itk::Image&lt; pixelType2, 3 &gt;  MovingImageType;<br>
        }<br>
};<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://itk-users.7.n7.nabble.com/newbie-C-question-tp33081p33162.html" target="_blank">http://itk-users.7.n7.nabble.com/newbie-C-question-tp33081p33162.html</a><br>
<div class="HOEnZb"><div class="h5">Sent from the ITK - Users mailing list archive at Nabble.com.<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" 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" 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" 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" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</div></div></blockquote></div><br></div>