<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt"><div><span>Finally, my last proposed solution works. I should have clean my cmake.</span></div><div><br><span></span></div><div><span>Thank you.<br></span></div><div><br></div>  <div style="font-family: Courier New, courier, monaco, monospace, sans-serif; font-size: 10pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <font face="Arial" size="2"> <hr size="1">  <b><span style="font-weight:bold;">De&nbsp;:</span></b> Malsoaz James &lt;jmalsoaz@yahoo.fr&gt;<br> <b><span style="font-weight: bold;">À&nbsp;:</span></b> Matt McCormick &lt;matt.mccormick@kitware.com&gt; <br><b><span style="font-weight: bold;">Cc&nbsp;:</span></b> Quang Tran &lt;quangt.itbk@gmail.com&gt;; "insight-users@itk.org" &lt;insight-users@itk.org&gt; <br> <b><span style="font-weight: bold;">Envoyé le
 :</span></b> Mercredi 14 Décembre 2011 18h18<br> <b><span style="font-weight: bold;">Objet&nbsp;:</span></b> [Insight-users] Re : Re : Re : ITK v4 + IO factory classes : runtime error<br> </font> <br><div id="yiv478864965"><div><div style="color:#000;background-color:#fff;font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt;"><div><span>Thank you for your answer.</span></div><div><span><br></span></div><div><span>Setting the ITK_DIR changes nothing. It stays to the src dir.<br></span></div><div><br><span></span></div><div><span>I found in ITKConfig.cmake the way to register the ImageIO by creating the "ITKIOFactoryRegistration" folder. I copy it in my CMakeList and it works. Nevertheless, I still have the same error (it can't find any IO factory classes). Obviously something is still missing. Has someone any idea?</span></div><div><br><span></span></div><div><span>Best<br> </span></div><div><br></div>  <div
 style="font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt;"> <div style="font-family:times new roman, new york, times, serif;font-size:12pt;"> <font face="Arial" size="2"> <hr size="1">  <b><span style="font-weight:bold;">De&nbsp;:</span></b> Matt McCormick &lt;matt.mccormick@kitware.com&gt;<br> <b><span style="font-weight:bold;">À&nbsp;:</span></b> Malsoaz James &lt;jmalsoaz@yahoo.fr&gt; <br><b><span style="font-weight:bold;">Cc&nbsp;:</span></b> Quang Tran &lt;quangt.itbk@gmail.com&gt;; "insight-users@itk.org" &lt;insight-users@itk.org&gt; <br> <b><span style="font-weight:bold;">Envoyé le :</span></b> Mercredi 14 Décembre 2011 17h46<br> <b><span style="font-weight:bold;">Objet&nbsp;:</span></b> Re: [Insight-users] Re : Re : ITK v4 + IO factory classes : runtime error<br> </font> <br>Hi James,<br><br>You want to have<br><br>&nbsp; find_package(ITK REQUIRED)<br>&nbsp; include(${ITK_USE_FILE})<br><br>In your
 CMakeLists.txt.&nbsp; Then, set ITK_DIR in your cmake build<br>configuration.&nbsp; The ITK_DIR will allow you to point to different ITK<br>builds.<br><br>Hope this helps,<br>Matt<br><br>On Wed, Dec 14, 2011 at 11:33 AM, Malsoaz James
 &lt;<a rel="nofollow" ymailto="mailto:jmalsoaz@yahoo.fr" target="_blank" href="mailto:jmalsoaz@yahoo.fr">jmalsoaz@yahoo.fr</a>&gt; wrote:<br>&gt; How can I configure/register manually the IO classes from an install<br>&gt; directory (bin/include/lib/share)?<br>&gt;<br>&gt; I will have several installation of ITK (for several compilers) and I would<br>&gt; like to avoid the use of find_package(ITK) and set manually the path to the<br>&gt; libs/includes. Indeed, the ITK find package will not necessarely load the<br>&gt; version I want.<br>&gt;<br>&gt; Thank you<br>&gt; Best<br>&gt;<br>&gt; ________________________________<br>&gt; De&nbsp;: Malsoaz James &lt;<a rel="nofollow" ymailto="mailto:jmalsoaz@yahoo.fr" target="_blank" href="mailto:jmalsoaz@yahoo.fr">jmalsoaz@yahoo.fr</a>&gt;<br>&gt; À&nbsp;: Quang Tran &lt;<a rel="nofollow" ymailto="mailto:quangt.itbk@gmail.com" target="_blank"
 href="mailto:quangt.itbk@gmail.com">quangt.itbk@gmail.com</a>&gt;<br>&gt; Cc&nbsp;: "<a rel="nofollow" ymailto="mailto:insight-users@itk.org" target="_blank" href="mailto:insight-users@itk.org">insight-users@itk.org</a>" &lt;<a rel="nofollow" ymailto="mailto:insight-users@itk.org" target="_blank" href="mailto:insight-users@itk.org">insight-users@itk.org</a>&gt;<br>&gt; Envoyé le : Mercredi 14 Décembre 2011 11h21<br>&gt; Objet&nbsp;: [Insight-users] Re : ITK v4 + IO factory classes : runtime error<br>&gt;<br>&gt; Thank you for the proposition.<br>&gt;<br>&gt; Nevertheless, my goal is to use the power of ITK IO classes to avoid to set<br>&gt; a IO object. A default one should be set depending on the input file.<br>&gt;<br>&gt; Best.<br>&gt;<br>&gt; ________________________________<br>&gt; De&nbsp;: Quang Tran &lt;<a rel="nofollow" ymailto="mailto:quangt.itbk@gmail.com" target="_blank"
 href="mailto:quangt.itbk@gmail.com">quangt.itbk@gmail.com</a>&gt;<br>&gt; À&nbsp;: Malsoaz James &lt;<a rel="nofollow" ymailto="mailto:jmalsoaz@yahoo.fr" target="_blank" href="mailto:jmalsoaz@yahoo.fr">jmalsoaz@yahoo.fr</a>&gt;<br>&gt; Cc&nbsp;: "<a rel="nofollow" ymailto="mailto:insight-users@itk.org" target="_blank" href="mailto:insight-users@itk.org">insight-users@itk.org</a>" &lt;<a rel="nofollow" ymailto="mailto:insight-users@itk.org" target="_blank" href="mailto:insight-users@itk.org">insight-users@itk.org</a>&gt;<br>&gt; Envoyé le : Mercredi 14 Décembre 2011 4h27<br>&gt; Objet&nbsp;: Re: [Insight-users] ITK v4 + IO factory classes : runtime error<br>&gt;<br>&gt; Hi,<br>&gt; I also had the same problem like you. In this case you should explicit<br>&gt; specify the IO flag for the reader, i.e:<br>&gt;<br>&gt; #include "itkPNGImageIO.h"<br>&gt; ...<br>&gt; const unsigned int ImageDimension = 2;<br>&gt; typedef short PixelType;<br>&gt; typedef
 itk::Image&lt;PixelType, ImageDimension&gt; ImageType;<br>&gt; typedef itk::ImageFileReader&lt;ImageType &gt; ImageReaderType;<br>&gt;<br>&gt; ImageReaderType::Pointer &nbsp;pReader &nbsp;= ImageReaderType::New();<br>&gt; pReader-&gt;SetFileName("C:\\test.png");<br>&gt; pReader-&gt;SetImageIO(itk::PNGImageIO::New());<br>&gt;
 pReader-&gt;Update();<br>&gt;<br>&gt; /QuangT<br>&gt;<br>&gt; 2011/12/13 Malsoaz James &lt;<a rel="nofollow" ymailto="mailto:jmalsoaz@yahoo.fr" target="_blank" href="mailto:jmalsoaz@yahoo.fr">jmalsoaz@yahoo.fr</a>&gt;<br>&gt;<br>&gt; Hi,<br>&gt;<br>&gt; I'm trying to use ITK v4. I have been able to install it successfully (note<br>&gt; that the option ITK_USE_SYSTEM_GDCM doesn't work, it produce a link error to<br>&gt; gdcmMSFF).<br>&gt; Anyway, I built it with the internal version of GDCM.<br>&gt;<br>&gt; Unfortunately, when I try a reader class such as itkImageFileReader, I got<br>&gt; an error regarding the IO factory classes :<br>&gt; " Could not create IO object for file "C:/test.png"<br>&gt; &nbsp; Tried to create one of the following:<br>&gt; &nbsp; You probably failed to set a file suffix, or set the suffix to an<br>&gt; unsupported type."<br>&gt;<br>&gt; As you can see, the list of IO object is empty. It seems ITK can't find<br>&gt; them. I
 checked in the include dir and
 several IO files are available such<br>&gt; as itkGDCMImageIO<br>&gt;<br>&gt; Can someone tell me what's wrong ?<br>&gt;<br>&gt; Regarding the CMakeLists, I created and used two variables<br>&gt; - a ITK_INCLUDE_DIR (path to the include dir) to find the include files<br>&gt; - a ITK_LIBRARIES list (list of path to the libs). Since the libs are not<br>&gt; the same compared to ITKv3, I'm not sure which libraries to include in this<br>&gt; list and in which order (if it matters), thus I listed all of them in<br>&gt; alphabetical order.<br>&gt;<br>&gt; I have no warning/error at compilation time.<br>&gt;<br>&gt; I hope someone will be able to help me.<br>&gt; Best<br>&gt; James.<br>&gt;<br>&gt; _____________________________________<br>&gt; Powered by www.kitware.com<br>&gt;<br>&gt; Visit other Kitware open-source projects at<br>&gt; <a rel="nofollow" target="_blank"
 href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br>&gt;<br>&gt; Kitware offers ITK Training Courses, for more information visit:<br>&gt; <a rel="nofollow" target="_blank" href="http://www.kitware.com/products/protraining.html">http://www.kitware.com/products/protraining.html</a><br>&gt;<br>&gt; Please keep messages on-topic and check the ITK FAQ at:<br>&gt; <a rel="nofollow" target="_blank" href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a><br>&gt;<br>&gt; Follow this link to subscribe/unsubscribe:<br>&gt; <a rel="nofollow" target="_blank" href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; _____________________________________<br>&gt; Powered by www.kitware.com<br>&gt;<br>&gt; Visit other Kitware open-source projects at<br>&gt; <a rel="nofollow" target="_blank"
 href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br>&gt;<br>&gt; Kitware offers ITK Training Courses, for more information visit:<br>&gt; <a rel="nofollow" target="_blank" href="http://www.kitware.com/products/protraining.html">http://www.kitware.com/products/protraining.html</a><br>&gt;<br>&gt; Please keep messages on-topic and check the ITK FAQ at:<br>&gt; <a rel="nofollow" target="_blank" href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a><br>&gt;<br>&gt; Follow this link to subscribe/unsubscribe:<br>&gt; <a rel="nofollow" target="_blank" href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br>&gt;<br>&gt;<br>&gt;<br>&gt; _____________________________________<br>&gt; Powered by www.kitware.com<br>&gt;<br>&gt; Visit other Kitware open-source projects at<br>&gt; <a rel="nofollow" target="_blank"
 href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br>&gt;<br>&gt; Kitware offers ITK Training Courses, for more information visit:<br>&gt; <a rel="nofollow" target="_blank" href="http://www.kitware.com/products/protraining.html">http://www.kitware.com/products/protraining.html</a><br>&gt;<br>&gt; Please keep messages on-topic and check the ITK FAQ at:<br>&gt; <a rel="nofollow" target="_blank" href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a><br>&gt;<br>&gt; Follow this link to subscribe/unsubscribe:<br>&gt; <a rel="nofollow" target="_blank" href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br>&gt;<br><br><br> </div> </div>  </div></div></div><br>_____________________________________<br>Powered by www.kitware.com<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.html" target="_blank">http://www.kitware.com/products/protraining.html</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><br><br> </div> </div>  </div></body></html>