Hi, It should be supported. So you found a bug ;).
You find the logic what is supported “to python” hidden at https://phabricator.mitk.org/source/mitk/browse/master/Modules/QtPython/QmitkPythonVariableStackTableModel.cpp$41 ff You find the logic what is supported “from python” hidden at https://phabricator.mitk.org/source/mitk/browse/master/Modules/QtPython/QmitkPythonVariableStackTableView.cpp$49 ff The code for the real conversion is implemented at https://phabricator.mitk.org/source/mitk/browse/master/Modules/Python/autoload/PythonService/mitkPythonService.cpp But as I said a n overhaul of the whole stuff to really make usage of a sound binding and make the data transparent accessible also in python instead of the current work around would totally make sense. Best Ralf Von: Samuel Klistorner [mailto:samuel.klistor...@sydney.edu.au] Gesendet: Montag, 20. April 2020 01:05 An: Neher, Peter <p.ne...@dkfz-heidelberg.de>; Floca, Ralf Omar <r.fl...@dkfz-heidelberg.de>; mitk-users@lists.sourceforge.net Cc: Wasserthal, Jakob <j.wassert...@dkfz-heidelberg.de> Betreff: Re: Python and MITK Thanks Peter and Ralf. One more question, I notice that the 3d model can be loaded in to Python as vtkPolyData, but it seems that it cannot be loaded back to MITK by double clicking the variable or dragging it back in (while an Image can be). The other part of our project would be to move 3D bodies around (e.g. baseline and follow-up lesion registration in 3D). Do you know if this would be possible? Happy to wait until you are back in the office to check this. Cheers, Kind Regards, Samuel Klistorner | Software Engineer The University of Sydney, Save Sight Institute From: "Neher, Peter" <p.ne...@dkfz-heidelberg.de<mailto:p.ne...@dkfz-heidelberg.de>> Date: Friday, 17 April 2020 at 7:44 pm To: "Floca, Ralf Omar" <r.fl...@dkfz-heidelberg.de<mailto:r.fl...@dkfz-heidelberg.de>>, Samuel Klistorner <samuel.klistor...@sydney.edu.au<mailto:samuel.klistor...@sydney.edu.au>>, "mitk-users@lists.sourceforge.net<mailto:mitk-users@lists.sourceforge.net>" <mitk-users@lists.sourceforge.net<mailto:mitk-users@lists.sourceforge.net>> Cc: "Wasserthal, Jakob" <j.wassert...@dkfz-heidelberg.de<mailto:j.wassert...@dkfz-heidelberg.de>> Subject: AW: Python and MITK I will be happy to take a look as soon as the corona lockdown has ended. I added a corresponding task to phabricator. https://phabricator.mitk.org/T27324<https://protect-au.mimecast.com/s/qNs-CmO5glu695BWiGJq9v?domain=phabricator.mitk.org> Best, Peter Von: Floca, Ralf Omar <r.fl...@dkfz-heidelberg.de<mailto:r.fl...@dkfz-heidelberg.de>> Gesendet: Donnerstag, 16. April 2020 22:20 An: Neher, Peter <p.ne...@dkfz-heidelberg.de<mailto:p.ne...@dkfz-heidelberg.de>>; Samuel Klistorner <samuel.klistor...@sydney.edu.au<mailto:samuel.klistor...@sydney.edu.au>>; mitk-users@lists.sourceforge.net<mailto:mitk-users@lists.sourceforge.net> Cc: Wasserthal, Jakob <j.wassert...@dkfz-heidelberg.de<mailto:j.wassert...@dkfz-heidelberg.de>> Betreff: AW: Python and MITK Hi, short answer: sadly no. Not in the workbench ☹ Reason: The mechanism currently used to transfer the image data is very primitive to say it politly. This is already very long on my would be great if we finally would refactor that code part and really make the images transparent accessible. We also already have bindings for mitk::Images that are used by mitk Phenotyping when you want to use it directly out of python. But it is not leveraged in the workbench yet. @Peter/Samuel maybe you want to have a look. Best Ralf Von: Neher, Peter Gesendet: Donnerstag, 16. April 2020 08:23 An: Samuel Klistorner <samuel.klistor...@sydney.edu.au<mailto:samuel.klistor...@sydney.edu.au>>; Floca, Ralf Omar <r.fl...@dkfz-heidelberg.de<mailto:r.fl...@dkfz-heidelberg.de>>; mitk-users@lists.sourceforge.net<mailto:mitk-users@lists.sourceforge.net> Cc: Wasserthal, Jakob <j.wassert...@dkfz-heidelberg.de<mailto:j.wassert...@dkfz-heidelberg.de>> Betreff: AW: Python and MITK Hi Samuel, you mean that the changes you are making in python are directly reflected in the MITK image? Unfortunately I don't know if that is supposed to work. I will try and look into this, but I never really used the python console. @Ralf, are you a python console user in MITK and maybe know about this or maybe you know someone who might know? If nobody knows, I will have a look as soon as I can work from the office again. In general it is recommended to ask such questions via the users list so we can leverage the knowledge of the complete MITK developers group. Best, Peter ________________________________ Von: Wasserthal, Jakob Gesendet: Mittwoch, 15. April 2020 15:14 An: Neher, Peter Cc: Samuel Klistorner Betreff: AW: Python and MITK Hi Peter, Samuel from Sydney who visited our lab last year is using MITK+Python but is having some more questions. Since I am not familiar with this I refer him to you. So maybe you can help him. Best Jakob ________________________________ Von: Samuel Klistorner <samuel.klistor...@sydney.edu.au<mailto:samuel.klistor...@sydney.edu.au>> Gesendet: Mittwoch, 15. April 2020 14:52 An: Wasserthal, Jakob Betreff: Re: Python and MITK Hi Jakob, Great to hear from you. Glad to hear that you are doing well and Germany is coping well. I did manage to build MITK Diffusion with Python. I worked out that I can drag images from the Data Manager to the Variable Stack and vice versa. My next question is, is there a way to update/refresh the Display (primarily the 3D window) using the Python console? e.g. I have a SITK image in my python console to which I do some data manipulation on, and then automatically display that in the 3D window – such as erode or dilate a binary mask. Id be happy to speak to Peter directly if its easier. How are you going with your work? Any new papers coming out? Cheers Kind Regards, Samuel Klistorner | Software Engineer The University of Sydney, Save Sight Institute
_______________________________________________ mitk-users mailing list mitk-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mitk-users