I'm not using a CmakeLists.txt. It's a existing Qt Creator project, so I'm using a <a href="http://project.pro">project.pro</a> file, where you configure the directories with libraries and header files. The same for vtk. I was trying to use mitk, but it I think it only works with cmake files (still trying).<br>
<br>In the .pro file:<br><br>INCLUDEPATH += /usr/local/include/vtk-5.10<br>LIBS += -L/usr/local/lib/vtk-5.10 \<br> -lvtkNetCDF_cxx -lvtkVolumeRendering \<br> -lvtkCommon -lvtksys...<br>
<br><br>INCLUDEPATH += /usr/local/include/ITK-4.2<br>LIBS += -L/usr/local/lib \<br> -lvtkNetCDF_cxx -lvtkVolumeRendering \<br> -lITKVideoIO-4.2 -lITKVideoCore-4.2 -lITKReview-4.2 -lITKOptimizersv4-4.2 \<br>
-lITKIOTransformMatlab-4.2 -lITKIOTransformInsightLegacy-4.2 -lITKIOTransformHDF5-4.2 \<br> -lITKIOTransformBase-4.2 -lITKIOHDF5-4.2 -lITKIOCSV-4.2 -litkhdf5_cpp-4.2 \<br> -litkhdf5-4.2 -lITKWatersheds-4.2 -lITKVTK-4.2 -lITKKLMRegionGrowing-4.2 \<br>
-lITKIOSiemens-4.2 -lITKIOGE-4.2 -lITKIOIPL-4.2 -lITKFEM-4.2 -lITKDICOMParser-4.2 \<br> -lITKBioCell-4.2 -lITKBiasCorrection-4.2 -lITKPolynomials-4.2 -lITKQuadEdgeMesh-4.2 \<br> -lITKLabelMap-4.2 -lITKIOMesh-4.2 -lITKgiftiio-4.2 -lITKIOSpatialObjects-4.2 \<br>
-lITKIOXML-4.2 -lITKOptimizers-4.2 -lITKSpatialObjects-4.2 -lITKMesh-4.2 \<br> -lITKPath-4.2 -lITKStatistics-4.2 -litkNetlibSlatec-4.2 -lITKIOLSM-4.2 \<br> -lITKIOVTK-4.2 -lITKIOStimulate-4.2 -lITKIONRRD-4.2 -lITKNrrdIO-4.2 -lITKIOBMP-4.2 \<br>
-lITKIOBioRad-4.2 -lITKIOGDCM-4.2 -litkgdcmMSFF-4.2 -litkgdcmjpeg12-4.2 \<br> -litkgdcmjpeg8-4.2 -litkgdcmuuid-4.2 -litkgdcmjpeg16-4.2 -litkopenjpeg-4.2 \<br> -litkgdcmDICT-4.2 -litkgdcmIOD-4.2 -lITKEXPAT-4.2 -litkgdcmDSED-4.2 -litkgdcmCommon-4.2 \<br>
-lITKIOMeta-4.2 -lITKMetaIO-4.2 -lITKIOTIFF-4.2 -litktiff-4.2 -lITKIOGIPL-4.2 \<br> -lITKIOJPEG-4.2 -litkjpeg-4.2 -lITKIONIFTI-4.2 -lITKniftiio-4.2 -lITKznz-4.2 \<br> -lITKIOPNG-4.2 -litkpng-4.2 -litkzlib-4.2 -lITKIOImageBase-4.2 -lITKCommon-4.2 \<br>
-lITKVNLInstantiation-4.2 -litkvnl_algo-4.2 -litkvnl-4.2 -litkv3p_lsqr-4.2 \<br> -litkvcl-4.2 -litkv3p_netlib-4.2 -litksys-4.2<br><br>I think I added all libs, even those I don't need.<br>
<br><div class="gmail_extra"><br><br><div class="gmail_quote">2012/12/12 Bradley Lowekamp <span dir="ltr"><<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div>It sounds like ITK's imageIO factories are not being registered.</div><div><br></div>What does your cmake code look like?<div><br></div><div><br><div><div><div class="h5"><div>On Dec 12, 2012, at 7:54 AM, Marcos <<a href="mailto:fotosentido@gmail.com" target="_blank">fotosentido@gmail.com</a>> wrote:</div>
<br></div></div><blockquote type="cite"><div><div class="h5"><div><p>I'm using ITK 4.2 with Qt Creator.</p><p>Trying to read several images, I always get the same:</p>
<blockquote><p>itk::ImageFileReaderException (0x1efccb0)
Location: "void itk::ImageFileReader::GenerateOutputInformation()
[with TOutputImage = itk::Image; ConvertPixelTraits =
itk::DefaultConvertPixelTraits]" </p><p>File: /usr/local/include/ITK-4.2/itkImageFileReader.hxx
Line: 143</p><p>Description: <strong>Could not create IO object</strong> for file /home/marcos/d2.dcm</p><p>Tried to create one of the following:
You probably failed to set a file suffix, or
set the suffix to an unsupported type.</p>
</blockquote><p>I've successfully readed it with </p>
<pre><code>vtkGDCMImageReader* reader = vtkGDCMImageReader::New();
reader->SetFileName(fileName);
reader->Update();
vtkImageData* imageData = reader->GetOutput();
cout << "imageData->GetScalarTypeAsString(): " << imageData->GetScalarTypeAsString() << endl;
</code></pre><p>And <em>GetScalarTypeAsString()</em> returns <strong>unsigned short</strong>.
Anyway, I tried with unsigned long, unsigned int, double, int, short, short unsigned int, unsigned char... I got the same.</p><p>Edit: other tip, with gdcminfo I get UINT16 as ScalarType.<br></p><p>This is the code:</p>
<pre><code>typedef itk::Image <unsigned short> ImageType;
typedef itk::ImageFileReader<ImageType> ReaderType;
ReaderType::Pointer reader = ReaderType::New();
try
{
reader->SetFileName(nombreFichero);
}
catch (itk::ExceptionObject& excep)
{
cerr << excep << endl;
return;
}
<br><br>Any ideas? Thanks in advance.<br></code></pre>
</div></div></div>
_____________________________________<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>
</blockquote></div><br></div></div></blockquote></div><br></div>