[Insight-users] how to Include itk library in QT Desainer: Use Flat ITK Installation

Darren Weber darren.weber.lists at gmail.com
Tue Mar 16 13:02:28 EDT 2010


Something like this bash script may help to list all the paths for the
linker (adapt the prefix and library path to your installation):


#!/bin/bash
prefix=/opt/local/include
find ${prefix}/InsightToolkit-3.16 -type d -exec echo '-L{}' \;


Regards,
Darren



On Mon, Mar 15, 2010 at 9:28 AM, Luis Ibanez <luis.ibanez at kitware.com>wrote:

> Hi Sutrisno,
>
>
> A) My apologies for the confusion with Eclipse.
>     Thanks for restating that you are using Qt Designer.
>
>     Please note that QtDesigner is not a build system.
>     You could still use CMake for configuring your project,
>     and avoid the unecessarily painful experience of having
>     to manually set up all these paths.
>
>
>
> B)  The CMake option:
>
>           ITK_USE_FLAT_DIRECTORY_INSTALL
>
>        was not available in ITK 3.16.
>
>       This option was added after that release,
>       more precisely it was added on October 22nd 2009:
>
>
> http://www.itk.org/cgi-bin/viewcvs.cgi/CMakeLists.txt?root=Insight&r1=1.354&r2=1.355
>
>        In order to use this feature you should get a fresh
>        checkout of the CVS repository.
>
>
>
> C)  If you don't use this INSTALL option,
>      here is the list of paths that you should add to your
>      compiler command line:
>
> ./include
> ./include/InsightToolkit
> ./include/InsightToolkit/IO
> ./include/InsightToolkit/gdcm
> ./include/InsightToolkit/gdcm/src
> ./include/InsightToolkit/gdcm/Dicts
> ./include/InsightToolkit/Common
> ./include/InsightToolkit/Patented
> ./include/InsightToolkit/Review
> ./include/InsightToolkit/Algorithms
> ./include/InsightToolkit/Numerics
> ./include/InsightToolkit/Numerics/FEM
> ./include/InsightToolkit/Numerics/Statistics
> ./include/InsightToolkit/Numerics/NeuralNetworks
> ./include/InsightToolkit/Utilities
> ./include/InsightToolkit/Utilities/vxl
> ./include/InsightToolkit/Utilities/vxl/v3p
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/opt
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/datapac
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/blas
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/laso
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/eispack
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/linpack
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/mathews
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/minpack
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/lapack
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/lapack/util
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/lapack/complex16
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/lapack/double
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/lapack/single
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/linalg
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/napack
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/sparse
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/temperton
> ./include/InsightToolkit/Utilities/vxl/vcl
> ./include/InsightToolkit/Utilities/vxl/vcl/gcc
> ./include/InsightToolkit/Utilities/vxl/vcl/iso
> ./include/InsightToolkit/Utilities/vxl/vcl/sgi
> ./include/InsightToolkit/Utilities/vxl/vcl/egcs
> ./include/InsightToolkit/Utilities/vxl/vcl/emulation
> ./include/InsightToolkit/Utilities/vxl/vcl/borland55
> ./include/InsightToolkit/Utilities/vxl/vcl/borland56
> ./include/InsightToolkit/Utilities/vxl/vcl/stlport
> ./include/InsightToolkit/Utilities/vxl/vcl/gcc-295
> ./include/InsightToolkit/Utilities/vxl/vcl/generic
> ./include/InsightToolkit/Utilities/vxl/vcl/mwerks
> ./include/InsightToolkit/Utilities/vxl/vcl/vcl_sys
> ./include/InsightToolkit/Utilities/vxl/vcl/sunpro
> ./include/InsightToolkit/Utilities/vxl/vcl/win32-vc60
> ./include/InsightToolkit/Utilities/vxl/vcl/win32-vc70
> ./include/InsightToolkit/Utilities/vxl/vcl/gcc-libstdcxx-v3
> ./include/InsightToolkit/Utilities/vxl/core
> ./include/InsightToolkit/Utilities/vxl/core/vnl
> ./include/InsightToolkit/Utilities/vxl/core/vnl/algo
> ./include/InsightToolkit/Utilities/expat
> ./include/InsightToolkit/Utilities/MetaIO
> ./include/InsightToolkit/Utilities/NrrdIO
> ./include/InsightToolkit/Utilities/itkExtHdrs
> ./include/InsightToolkit/Utilities/itkpng
> ./include/InsightToolkit/Utilities/itksys
> ./include/InsightToolkit/Utilities/itksys/ios
> ./include/InsightToolkit/Utilities/itksys/stl
> ./include/InsightToolkit/Utilities/itktiff
> ./include/InsightToolkit/Utilities/itkzlib
> ./include/InsightToolkit/SpatialObject
> ./include/InsightToolkit/BasicFilters
>
>      As you can see there are a lot of directories to include.
>
>
> C)  If you use this INSTALL option,
>      here is the list of paths that you should add to your
>      compiler command line:
>
> ./include/InsightToolkit
> ./include/InsightToolkit/gdcm
> ./include/InsightToolkit/gdcm/src
> ./include/InsightToolkit/gdcm/Dicts
> ./include/InsightToolkit/Utilities
> ./include/InsightToolkit/Utilities/MetaIO
> ./include/InsightToolkit/Utilities/itksys
> ./include/InsightToolkit/Utilities/itksys/stl
> ./include/InsightToolkit/Utilities/itksys/ios
> ./include/InsightToolkit/Utilities/vxl
> ./include/InsightToolkit/Utilities/vxl/vcl
> ./include/InsightToolkit/Utilities/vxl/vcl/mwerks
> ./include/InsightToolkit/Utilities/vxl/vcl/sgi
> ./include/InsightToolkit/Utilities/vxl/vcl/gcc
> ./include/InsightToolkit/Utilities/vxl/vcl/iso
> ./include/InsightToolkit/Utilities/vxl/vcl/gcc-libstdcxx-v3
> ./include/InsightToolkit/Utilities/vxl/vcl/win32-vc60
> ./include/InsightToolkit/Utilities/vxl/vcl/sunpro
> ./include/InsightToolkit/Utilities/vxl/vcl/generic
> ./include/InsightToolkit/Utilities/vxl/vcl/stlport
> ./include/InsightToolkit/Utilities/vxl/vcl/emulation
> ./include/InsightToolkit/Utilities/vxl/vcl/borland55
> ./include/InsightToolkit/Utilities/vxl/vcl/egcs
> ./include/InsightToolkit/Utilities/vxl/vcl/win32-vc70
> ./include/InsightToolkit/Utilities/vxl/vcl/gcc-295
> ./include/InsightToolkit/Utilities/vxl/vcl/vcl_sys
> ./include/InsightToolkit/Utilities/vxl/vcl/borland56
> ./include/InsightToolkit/Utilities/vxl/core
> ./include/InsightToolkit/Utilities/vxl/core/vnl
> ./include/InsightToolkit/Utilities/vxl/core/vnl/algo
> ./include/InsightToolkit/Utilities/vxl/v3p
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/laso
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/sparse
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/lapack
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/lapack/util
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/lapack/double
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/lapack/complex16
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/lapack/single
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/linpack
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/datapac
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/blas
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/napack
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/opt
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/temperton
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/minpack
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/eispack
> ./include/InsightToolkit/Utilities/vxl/v3p/netlib/mathews
>
>
> There are still a lot of directories, but now all ITK headers
> are copied in the directory
>
>                           ./include/InsightToolkit
>
> and the remaining directories are for third party libraries,
> most notably: vxl.
>
>
>
>         Regards,
>
>
>                 Luis
>
>
>
>
> ------------------------------------------------------------------------------
> On Sun, Mar 14, 2010 at 10:08 AM, SUTRISNO SUTRISNO
> <sutrisno_link at yahoo.com> wrote:
> >  Hi Luis,
> >
> > Thanks for your suggestion, but I'm still confuse with my problem.
> >  for your option:
> > A) Configure your Eclipse application with CMake,
> > I didn't use Eclipse but used QT Desainer. And I didn't understand how to
> > configure with Cmake.
> > when I add  /usr/local/include/InsightToolkit/Common in includepath,
> there
> > were error :
> > g++ -c -pipe -g -Wall -W -O2 -D_REENTRANT  -DQT_NO_DEBUG
> -DQT_THREAD_SUPPORT
> > -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/share/qt3/mkspecs/default -I.
> > -I/usr/include/vtk-5.0 -I/usr/local/include/InsightToolkit
> > -I/usr/local/include/InsightToolkit/Common -I/usr/include/qt3 -I.ui/ -I.
> > -I.moc/ -o .obj/form1.o .ui/form1.cpp
> > In file included from
> > /usr/local/include/InsightToolkit/Common/itkTimeStamp.h:23,
> >                  from
> > /usr/local/include/InsightToolkit/Common/itkLightObject.h:21,
> >                  from
> > /usr/local/include/InsightToolkit/Common/itkObject.h:23,
> >                  from
> > /usr/local/include/InsightToolkit/Common/itkDataObject.h:23,
> >                  from
> > /usr/local/include/InsightToolkit/Common/itkImageBase.h:23,
> >                  from
> > /usr/local/include/InsightToolkit/Common/itkImage.h:20,
> >                  from .ui/../form1.ui.h:1,
> >                  from .ui/form1.cpp:19:
> > /usr/local/include/InsightToolkit/Common/itkMacro.h:42:26: error:
> > vnl/vnl_math.h: No such file or directory
> > In file included from
> >
> /usr/local/include/InsightToolkit/Common/itkNumericTraitsFixedArrayPixel.h:20,
> >                  from
> > /usr/local/include/InsightToolkit/Common/itkFixedArray.txx:21,
> >                  from
> > /usr/local/include/InsightToolkit/Common/itkFixedArray.h:261,
> >                  from
> > /usr/local/include/InsightToolkit/Common/itkIndex.h:23,
> >                  from
> > /usr/local/include/InsightToolkit/Common/itkImageRegion.h:25,
> >                  from
> > /usr/local/include/InsightToolkit/Common/itkImageBase.h:25,
> >                  from
> > /usr/local/include/InsightToolkit/Common/itkImage.h:20,
> >                  from .ui/../form1.ui.h:1,
> >                  from .ui/form1.cpp:19:
> >                  ..............
> >                  ..............
> >                  ff
> >
> > is itk different with vtk?why vtk header can be included but itk cann't
> be
> > included in my project?
> >
> > B) Install ITK using the "Flat" option
> > I use InsightToolkit-3.16.0. When I run ccmake to reconfigure my ITK
> build
> > there wasn't  option   ITK_USE_FLAT_DIRECTORY_INSTALL.
> > There were only options:
> > ITK_USE_CENTERED_PIXEL_COORDIN
> > ON
> >  ITK_USE_CONCEPT_CHECKING
> > ON
> >  ITK_USE_CONSOLIDATED_MORPHOLOG
> > OFF
> >  ITK_USE_DEPRECATED_LEVELSET_IN
> > OFF
> >  ITK_USE_KWSTYLE
> > OFF
> >  ITK_USE_LIBXML2                  OFF
> >  ITK_USE_MINC2
> > OFF
> >  ITK_USE_OPTIMIZED_REGISTRATION
> > OFF
> >  ITK_USE_ORIENTED_IMAGE_DIRECTI
> > ON
> >  ITK_USE_PATENTED
> > OFF
> >  ITK_USE_REGION_VALIDATION_IN_I
> > ON
> >  ITK_USE_REVIEW
> > ON
> >  ITK_USE_REVIEW_STATISTICS
> > OFF
> >  ITK_USE_STRICT_CONCEPT_CHECKIN
> > OFF
> >  ITK_USE_SYSTEM_GDCM
> > OFF
> >  ITK_USE_SYSTEM_LIBXML2
> > OFF
> >  ITK_USE_SYSTEM_PNG
> > OFF
> >  ITK_USE_SYSTEM_TIFF
> > OFF
> >  ITK_USE_SYSTEM_VXL
> > OFF
> >  ITK_USE_SYSTEM_ZLIB
> > OFF
> >  ITK_USE_TEMPLATE_META_PROGRAMM
> > ON
> >  ITK_USE_TRANSFORM_IO_FACTORIES   OFF
> >
> >   Regards,
> >
> > ________________________________
> > Dari: Luis Ibanez <luis.ibanez at kitware.com>
> > Kepada: SUTRISNO SUTRISNO <sutrisno_link at yahoo.com>
> > Cc: itk <Insight-users at itk.org>
> > Terkirim: Sab, 13 Maret, 2010 02:06:35
> > Judul: Re: how to Include itk library in QT Desainer: Use Flat ITK
> > Installation
> >
> > Hi  Sutrisno,
> >
> >
> > When you install ITK, it doesn't install by default all the
> > header files in a single directory.
> >
> > Therefore passing only the directory
> >
> >               /usr/local/include/InsightToolkit
> >
> > to your linker is not enough.
> >
> >
> > You need to pass all the subdirectories of that directory as well.
> >
> > There are two options for making this process easier:
> >
> >
> >
> >   A) Configure your Eclipse application with CMake,  or
> >   B) Install ITK using the "Flat" option
> >
> >
> > Option (A) is self-explanatory, so let me just describe a bit
> > the process for Option (B):
> >
> >
> > What you should do is to reconfigure your ITK build with
> > CMake and turn ON the option:
> >
> >                 ITK_USE_FLAT_DIRECTORY_INSTALL
> >
> > Then, do
> >
> >                                   make install
> >
> >
> > Once you do this, ITK will install its headers in a smaller set
> > of subdirectories (still is not a single directory, but at least
> > they will be a smaller set).
> >
> > At that point, in your application that uses ITK you MUST add
> > the -I options for ALL the sub directories that you will see in
> > the InsightToolkit/include directory.
> >
> >
> >
> >       Regards,
> >
> >
> >               Luis
> >
> >
> >
> ------------------------------------------------------------------------------------------------------
> > On Thu, Mar 11, 2010 at 2:56 AM, SUTRISNO SUTRISNO
> > <sutrisno_link at yahoo.com> wrote:
> >> Hi luis,
> >> I'm a student of Electrical Eng. ITS Indonesia , my final Project is
> about
> >> Medical Image.
> >> I am new in ITK and I just installed the program and run some itk
> examples
> >> with Cmake, it run successfully.
> >>
> >> But when I use QT Desainer , and try to uses itk&vtk header: (see in my
> >> attachment file)
> >> #include "itkImage.h"
> >> #include "itkImageFileReader.h"
> >> #include "itkGradientMagnitudeImageFilter.h"
> >>
> >> #include "vtkRenderer.h"
> >> #include "vtkRenderWindow.h"
> >> #include "vtkRenderWindowInteractor.h"
> >> #include "vtkPolyDataMapper.h"
> >>
> >> libs path : -L/usr/lib/vtk-5.0 -L/usr/local/lib/InsightToolkit
> >> includepath : /usr/include/vtk-5.0 /usr/local/include/InsightToolkit
> >>
> >> I don't understand why when I run the qmake command the output is that:
> >>
> >> sutrisno at sutrisno-pc:~/project-sut/project11$ qmake
> >> sutrisno at sutrisno-pc:~/project-sut/project11$ make
> >> /usr/share/qt3/bin/uic form1.ui -o .ui/form1.h
> >> g++ -c -pipe -g -Wall -W -O2 -D_REENTRANT  -DQT_NO_DEBUG
> >> -DQT_THREAD_SUPPORT
> >> -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/share/qt3/mkspecs/default -I.
> >> -I/usr/include/vtk-5.0 -I/usr/local/include/InsightToolkit
> >> -I/usr/include/qt3 -I.ui/ -I. -I.moc/ -o .obj/main.o main.cpp
> >> /usr/share/qt3/bin/uic form1.ui -i form1.h -o .ui/form1.cpp
> >> g++ -c -pipe -g -Wall -W -O2 -D_REENTRANT  -DQT_NO_DEBUG
> >> -DQT_THREAD_SUPPORT
> >> -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/share/qt3/mkspecs/default -I.
> >> -I/usr/include/vtk-5.0 -I/usr/local/include/InsightToolkit
> >> -I/usr/include/qt3 -I.ui/ -I. -I.moc/ -o .obj/form1.o .ui/form1.cpp
> >> In file included from .ui/form1.cpp:19:
> >> .ui/../form1.ui.h:1:22: error: itkImage.h: No such file or directory
> >> .ui/../form1.ui.h:2:32: error: itkImageFileReader.h: No such file or
> >> directory
> >> .ui/../form1.ui.h:3:45: error: itkGradientMagnitudeImageFilter.h: No
> such
> >> file or directory
> >> In file included from /usr/include/c++/4.3/backward/strstream:51,
> >>                  from /usr/include/vtk-5.0/vtkIOStream.h:36,
> >>                  from /usr/include/vtk-5.0/vtkSystemIncludes.h:40,
> >>                  from /usr/include/vtk-5.0/vtkIndent.h:24,
> >>                  from /usr/include/vtk-5.0/vtkObjectBase.h:43,
> >>                  from /usr/include/vtk-5.0/vtkObject.h:41,
> >>                  from /usr/include/vtk-5.0/vtkViewport.h:32,
> >>                  from /usr/include/vtk-5.0/vtkRenderer.h:32,
> >>                  from .ui/../form1.ui.h:6,
> >>                  from .ui/form1.cpp:19:
> >> /usr/include/c++/4.3/backward/backward_warning.h:33:2: warning: #warning
> >> This file includes at least one deprecated or antiquated header which
> may
> >> be
> >> removed without further notice at a future date. Please use a
> >> non-deprecated
> >> interface with equivalent functionality instead. For a listing of
> >> replacement headers and interfaces, consult the file backward_warning.h.
> >> To
> >> disable this warning use -Wno-deprecated.
> >> In file included from .ui/form1.cpp:16:
> >> /usr/include/qt3/qimage.h: In member function ‘bool
> >> QImageTextKeyLang::operator<(const QImageTextKeyLang&) const’:
> >> /usr/include/qt3/qimage.h:61: warning: suggest parentheses around &&
> >> within
> >> ||
> >> make: *** [.obj/form1.o] Error 1
> >>
> >> Best regards,
> >> Sutrisno
> >>
> >>
> >>
> >> ________________________________
> >> Menambah banyak teman sangatlah mudah dan cepat.
> >> Undang teman dari Hotmail, Gmail ke Yahoo! Messenger sekarang!
> >
> > ________________________________
> > Coba Yahoo! Mail baru yang LEBIH CEPAT. Rasakan bedanya sekarang!
> _____________________________________
> 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.html
>
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100316/a2590f0f/attachment-0003.htm>


More information about the Insight-users mailing list