[Insight-users] Trouble setting up ITK project

Xiaoxiao Liu xiaoxiao.liu at kitware.com
Wed Feb 27 10:51:32 EST 2013


On Mon, Feb 25, 2013 at 6:57 PM, Nikhil Chandra <nsc2124 at columbia.edu>wrote:

> Hi Xiaoxiao,
>
> Thank you for your help – I added the additional line to my CMakeLists.txt
> file and now everything compiles correctly.
>
> Is there any significant advantage to using v4 over v3?
>
> *
*
*>> You can find some details here: *
*http://www.cmake.org/Wiki/ITK/Release_4/Why_Switch_to_ITKv4*<http://www.cmake.org/Wiki/ITK/Release_4/Why_Switch_to_ITKv4>


Also, in InsightToolkit/Examples there is a large collection of sample
> programs that demonstrate how to perform various tasks using ITK, such as
> registration, input/output, etc. I have noticed that the code samples are
> embedded with documentation snippets. For example, in
> /Examples/Registration/ImageRegistration1.cxx, this is near the top:
>
> *// Software Guide : BeginLatex*
> *//*
> *// This example illustrates the use of the image registration framework
> in *
> *// Insight.  It should be read as a "Hello World" for ITK registration.
>  Which*
> *// means that for now, you don't ask ``why?''. Instead, use the example
> as an *
> *// introduction to the elements that are typically involved in solving
> an image*
> *// registration problem.*
> *// *
> *// \index{itk::Image!Instantiation}*
> *// \index{itk::Image!Header}*
> *//*
> *// A registration method requires the following set of components: two
> input*
> *// images, a transform, a metric, an interpolator and an optimizer. Some
> of*
> *// these components are parameterized by the image type for which the *
> *// registration is intended. The following header files provide
> declarations *
> *// of common types used for these components.*
> *//*
> *// Software Guide : EndLatex*
>
> My question is this: how do I extract all of the LaTeX documentation from
> all of the example programs, and put it into a PDF document? Is there a
> readily available mechanism for doing this? Is it somehow related to
> Doxygen?
>
> *>> Yes. The code and the latex magics  in Examples are used to generate
the SoftwareGuide book: http://www.itk.org/ItkSoftwareGuide.pdf*
*
*
*The doxygen is generated from the actual ITK source code documentations,
which is independent from the  the software guide.*




> Thanks,
> Nikhil
>
> From: Xiaoxiao Liu <xiaoxiao.liu at kitware.com>
> Date: Fri, 22 Feb 2013 13:37:01 -0500
> To: Nikhil Chandra <nsc2124 at columbia.edu>
> Cc: <insight-users at itk.org>
> Subject: Re: [Insight-users] Trouble setting up ITK project
>
> Hi Nikhil,
> Here is an example of building a "hello world" project with ITK:
>
> http://insightsoftwareconsortium.github.com/ITKBarCamp-doc/ITK/HelloWorld/index.html
> Looks like you are missing:         *include( ${ITK_USE_FILE} )*
> *
> *
> Highly encourage you to use ITK v4:
> http://sourceforge.net/projects/itk/files/itk/4.3/InsightToolkit-4.3.1.tar.gz/download
>
> Hope this helps.
> -Xiaoxiao
>
> On Fri, Feb 22, 2013 at 12:55 PM, Nikhil Chandra <nsc2124 at columbia.edu>wrote:
>
>> Hello,
>>
>> I recently installed ITK v3 on a CentOS 6 machine using ccmake with the
>> following options:
>>
>> BUILD_DOXYGEN                         OFF
>> BUILD_EXAMPLES                        ON
>> BUILD_SHARED_LIBS                     ON
>> BUILD_TESTING                         OFF
>> CMAKE_BACKWARDS_COMPATIBILITY         2.0
>> CMAKE_BUILD_TYPE                      Release
>> CMAKE_INSTALL_PREFIX                  /usr/local
>> ITK_USE_KWSTYLE                       OFF
>>
>> After pressing c + g inside ccmake, I followed this up with sudo make,
>> and sudo make install.
>>
>> I next installed VTK with the following options:
>>
>> BUILD_EXAMPLES                      ON
>> BUILD_SHARED_LIBS                   ON
>> BUILD_TESTING                       ON
>> CMAKE_BACKWARDS_COMPATIBILITY       2.0
>> CMAKE_BUILD_TYPE                    Debug
>> CMAKE_INSTALL_PREFIX                /usr/local
>> OpenQube_DIR                        OpenQube_DIR_NOTFOUND
>> QT_QMAKE_EXECUTABLE                 QT_QMAKE_EXECUTABLE-NOTFOUND
>> VTKMY_WRAP_TCL                      ON
>> VTK_DATA_ROOT                       VTK_DATA_ROOT-NOTFOUND
>> VTK_EXTRA_COMPILER_WARNINGS         OFF
>> VTK_LARGE_DATA_ROOT                 VTK_LARGE_DATA_ROOT-NOTFOUND
>> VTK_USE_CHARTS                      ON
>> VTK_USE_CHEMISTRY                   ON
>> VTK_USE_GEOVIS                      ON
>> VTK_USE_INFOVIS                     ON
>> VTK_USE_N_WAY_ARRAYS                ON
>> VTK_USE_PARALLEL                    ON
>> VTK_USE_QT                          OFF
>> VTK_USE_QTCHARTS                    OFF
>> VTK_USE_RENDERING                   ON
>> VTK_USE_TEXT_ANALYSIS               OFF
>> VTK_USE_VIEWS                       ON
>> VTK_WRAP_JAVA                       OFF
>> VTK_WRAP_PYTHON                     OFF
>> VTK_WRAP_PYTHON_SIP                 OFF
>> VTK_WRAP_TCL                        ON
>>
>> Again, after pressing c + g inside ccmake, I ran sudo make, and sudo make
>> install. In retrospect, I probably should have set BUILD_TESTING to OFF and
>> CMAKE_BUILD_TYPE to Release, but I don't think that this would have any
>> bearing on the problem I am facing currently.
>>
>> My next action was to create a new C++ project called ITKRegistration1 in
>> my home directory, using NetBeans. Here is the code that is currently in
>> main.cpp:
>>
>> #include <cstdlib>
>>
>> using namespace std;
>>
>> /*
>>  *
>>  */
>> int main(int argc, char** argv) {
>>
>>     return 0;
>> }
>>
>> I then tried to create a new Makefile using ccmake, by writing the
>> following code in CMakeLists.txt:
>>
>> cmake_minimum_required(VERSION 2.8)
>> project(ITKRegistration1)
>> add_executable(ITKRegistration1 main.cpp)
>> find_package(ITK)
>> if (ITK_FOUND)
>>     include_directories(${ITK_INCLUDE_DIRS})
>>     target_link_libraries (ITKRegistration1 ${ITK_LIBRARIES})
>> endif (ITK_FOUND)
>>
>> find_package(VTK)
>> if (VTK_FOUND)
>>     include_directories(${VTK_INCLUDE_DIRS})
>>     target_link_libraries (ITKRegistration1 ${VTK_LIBRARIES})
>> endif (VTK_FOUND)
>>
>> After hitting c + g, I tried running make, and I got the following error
>> message:
>>
>> Scanning dependencies of target ITKRegistration1
>> [100%] Building CXX object CMakeFiles/ITKRegistration1.dir/main.cpp.o
>> Linking CXX executable ITKRegistration1
>> /usr/bin/ld: cannot find -lITKAlgorithms
>> collect2: ld returned 1 exit status
>> make[2]: *** [ITKRegistration1] Error 1
>> make[1]: *** [CMakeFiles/ITKRegistration1.dir/all] Error 2
>> make: *** [all] Error 2
>>
>> In terminal, I ran the command: find /usr/local/itk -iname "*.so", and
>> there is a file called libITKAlgorithms.so located in /usr/local/itk/bin,
>> so I am not sure why this error message is taking place. Have I missed a
>> step during the installation of ITK? Is there something wrong with the code
>> I wrote for CMakeLists.txt?
>>
>> Any input would be appreciated, and thanks.
>>
>> Nikhil Chandra
>>
>> _____________________________________
>> 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
>>
>>
>
>
> --
>
>
> ---------------------------------------------
> *Xiaoxiao Liu*, Ph.D.
> R & D Engineer
> Kitware Inc <http://www.kitware.com/>.
> Clifton Park, NY
> Phone: (518) 881-4924  or  (518) 371-3971 x124
>
>


-- 


---------------------------------------------
*Xiaoxiao Liu*, Ph.D.
R & D Engineer
Kitware Inc <http://www.kitware.com/>.
Clifton Park, NY
Phone: (518) 881-4924  or  (518) 371-3971 x124
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130227/ac1a4b8d/attachment.htm>


More information about the Insight-users mailing list