<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Dear Ali,<div><br></div><div>As I see, you haven't constructed the used image types in the templated class</div><div>"DoTheRealThing()" which should have been done with the proper pixel types and</div><div>dimensions. Something like,</div><div><br></div><div><div>typedef short PixelType; </div><div>const unsigned int Dimension = 2;</div><div>typedef itk::Image<PixelType, Dimension> <span class="Apple-style-span" style="font-family: 'courier new', monospace; border-collapse: collapse; ">S1d3ITKImgType</span>;</div><div><br></div><div>Hope this helps,</div><div>Dawood</div><br>--- On <b>Sun, 1/2/11, Ali Habib <i><ali.mahmoud.habib@gmail.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Ali Habib
<ali.mahmoud.habib@gmail.com><br>Subject: US1d3ITKImgType not found<br>To: insight-users@itk.org, "Dan Mueller" <dan.muel@gmail.com>, "Dawood Masslawi" <davoud_zzz@yahoo.com><br>Date: Sunday, January 2, 2011, 9:30 AM<br><br><div id="yiv1964124170"><div dir="ltr">Dear All, <div><br></div><div>I tried the following code but it always give error that </div><div><br></div><div><span class="yiv1964124170Apple-style-span" style="font-size:13px;border-collapse:collapse;">US1d3ITKImgType , </span><span class="yiv1964124170Apple-style-span" style="font-size:13px;border-collapse:collapse;">S1d3ITKImgType ,.. not defined am I missing something </span></div>
<div><span class="yiv1964124170Apple-style-span" style="font-size:13px;border-collapse:collapse;"><br></span></div>
<div><span class="yiv1964124170Apple-style-span" style="font-size:13px;border-collapse:collapse;">sorry for this naive question </span></div>
<div><span class="yiv1964124170Apple-style-span" style="font-size:13px;border-collapse:collapse;"><br></span></div>
<div><span class="yiv1964124170Apple-style-span" style="font-size:13px;border-collapse:collapse;">Best regards </span></div>
<div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><span class="yiv1964124170Apple-style-span" style="font-family:verdana, geneva, helvetica, arial, sans-serif;font-size:13px;border-collapse:collapse;"><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);">
<font face="'courier new', monospace"><span>typedef itk::ImageIOBase::IOComponentType <b class="yiv1964124170highlight" style="background-color:rgb(255, 255, 102);">ScalarPixelType</b>;</span></font></div>
<div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><font face="'courier new', monospace"><br>
</font></div><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><font face="'courier new', monospace"><span> itk::ImageIOBase::Pointer imageIO =</span></font></div>
<span></span><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>                </span></font></span><font face="'courier new', monospace"><span>itk::ImageIOFactory::CreateImageIO(</span></font></div>
<div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>                        </span></font></span><font face="'courier new', monospace"><span>params::filenameIn, itk::ImageIOFactory::ReadMode);</span></font></div>
<span></span><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><font face="'courier new', monospace"><br>
</font></div><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>        </span></font></span><font face="'courier new', monospace"><span>if (!imageIO) {</span></font></div>
<span></span><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>                </span></font></span><font face="'courier new', monospace"><span>std::cerr << "Unable to create a valid ImageIO for image " <<</span></font></div>
<span></span><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>                        </span></font></span><font face="'courier new', monospace"><span>params::filenameIn << ". Exiting." << std::endl;</span></font></div>
<span></span><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>                </span></font></span><font face="'courier new', monospace"><span>return -1;</span></font></div>
<div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>        </span></font></span><font face="'courier new', monospace"><span>}</span></font></div>
<span></span><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><font face="'courier new', monospace"><br>
</font></div><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><font face="'courier new', monospace"><span>// Now that we found the appropriate ImageIO class, ask it to</span></font></div>
<div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><font face="'courier new', monospace"><span>// read the meta data from the image file.</span></font></div>
<span></span><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><font face="'courier new', monospace"><span>//</span></font></div>
<div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><font face="'courier new', monospace"><span> imageIO->SetFileName(params::filenameIn);</span></font></div>
<div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><font face="'courier new', monospace"><span> imageIO->ReadImageInformation();</span></font></div>
<span></span><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>        </span></font></span><font face="'courier new', monospace"><span>const <b class="yiv1964124170highlight" style="background-color:rgb(255, 255, 102);">ScalarPixelType</b> pixelType = imageIO->GetComponentType();</span></font></div>
<span></span><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>        </span></font></span><font face="'courier new', monospace"><span>if (params::verbose)</span></font></div>
<div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>                </span></font></span><font face="'courier new', monospace"><span>std::cout << "Pixel Type is " << imageIO->GetComponentTypeAsString(pixelType)</span></font></div>
<span></span><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>                        </span></font></span><font face="'courier new', monospace"><span><< std::endl;</span></font></div>
<div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>        </span></font></span><font face="'courier new', monospace"><span>const size_t numDimensions = imageIO->GetNumberOfDimensions();</span></font></div>
<span></span><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>        </span></font></span><font face="'courier new', monospace"><span>if (numDimensions != 3) {</span></font></div>
<div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>                </span></font></span><font face="'courier new', monospace"><span>std::cerr << "This soft only soports 3D volumes. Exiting"</span></font></div>
<span></span><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>                        </span></font></span><font face="'courier new', monospace"><span><< std::endl;</span></font></div>
<div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>                </span></font></span><font face="'courier new', monospace"><span>return -1;</span></font></div>
<span></span><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>        </span></font></span><font face="'courier new', monospace"><span>}</span></font></div>
<div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><font face="'courier new', monospace"><br>
</font></div><span></span><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><font face="'courier new', monospace"><span> switch (pixelType) {</span></font></div>
<div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>                </span></font></span><font face="'courier new', monospace"><span>case itk::ImageIOBase::UCHAR: DoTheRealThing<UC1d3ITKImgType>(); break; //</span></font><span style=""><span>UC1d3ITKImgType = unsigned char image of 1 channel, 3 dimensions</span></span></div>
<span></span><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>                </span></font></span><font face="'courier new', monospace"><span>case itk::ImageIOBase::SHORT: DoTheRealThing<S1d3ITKImgType>(); break; //S1d3 = Short, one chanel, 3dimensions</span></font></div>
<span></span><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>                </span></font></span><font face="'courier new', monospace"><span>case itk::ImageIOBase::USHORT: DoTheRealThing<US1d3ITKImgType>(); break;</span></font></div>
<span></span><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>                </span></font></span><font face="'courier new', monospace"><span>case itk::ImageIOBase::FLOAT: DoTheRealThing<F1d3ITKImgType>(); break;</span></font></div>
<span></span><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>                </span></font></span><font face="'courier new', monospace"><span>default:</span></font></div>
<div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>                        </span></font></span><font face="'courier new', monospace"><span>std::cerr << "Pixel Type ("</span></font></div>
<span></span><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>                                </span></font></span><font face="'courier new', monospace"><span><< imageIO->GetComponentTypeAsString(pixelType)</span></font></div>
<span></span><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>                                </span></font></span><font face="'courier new', monospace"><span><< ") not supported. Exiting." << std::endl;</span></font></div>
<span></span><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><span style="white-space:pre-wrap;"><font face="'courier new', monospace"><span>                        </span></font></span><font face="'courier new', monospace"><span>return -1;</span></font></div>
<div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><font face="'courier new', monospace"><span> }</span></font></div>
<span></span><div style="border-top-color:rgb(204, 204, 204);border-right-color:rgb(204, 204, 204);border-bottom-color:rgb(204, 204, 204);border-left-color:rgb(204, 204, 204);"><font face="'courier new', monospace"></font><font face="'courier new', monospace"><span>return 0;</span></font></div>
</span></div></div>
</div></blockquote></div></td></tr></table><br>