<html><body><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 :</span></b> Matt McCormick <matt.mccormick@kitware.com><br> <b><span style="font-weight: bold;">À :</span></b> Malsoaz James <jmalsoaz@yahoo.fr> <br><b><span style="font-weight: bold;">Cc :</span></b> Quang Tran <quangt.itbk@gmail.com>; "insight-users@itk.org" <insight-users@itk.org> <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 :</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> find_package(ITK REQUIRED)<br> include(${ITK_USE_FILE})<br><br>In your CMakeLists.txt. Then, set ITK_DIR in your cmake build<br>configuration. 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
<<a ymailto="mailto:jmalsoaz@yahoo.fr" href="mailto:jmalsoaz@yahoo.fr">jmalsoaz@yahoo.fr</a>> wrote:<br>> How can I configure/register manually the IO classes from an install<br>> directory (bin/include/lib/share)?<br>><br>> I will have several installation of ITK (for several compilers) and I would<br>> like to avoid the use of find_package(ITK) and set manually the path to the<br>> libs/includes. Indeed, the ITK find package will not necessarely load the<br>> version I want.<br>><br>> Thank you<br>> Best<br>><br>> ________________________________<br>> De : Malsoaz James <<a ymailto="mailto:jmalsoaz@yahoo.fr" href="mailto:jmalsoaz@yahoo.fr">jmalsoaz@yahoo.fr</a>><br>> À : Quang Tran <<a ymailto="mailto:quangt.itbk@gmail.com" href="mailto:quangt.itbk@gmail.com">quangt.itbk@gmail.com</a>><br>> Cc : "<a ymailto="mailto:insight-users@itk.org"
href="mailto:insight-users@itk.org">insight-users@itk.org</a>" <<a ymailto="mailto:insight-users@itk.org" href="mailto:insight-users@itk.org">insight-users@itk.org</a>><br>> Envoyé le : Mercredi 14 Décembre 2011 11h21<br>> Objet : [Insight-users] Re : ITK v4 + IO factory classes : runtime error<br>><br>> Thank you for the proposition.<br>><br>> Nevertheless, my goal is to use the power of ITK IO classes to avoid to set<br>> a IO object. A default one should be set depending on the input file.<br>><br>> Best.<br>><br>> ________________________________<br>> De : Quang Tran <<a ymailto="mailto:quangt.itbk@gmail.com" href="mailto:quangt.itbk@gmail.com">quangt.itbk@gmail.com</a>><br>> À : Malsoaz James <<a ymailto="mailto:jmalsoaz@yahoo.fr" href="mailto:jmalsoaz@yahoo.fr">jmalsoaz@yahoo.fr</a>><br>> Cc : "<a ymailto="mailto:insight-users@itk.org"
href="mailto:insight-users@itk.org">insight-users@itk.org</a>" <<a ymailto="mailto:insight-users@itk.org" href="mailto:insight-users@itk.org">insight-users@itk.org</a>><br>> Envoyé le : Mercredi 14 Décembre 2011 4h27<br>> Objet : Re: [Insight-users] ITK v4 + IO factory classes : runtime error<br>><br>> Hi,<br>> I also had the same problem like you. In this case you should explicit<br>> specify the IO flag for the reader, i.e:<br>><br>> #include "itkPNGImageIO.h"<br>> ...<br>> const unsigned int ImageDimension = 2;<br>> typedef short PixelType;<br>> typedef itk::Image<PixelType, ImageDimension> ImageType;<br>> typedef itk::ImageFileReader<ImageType > ImageReaderType;<br>><br>> ImageReaderType::Pointer pReader = ImageReaderType::New();<br>> pReader->SetFileName("C:\\test.png");<br>> pReader->SetImageIO(itk::PNGImageIO::New());<br>>
pReader->Update();<br>><br>> /QuangT<br>><br>> 2011/12/13 Malsoaz James <<a ymailto="mailto:jmalsoaz@yahoo.fr" href="mailto:jmalsoaz@yahoo.fr">jmalsoaz@yahoo.fr</a>><br>><br>> Hi,<br>><br>> I'm trying to use ITK v4. I have been able to install it successfully (note<br>> that the option ITK_USE_SYSTEM_GDCM doesn't work, it produce a link error to<br>> gdcmMSFF).<br>> Anyway, I built it with the internal version of GDCM.<br>><br>> Unfortunately, when I try a reader class such as itkImageFileReader, I got<br>> an error regarding the IO factory classes :<br>> " Could not create IO object for file "C:/test.png"<br>> Tried to create one of the following:<br>> You probably failed to set a file suffix, or set the suffix to an<br>> unsupported type."<br>><br>> As you can see, the list of IO object is empty. It seems ITK can't find<br>> them. I checked in the include dir and
several IO files are available such<br>> as itkGDCMImageIO<br>><br>> Can someone tell me what's wrong ?<br>><br>> Regarding the CMakeLists, I created and used two variables<br>> - a ITK_INCLUDE_DIR (path to the include dir) to find the include files<br>> - a ITK_LIBRARIES list (list of path to the libs). Since the libs are not<br>> the same compared to ITKv3, I'm not sure which libraries to include in this<br>> list and in which order (if it matters), thus I listed all of them in<br>> alphabetical order.<br>><br>> I have no warning/error at compilation time.<br>><br>> I hope someone will be able to help me.<br>> Best<br>> James.<br>><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>><br>><br>><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>><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><br> </div> </div> </div></body></html>