[Insight-developers] Using ITK with DCMTK

Williams, Norman K norman-k-williams at uiowa.edu
Thu Nov 29 14:36:32 EST 2012


You say "Please note that SimpleITK is a little weird on how it uses ITK."

This 'weird' sounds as though it is the problem.  What I used to test an
ITK install (and also setting ITK_DIR to ITK-build, i.e.
using a build tree) is below. This arrangement works.  The ${ITK_USE_FILE}

--------------------CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
project(tst)

find_package(ITK REQUIRED)
include(${ITK_USE_FILE})

add_executable(tst tst.cxx)target_link_libraries(tst ${ITK_LIBRARIES})

-------------------------tst.cxx
#include <itkImage.h>
#include <itkDCMTKImageIO.h>


int main(int argc, char *argv[]){
  itk::DataObject::Pointer ptr = A();
  itk::DCMTKImageIO::Pointer imageio = itk::DCMTKImageIO::New();
  exit(0);
}




--
Kent Williams norman-k-williams at uiowa.edu






On 11/29/12 8:29 AM, "Bradley Lowekamp" <blowekamp at mail.nih.gov> wrote:

>Hello,
>
>I have narrowed down SimpleITK's issue[1] with building against that
>latest ITK with DCMTK to the following. After "find_package(ITK
>REQUIRED)" the following is defined:
>
>ITK_LIBRARY_DIRS:
>ITK_INCLUDE_DIRS:
>/home/blowekamp/build/SimpleITK/ITK-prefix/include/ITK-4.3
>
>But the libraries used on the command line are the following:
>
> -ldcmdata -ldcmimage -ldcmimgle -ldcmjpeg -ldcmjpls -ldcmnet -ldcmpstat
>-ldcmqrdb -ldcmsr -ldcmtls -lijg12 -lijg16 -lijg8 -loflog -lofstd
>
>Hence they are not found.
>
>That is they are relative, not absolute like the other ITK libraries. So
>some how these either need to be changed to be absolute or the
>ITK_LIBRARIES_DIRS, needs to be updated to include the installed path.
>
>Please note that SimpleITK is a little weird on how it uses ITK. It does
>not right away "include ( ${ITK_USE_FILE} )". And when the project is
>installed an includes it also does not include the ITK use file, it only
>export the LIBRARY_DIR path. This is because when you use SimpleITK from
>the C++ interface is does not expose any ITK headers, so it nicely
>encapsulated.
>
>Thanks,
>Brad
>
>[1] http://open.cdash.org/viewBuildError.php?buildid=2688206
>
>_______________________________________________
>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://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-developers



________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________


More information about the Insight-developers mailing list