[ITK-users] Problems integrating itk in own project

Francois Budin francois.budin at kitware.com
Mon Mar 27 09:18:52 EDT 2017


Hello Wolfgang,

Glad you figured out your issue. If that is an option for your project, it
might be a good idea to update ITK to the newest version (4.11) as 3.20 is
a very old version and many things have been improved since that version.

Francois

On Mon, Mar 27, 2017 at 4:18 AM, Wolfgang Aichinger <
aichinger_wolfgang at web.de> wrote:

> Hi again,
>
> I got the itk sources along with the project code and it seems that a bug
> was included. Getting a fresh version (3.20 as it was originally intended)
> did the job. Everything works fine now.
>
> Thank you for getting me to the idea.
>
> Best,
> Wolfgang
>
> *Gesendet:* Montag, 27. März 2017 um 09:15 Uhr
> *Von:* "Wolfgang Aichinger" <aichinger_wolfgang at web.de>
> *An:* "Christina Rossmanith" <ChrRossmanith at gmx.de>
> *Cc:* insight-users at itk.org
> *Betreff:* Re: [ITK-users] Problems integrating itk in own project
> Hi Christina,
>
> Simply replacing "cxx" by "hxx" did not work for me. I do not even have a
> corresponding ".hxx" file. Are you sure I should have one? Maybe I have to
> download all files again from the website.
> It also seems to be a more general problem, as removing the line with the
> include only leads to similar errors in "itkLinearInterpolateFunction" and
> "itkresamplefilter". Removing all problematic includes of course results in
> linker errors (LNK2019).
>
> Regards,
> Wolfgang
>
> *Gesendet:* Montag, 27. März 2017 um 08:05 Uhr
> *Von:* "Christina Rossmanith" <ChrRossmanith at gmx.de>
> *An:* "Wolfgang Aichinger" <aichinger_wolfgang at web.de>
> *Cc:* insight-users at itk.org
> *Betreff:* Aw: [ITK-users] Problems integrating itk in own project
> Hi Wolfgang,
>
> as far as I can see itkMattesMutualInformationImageToImageMetric.hxx is
> included in itkMattesMutualInformationImageToImageMetric.h, not .cxx
> You should include .h in your source file not .hxx, maybe the examples
> referenced in the documentation [1]
> <https://itk.org/Doxygen/html/classitk_1_1MattesMutualInformationImageToImageMetric.html#a871ef33754a0a0d373a3e76ff78c7189>
> can help you.
>
> Regards,
> Christina
>
>
> *Gesendet:* Montag, 27. März 2017 um 07:18 Uhr
> *Von:* "Wolfgang Aichinger" <aichinger_wolfgang at web.de>
> *An:* insight-users at itk.org
> *Betreff:* [ITK-users] Problems integrating itk in own project
> Hi all,
>
> I'm new to itk and to be honest also to using external libraries, so
> excuse me if my question is dumb . I have problems with using ITK 3.20 in a
> project on Windows using VS2010. I built ITK using cmake (no examples, no
> tests, with shared libs). With this configuration I was able to compile
> successfully and to install.
> For my project I also have a cmakeLists.txt (below) and was able to
> include all headers. Anyways, I get an error:
>
> Error 1 error C1083: Cannot open include file: '
> itkMattesMutualInformationImageToImageMetric.cxx': No such file or
> directory D:\extern\ITK\include\InsightToolkit\
> itkMattesMutualInformationImageToImageMetric.h 516
>
> This file is in the original sources but not copied during installation.
> Should this be the case? What flag in cmake would enforce this?
> This include is surrounded by an #infdef ITK_MANUAL_INSTANTIATION, which
> is obviously not defined. Could the error be here?
> In the project the path where all itk libraries are installed is set
> correctly to "Additional Library Directories" :
>
> D:/extern/ITK/lib/InsightToolkit
> D:/extern/ITK/lib/InsightToolkit/$(Configuration)
>
> I'm probably missing a step that solves it all but I don't have an
> idea right now.
>
> Thanks for any help!
>
> Best,
> Wolfgang
>
> #CMakeLists.txt
> PROJECT (RigidRegistration)
> SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "D:/extern/ITK/lib/
> InsightToolkit")
> find_package(ITK)
> IF(ITK_USE_FILE)
>  INCLUDE(${ITK_USE_FILE})
>  MESSAGE( STATUS "ITK_USE_FILE:  " ${ITK_USE_FILE})
> ENDIF(ITK_USE_FILE)
>
> SET(RigidRegistration
>   rigid_registration_of_multimodal_MR_knee_data.cxx
> )
> ADD_EXECUTABLE(RigidRegistration ${RigidRegistration})
>
> TARGET_LINK_LIBRARIES(RigidRegistration
>  ${ITK_LIBRARIES}
> )
>
> _____________________________________ 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://public.kitware.com/
> 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://public.kitware.com/
> 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://public.kitware.com/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20170327/958759d9/attachment.html>


More information about the Insight-users mailing list