<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt"><div><span>How can I configure/register manually the IO classes from an install directory (bin/include/li</span><span>b/s</span><span>hare)?</span></div><div><br><span></span></div><div><span>I will have several installation of ITK (for several compilers) and I would like to avoid the use of find_package(ITK) and set manually the path to the libs/includes. Indeed, the ITK find package will not necessarely load the version I want.<br></span></div><div><br><span></span></div><div><span>Thank you</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> Malsoaz James <jmalsoaz@yahoo.fr><br> <b><span style="font-weight: bold;">À :</span></b> Quang Tran <quangt.itbk@gmail.com> <br><b><span style="font-weight: bold;">Cc :</span></b> "insight-users@itk.org" <insight-users@itk.org> <br> <b><span style="font-weight: bold;">Envoyé le :</span></b> Mercredi 14 Décembre 2011 11h21<br> <b><span style="font-weight: bold;">Objet :</span></b> [Insight-users] Re : ITK v4 + IO factory classes : runtime error<br> </font> <br><div id="yiv1341304903"><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 the proposition.</span></div><div><br><span></span></div><div><span>Nevertheless, my goal is to use the power of ITK IO classes to avoid to set a IO object. A default one should be set depending on the input
file.</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> Quang Tran <quangt.itbk@gmail.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>
"insight-users@itk.org" <insight-users@itk.org> <br> <b><span style="font-weight:bold;">Envoyé le :</span></b> Mercredi 14 Décembre 2011 4h27<br> <b><span style="font-weight:bold;">Objet :</span></b> Re: [Insight-users] ITK v4 + IO factory classes : runtime error<br> </font> <br><div id="yiv1341304903"><font color="#000000"><font><font face="arial,helvetica,sans-serif">Hi,</font></font></font><div><font color="#000000"><font><font face="arial,helvetica,sans-serif">I also had the same problem like you. In this case you should explicit specify the IO flag for the reader, i.e: </font></font></font></div>
<div><font color="#000000"><font><font face="arial,helvetica,sans-serif"><br></font></font></font></div><div><font color="#000000"><font><font face="arial,helvetica,sans-serif">#include "itkPNGImageIO.h"</font></font></font></div>
<div><font color="#000000"><font><font face="arial,helvetica,sans-serif">...</font></font></font></div><div><font><font face="arial,helvetica,sans-serif"><div style="color:rgb(0,0,0);">const unsigned int ImageDimension = 2;</div>
<div style="color:rgb(0,0,0);">typedef short PixelType;</div><div style="color:rgb(0,0,0);">typedef itk::Image<PixelType, ImageDimension> ImageType;</div><div style="color:rgb(0,0,0);">typedef itk::ImageFileReader<ImageType > ImageReaderType;</div>
<div style="color:rgb(0,0,0);"><br></div><div style="color:rgb(0,0,0);">ImageReaderType::Pointer pReader = ImageReaderType::New();</div><div style="color:rgb(0,0,0);">pReader->SetFileName("C:\\test.png"); </div>
<div>pReader->SetImageIO(<font class="yiv1341304903Apple-style-span" color="#ff0000">itk::PNGImageIO::New()</font>);</div><div style="color:rgb(0,0,0);">pReader->Update();</div><div style="color:rgb(0,0,0);"><br></div><div style="color:rgb(0,0,0);">
/QuangT</div></font></font><br><div class="yiv1341304903gmail_quote">2011/12/13 Malsoaz James <span dir="ltr"><<a rel="nofollow" ymailto="mailto:jmalsoaz@yahoo.fr" target="_blank" href="mailto:jmalsoaz@yahoo.fr">jmalsoaz@yahoo.fr</a>></span><br><blockquote class="yiv1341304903gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div style="color:#000;background-color:#fff;font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt;"><div><div><div style="color:#000;background-color:#fff;font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt;">
<div>Hi,<span><br></span></div><div><br></div><div>I'm trying to use ITK v4. I have been able to install it successfully (note that the option ITK_USE_SYSTEM_GDCM doesn't work, it produce a link error to gdcmMSFF).</div>
<div>Anyway, I built it with the internal version of GDCM.<br></div><div><br></div><div>Unfortunately, when I try a reader class
such as itkImageFileReader, I got an error regarding the IO factory classes :</div><div>" Could not create IO object for file "C:/test.png"</div><div> Tried to create one of the
following:<br> You probably failed to set a file suffix, or set the suffix to an unsupported type."</div><div><br></div><div>As you can see, the list of IO object is empty. It seems ITK can't find them. I checked in the include dir and several IO files are available such as itkGDCMImageIO<br>
</div><div><br></div><div>Can someone tell me what's wrong ?</div><div><br></div><div>Regarding the CMakeLists, I created and used two variables <br></div><div>- a ITK_INCLUDE_DIR (path to the include dir) to find the include files<br>
</div><div>- a ITK_LIBRARIES list (list of path to the
libs). Since the libs are not the same compared to ITKv3, I'm not sure which libraries to include in this list and in which order (if it matters), thus I listed all of them in alphabetical order.<br><br>I have no warning/error at compilation time.<br>
</div><div><br></div><div>I hope someone will be able to help me.</div><div>Best</div><div>James.</div></div></div></div></div></div><br>_____________________________________<br>
Powered by <a rel="nofollow" target="_blank" href="http://www.kitware.com">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a rel="nofollow" target="_blank" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a rel="nofollow" target="_blank" href="http://www.kitware.com/products/protraining.html">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a rel="nofollow" target="_blank" href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a rel="nofollow" target="_blank" href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br></div>
</div><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>