Dear Hiro, in its current state probably more errors like this will ocurr. Hence, we do not recommend to go that route without a keen knowledge to tackle those issues. We will put a lot more effort into Python support in near future but it is scheduled for MITK v2023.10 in October.
The branch I mentioned is feature/T27923-ExecPythonCodeInMITK. We didn't merge it yet since it has issues on a few of our Linux continous integration clients but we were not able to identify them correctly. For now we may do not have the capacity to provide a good support for branches other than develop and master. Best, Stefan ________________________________________ Von: Hirohisa Oda <h...@u-shizuoka-ken.ac.jp> Gesendet: Mittwoch, 1. März 2023 02:38 An: Dinkelacker, Stefan Cc: mitk-users@lists.sourceforge.net Betreff: Re: AW: [mitk-users] Linking error on PythonService Dear Stefan I really appreciate your important reply! If I start writing plugins in Python, do you recommend using the traditional framework or starting from the branch? I want to start from the branch if the plugins need to be updated for your new framework in the future. (I have been trying to build the branch for a week now, but have not yet succeeded. Currently I am getting the SWIG's "syntax error in input(3)" error for "itkSmartPointer.h". ) Kind regards, Hiro On 2023/02/23 13:55, Dinkelacker, Stefan wrote: > Hi Hiro, > > I do not know the page you linked but it seems to be outdated and was updated > the last time more than 7 years ago. A lot has changed since then, for > example, we do not support the PluginGenerator anymore, the Python service is > in an experimental state with big changes nearly done in another branch, the > Python console plugin was removed, and so on... > > We nowadays recommend to start with the MITK-ProjectTemplate: > https://github.com/MITK/MITK-ProjectTemplate > > To still use our Python code in its current state, activate MITK_USE_Python3 > when configuring the MITK *superbuild*. There are additional prerequisites > that you have to install before: > > - Install Python (v3.9 or max v3.10) and make sure NOT to install the debug > binaries if using the Windows installer > - Install numpy and SimpleITK via pip > > Best, > Stefan > > > ________________________________________ > Von: Hirohisa Oda <h...@u-shizuoka-ken.ac.jp> > Gesendet: Dienstag, 21. Februar 2023 07:21 > An: mitk-users@lists.sourceforge.net > Betreff: [mitk-users] Linking error on PythonService > > Hello, > > I'm new to MITK plugin development. > > I would like to run the following code > (part of the code are found at > https://neurita.github.io/how_to_create_a_python_plugin_for_mitk ) > #include <autoload/PythonService/mitkPythonService.h> > ... > itk::SmartPointer<mitk::PythonService> _PythonService(new > mitk::PythonService()); > std::string result = _PythonService->Execute( "print ('Hello World!')", > mitk::IPythonService::SINGLE_LINE_COMMAND ); > > However, this linking error occurs. > It seems the constructor of "PythonService" is not found. > PythonTest.obj : error LNK2019: > unresolved external symbol "public: __cdecl > mitk::PythonService::PythonService(void)" (??0PythonService@mitk@@QEAA@XZ) > referenced in function "protected: void __cdecl > PythonTest::DoImageProcessing(void)" (?DoImageProcessing@PythonTest@@IEAAXXZ) > > When I remove this code, the build process always works correctly. > I'm building this plugin on MITK v2022.10 using Visual Studio 2019 Community > and Windows 11 22H2. > > "MitkPython", "MitkQtPython" and "Python3|Python" are listed in the > CMakeLists.txt of a plugin named PythonTest. > mitk_create_plugin( > EXPORT_DIRECTIVE PYTHONTEST_EXPORT > EXPORTED_INCLUDE_SUFFIXES src > MODULE_DEPENDS MitkQtWidgetsExt MitkPython MitkQtPython > PACKAGE_DEPENDS Python3|Python > ) > > I would be grateful if you could give me some advice on this problem. > Thank you. > > Best regards, > Hiro > > > _______________________________________________ > mitk-users mailing list > mitk-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/mitk-users > > _______________________________________________ mitk-users mailing list mitk-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mitk-users