Hi Peter,
my first guess would be that your process of copying the DLLs next to the executable is the source of the issue. MitkDICOMImageIO is an auto-load module (using the CppMicroServices) and these auto-load modules are expected NOT to be next to the executable but instead in a subfolder named after the module they are supposed to be loaded with. In most cases like in MitkDICOMImageIO MitkCore is specified as AUTOLOAD_WITH target (see Modules/DICOM/autoload/DICOMImageIO/CMakeLists.txt). To better understand the directory structure, I suggest to download and extract the official MITK .zip file [1] and look into the bin folder. There you find for example an MitkCore folder which contains the MitkDICOMImageIO module and other auto-load IO modules. When working with Visual Studio in the build tree, the locations differ compared to the installer like there are intermediate Debug/Release folders but all of this is usually nothing to worry about as long as you use the MITK CMake macros and functions for creating modules and plugins. Please consider to start with the MITK Project Template for hopefully less frictions [2]. Regarding your warning about an invalid preprocessing token I can just assume that you maybe accidentally modified/pasted something? I searched for ")static" in the whole MITK repository but could not find anything and I also never saw such a warning. :-) Best, Stefan [1] https://www.mitk.org/download/releases/MITK-2022.04/Windows/MITK-v2022.04-windows-x86_64.zip [2] https://github.com/MITK/MITK-ProjectTemplate ________________________________ Von: VR Bay <bayvr...@gmail.com> Gesendet: Freitag, 24. Juni 2022 18:18 An: mitk-users@lists.sourceforge.net Betreff: [mitk-users] Dicom-loading fails in tutorial project Hello Everyone, I'm a first time user of MITK. I've succesfully built the v2022.04 version and I'm able to create my own cmake project with it which compiles and runs. After building manually the step1 tutorial example, when I try to load the sample .nrrd image a window appears and shows the image but when I try to load the sample dicom (.dcm) image the mitk::IOUtil::Load() throws an mitk::Exception which says: "core.mod.core.ioUtil ERROR: No reader available for %filename%.dcm." so no image is showed. When I run the Step1 application which was built during the mitk build process (in ../superbuild/Mitk-build/bin/Debug/MitkStep1.exe) it runs perfectly: it shows the dicom image. So the app sources are the same but they were built differently so I think the problem is with my cmake configuration. I also debugged the app and I concluded that the problem is that no dicom reader is registered in the usServiceRegistry. The problem is that I don't know how to register the correct service in my app. I tried to link the app with multiple DICOM modules (like MitkDICOMImageIO) without success. I tried changing module load order still without success. This CppMicroServices concept is not clear for me yet (just like Cmake). Additional notes: - I link the libraries dinamically with target_link_libraries in my cmakelists.txt (and copy the proper dll-s next to the executable) - when including "mitkIOUtil.h" there's a warning: "In included file: pasting formed ')static', an invalid preprocessing token" So this my problem that I cannot solve for days now and I have run out of ideas. I would appreciate if anyone could help me solve this problem. Best regards, Peter
_______________________________________________ mitk-users mailing list mitk-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mitk-users