[Insight-users] ITK+QT

Alessandro notinmyhead at gmail.com
Fri Sep 28 06:06:53 EDT 2012


Hi,

your problem is quite common and easy to solve. Most ITK user resort to CMake because it automatically solves all library dependencies. It's very helpful when CLI applications have to be built but it is not so handful within QT (especially using QT Creator).

Solution is open your Terminal, look for ITK library and, progressively, solve by hand your dependencies. You're including too few libraries. As instance, while you're including itkGDCMImageIO.h you need to add -lITKGDCM-4.2 to libs. 

To simplicity I tend to include more libs than needed (some can be missed since I use ITK with external GDCM library...). Yet it is a start:

-lITKBiasCorrection-4.2 \
-lITKBioCell-4.2 \
-lITKCommon-4.2 \
-lITKDeprecated-4.2 \
-lITKDICOMParser-4.2 \
-lITKEXPAT-4.2 \
-lITKFEM-4.2 \
               -lITKgiftiio-4.2 \
                                        -litkhdf5-4.2 \
                                        -litkhdf5_cpp-4.2 \
                                        -lITKIOBioRad-4.2 \
                                        -lITKIOBMP-4.2 \
                                        -lITKIOCSV-4.2 \
                    -lITKIOGDCM-4.2 \
                    -lITKGDCM-4.2\
                                        -lITKIOGE-4.2 \
                                        -lITKIOGIPL-4.2 \
                                        -lITKIOHDF5-4.2 \
                    -lITKIOImageBase-4.2 \
                    -lITKIOIPL-4.2 \
                    -lITKIOJPEG-4.2 \
-lITKIOLSM-4.2 \
                    -lITKIOMesh-4.2 \
                    -lITKIOMeta-4.2 \
                    -lITKIONIFTI-4.2 \
                                        -lITKIONRRD-4.2 \
                                        -lITKIOPNG-4.2 \
                                        -lITKIOSiemens-4.2 \
                    -lITKIOSpatialObjects-4.2 \
-lITKIOStimulate-4.2 \
                    -lITKIOTIFF-4.2 \
                    -lITKIOTransformBase-4.2 \
                                        -lITKIOTransformHDF5-4.2 \
                                        -lITKIOTransformInsightLegacy-4.2 \
                                        -lITKIOTransformMatlab-4.2 \
                                        -lITKIOVTK-4.2 \
                    -lITKIOXML-4.2 \
                    -litkjpeg-4.2 \
                                        -lITKKLMRegionGrowing-4.2 \
                                        -lITKLabelMap-4.2 \
                                        -lITKMesh-4.2 \
                    -lITKMetaIO-4.2 \
                    -litkNetlibSlatec-4.2 \
                                        -lITKniftiio-4.2 \
                                        -lITKNrrdIO-4.2 \
    #                -litkopenjpeg-4.2 \
                    -lITKOptimizers-4.2 \
                    -lITKOptimizersv4-4.2 \
                    -lITKPath-4.2 \
                    -litkpng-4.2 \
                    -lITKStatistics-4.2 \
                                        -lITKPolynomials-4.2 \
                                        -lITKQuadEdgeMesh-4.2 \
                                        -lITKReview-4.2 \
                                        -lITKSpatialObjects-4.2 \
                                        -lITKStatistics-4.2 \
                                        -litksys-4.2 \
                                        -litktiff-4.2 \
                                        -litkv3p_lsqr-4.2 \
                                        -litkv3p_netlib-4.2 \
                                        -litkvcl-4.2 \
                                        -lITKVideoCore-4.2 \
                                        -lITKVideoIO-4.2 \
                                        -litkvnl-4.2 \
                                        -lITKVNLInstantiation-4.2 \
                                        -litkvnl_algo-4.2 \
                                        -lITKVTK-4.2 \
                                        -lITKWatersheds-4.2 \
                                        -litkzlib-4.2 \
                                        -lITKznz-4.2

Then follow the linker errors to include missing library.

Hope it helps!
Ale


Il giorno 28/set/2012, alle ore 10.58, Fabiola Fischer ha scritto:

> Hi Ale,
> 
> Libs:  LIBS += -L/usr/local/lib/ \
>          -lITKCommon-4.2 \
>          -lITKDICOMParser-4.2
> 
> In the source included headers: 
> #include "itkImage.h"
> #include "itkGDCMImageIO.h"
> #include "itkGDCMSeriesFileNames.h"
> #include "itkImageSeriesReader.h"
> #include "itkImageFileWriter.h"
> (actually I just copied the example from here. )
> 
> Thanks in advance, 
> Fabiola.
> 
> 2012/9/28 Alessandro <notinmyhead at gmail.com>
> could you post the complete set of libs you're trying to include in the project?
> 
> Ale
> 
> ps: please answer to the insight user list so it may be useful to all...
> 
> Il giorno 27/set/2012, alle ore 16.55, Alessandro ha scritto:
> 
> > Since you're including 4.2 version of the include files, you need to change your library version to -lITKCommon-4.2 and so on
> >
> > Ale
> >
> > Il giorno 27/set/2012, alle ore 15.46, fabiola ha scritto:
> >
> >> Hello,
> >>
> >> I am sorry barging in with a silly question, but I am really stuck in the
> >> beginning: to compile an ITK example (DicomSeriesReadImageWrite2) in QT.
> >> I am using: Ubuntu 12.04, QT Creator 2.5.2 and ITK 4.2.
> >>
> >> I added ITK libraries to .pro like I did before for VTK (and it worked):
> >> INCLUDEPATH += /usr/local/include/vtk-5.10 \
> >>              /usr/local/include/ITK-4.2
> >>
> >> LIBS += -lvtkDICOMParser \
> >>       -lvtkRendering \
> >>       -lvtkCommon  \
> >>       -lvtkIO    \
> >>       -lvtkFiltering  \
> >>       -lQVTK \
> >>
> >> LIBS += -L/usr/local/lib/ \
> >>        -lITKCommon-4.1 \
> >>        -lITKDICOMParser-4.1
> >>
> >> QMAKE_CXXFLAGS += -Wno-deprecated
> >>
> >> but unfortunately the compiler telling me that: "cannot find
> >> -lITKCommon-4.1" (I checked, the libraries are in my /usr/local/lib...)
> >>
> >> Please help me out. I can't find any solution on the net, just seeing that
> >> the others had the same problem, but no solution...
> >>
> >> Thank you in advance,
> >> Fabiola.
> >>
> >>
> >>
> >> --
> >> View this message in context: http://itk-users.7.n7.nabble.com/ITK-QT-tp29470p29571.html
> >> Sent from the ITK - Users mailing list archive at Nabble.com.
> >> _____________________________________
> >> Powered by www.kitware.com
> >>
> >> Visit other Kitware open-source projects at
> >> http://www.kitware.com/opensource/opensource.html
> >>
> >> Kitware offers ITK Training Courses, for more information visit:
> >> http://www.kitware.com/products/protraining.php
> >>
> >> Please keep messages on-topic and check the ITK FAQ at:
> >> http://www.itk.org/Wiki/ITK_FAQ
> >>
> >> Follow this link to subscribe/unsubscribe:
> >> http://www.itk.org/mailman/listinfo/insight-users
> >
> 
> _____________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
> 



More information about the Insight-users mailing list