Thanks Stefan. I am going to give it a shot. Best, Gwenael
Sent from Outlook<http://aka.ms/weboutlook> ________________________________ From: Dinkelacker, Stefan <s.dinkelac...@dkfz-heidelberg.de> Sent: 19 November 2019 21:01 To: Gwenael G <gwen.li...@hotmail.co.uk>; mitk-users@lists.sourceforge.net <mitk-users@lists.sourceforge.net> Subject: AW: using vnl_algo The CMakeLists.txt you are looking for is here: https://github.com/MITK/MITK/blob/v2016.11/Modules/RigidRegistration/CMakeLists.txt Dependencies are ITKRegistrationCommon and all public iTK package dependencies of MitkCore: ITKTransform, ITKImageGrid, ITKImageFeature, ITKIOImageBase, ITKIOGDCM, ITKIOHDF5, ITKIOLSM, ITKIOMRC, ITKIOBioRad, ITKIOGE, and ITKIOStimulate. I recommend to clone a seperate MITK and checkout v2016.11[1]. Then search for the string "CenteredTransformInitializer" in all .cpp files to get an idea of how it was used in MITK. [1] git clone -b v2018.11 --depth=1 https://github.com/MITK/MITK.git MITK-v2016.11 ________________________________ Von: Gwenael G <gwen.li...@hotmail.co.uk> Gesendet: Dienstag, 19. November 2019 16:11 An: Dinkelacker, Stefan; mitk-users@lists.sourceforge.net Betreff: Re: using vnl_algo Good point. I've just built and run a couple of examples you mentioned. No problem. I only have one ITK: the one in the super-build. I've found a reference to itk::CenteredTransformInitializer: http://docs.mitk.org/2016.11/QmitkCenteredEuler3DTransformView_8h_source.html I can't find this file in my local MITK though. I would like to have a look at the CMakeLists next to this file. Sent from Outlook<http://aka.ms/weboutlook> ________________________________ From: Dinkelacker, Stefan <s.dinkelac...@dkfz-heidelberg.de> Sent: 19 November 2019 14:54 To: Gwenael G <gwen.li...@hotmail.co.uk>; mitk-users@lists.sourceforge.net <mitk-users@lists.sourceforge.net> Subject: RE: using vnl_algo Okay, so if this is an error induced by simply using itk::CenteredTransformInitializer despite depending on ITKRegistrationCommon and ITKTransform, it could possibly indicate a bug in ITK, right? Did you already try to build and run one of the many examples mentioned in the documentation? https://itk.org/Doxygen413/html/classitk_1_1CenteredTransformInitializer.html From: Gwenael G [mailto:gwen.li...@hotmail.co.uk] Sent: Tuesday, November 19, 2019 3:28 PM To: Dinkelacker, Stefan <s.dinkelac...@dkfz-heidelberg.de>; mitk-users@lists.sourceforge.net Subject: Re: using vnl_algo Thanks for your time, Stefan, Unfortunately, the problem remains. The problem started when I tried to use itk::CenteredTransformInitializer. The error message was: Error LNK2019 unresolved external symbol "__declspec(dllimport) public: __cdecl vnl_real_eigensystem::vnl_real_eigensystem(class vnl_matrix<double> const &)" (__imp_??0vnl_real_eigensystem@@QEAA@AEBV?$vnl_matrix@N@@@Z) referenced in function "public: void __cdecl itk::ImageMomentsCalculator<class itk::Image<float,3> >::Compute(void)" (?Compute@?$ImageMomentsCalculator@V?$Image@M$02@itk@@@itk@@QEAAXXZ) MitkSeaBreeze2 C:\00_gwenael\mitk\build\MITK-build\Modules\SeaBreeze2\bklyn_itk.obj 1 That's why I focused on vnl_algo and tried to narrow the problem to vnl by using vnl_gaussian_kernel_1d to reproduce the error (vnl_real_eigensystem is in vnl_algo too). I've tried to add ITKTransform to no avail: ---- MITK_CREATE_MODULE( INCLUDE_DIRS PRIVATE src PUBLIC ${SEABREEZE2_INCLUDES_DIR} DEPENDS PUBLIC MitkCore MitkAnnotation PACKAGE_DEPENDS PUBLIC VTK|vtkFiltersFlowPaths ITK|ITKRegistrationCommon+ITKImageStatistics+ITKVNL+ITKTransform OpenCV # VTK|vtkFiltersFlowPaths ITK OpenCV ) target_link_libraries(${MODULE_TARGET} PUBLIC ${SEABREEZE2_LIBRARIES}) ---- Sent from Outlook<http://aka.ms/weboutlook> ________________________________ From: Dinkelacker, Stefan <s.dinkelac...@dkfz-heidelberg.de<mailto:s.dinkelac...@dkfz-heidelberg.de>> Sent: 19 November 2019 13:50 To: Gwenael G <gwen.li...@hotmail.co.uk<mailto:gwen.li...@hotmail.co.uk>>; mitk-users@lists.sourceforge.net<mailto:mitk-users@lists.sourceforge.net> <mitk-users@lists.sourceforge.net<mailto:mitk-users@lists.sourceforge.net>> Subject: RE: using vnl_algo You need the target, not the library. MITK uses CMake’s find_package() command for its dependencies like ITK. When you look at MITK-superbuild/ep/lib/cmake/ITK-4.13/ITKTargets.cmake, which eventually is parsed through this mechanism, you find the target “itkvnl_algo”, so simply add itkvnl_algo to your module’s PACKAGE_DEPENDS. However, this dependency should also be transitively available with your ITK|ITKVNL dependency. If both approaches do not work, your requested function might not be publicly available from this library, I didn’t dive into the vnl code to check. From: Gwenael G [mailto:gwen.li...@hotmail.co.uk] Sent: Tuesday, November 19, 2019 1:51 PM To: Dinkelacker, Stefan <s.dinkelac...@dkfz-heidelberg.de<mailto:s.dinkelac...@dkfz-heidelberg.de>>; mitk-users@lists.sourceforge.net<mailto:mitk-users@lists.sourceforge.net> Subject: Re: using vnl_algo Hi Stefan, Thanks for your quick answer. I've tried your suggestion but I still have the problem. Following your tip, my CMakeLists looks like this: MITK_CREATE_MODULE( INCLUDE_DIRS PRIVATE src PUBLIC ${MYMODULE_INCLUDES_DIR} DEPENDS PUBLIC MitkCore MitkAnnotation PACKAGE_DEPENDS PUBLIC VTK|vtkFiltersFlowPaths ITK|ITKRegistrationCommon+ITKImageStatistics+ITKVNL OpenCV # VTK|vtkFiltersFlowPaths ITK OpenCV ) target_link_libraries(${MODULE_TARGET} PUBLIC ${MYMODULE_LIBRARIES} C:/00_gwenael/mitk/build/ep/lib/itkvnl_algo-4.13d.lib) I've copied the full path for now to make sure that it is pointing to the actual library. The two errors I get: Error LNK2019 unresolved external symbol "__declspec(dllimport) public: __cdecl vnl_gaussian_kernel_1d::vnl_gaussian_kernel_1d(double,double)" (__imp_??0vnl_gaussian_kernel_1d@@QEAA@NN@Z) referenced in function "void __cdecl blah(void)" (?blah@@YAXXZ) MitkMyModule C:\00_gwenael\mitk\build\MITK-build\Modules\SeaBreeze2\bklyn_itk.obj 1 Error LNK2019 unresolved external symbol "__declspec(dllimport) public: __cdecl vnl_gaussian_kernel_1d::~vnl_gaussian_kernel_1d(void)" (__imp_??1vnl_gaussian_kernel_1d@@QEAA@XZ) referenced in function "void __cdecl blah(void)" (?blah@@YAXXZ) MitkMyModule C:\00_gwenael\mitk\build\MITK-build\Modules\SeaBreeze2\bklyn_itk.obj 1 Best, Gwenael Sent from Outlook<http://aka.ms/weboutlook> ________________________________ From: Dinkelacker, Stefan <s.dinkelac...@dkfz-heidelberg.de<mailto:s.dinkelac...@dkfz-heidelberg.de>> Sent: 19 November 2019 10:19 To: Gwenael G <gwen.li...@hotmail.co.uk<mailto:gwen.li...@hotmail.co.uk>>; mitk-users@lists.sourceforge.net<mailto:mitk-users@lists.sourceforge.net> <mitk-users@lists.sourceforge.net<mailto:mitk-users@lists.sourceforge.net>> Subject: RE: using vnl_algo Hi, Searching for “vnl_gaussian_kernel_1d” in MITK-superbuild/ep/src/ITK reveals that it is located in the itkvnl_algo target. Adding it your target link libraries should do the trick. Best, Stefan From: Gwenael G [mailto:gwen.li...@hotmail.co.uk] Sent: Tuesday, November 19, 2019 10:16 AM To: mitk-users@lists.sourceforge.net<mailto:mitk-users@lists.sourceforge.net> Subject: [mitk-users] using vnl_algo Hi All, I've been trying to use some vnl_algo classes in an MITK module I am developing in Windows. Unfortunately, the module code doesn't link. This is the line of code that compiles but doesn't link: vnl_gaussian_kernel_1d k(0.0); The CMakeLists: MITK_CREATE_MODULE( INCLUDE_DIRS PRIVATE src PUBLIC ${MYMODULE_INCLUDES_DIR} DEPENDS PUBLIC MitkCore MitkAnnotation PACKAGE_DEPENDS PUBLIC VTK|vtkFiltersFlowPaths ITK|ITKRegistrationCommon+ITKImageStatistics+ITKVNL OpenCV ) target_link_libraries(${MODULE_TARGET} PUBLIC ${MYMODULE_LIBRARIES}) Furthermore, when looking at the project in Visual Studio (properties->Linker->Input->Additional Dependencies), the vnl_algo lib is there. I am using the ITK from the superbuild. Best, Gwenael Sent from Outlook<http://aka.ms/weboutlook>
_______________________________________________ mitk-users mailing list mitk-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mitk-users