Hello , 3D slicer users
With your help, my project has been successfully completed.
The second project is communication.
I’m going to create a Python module that communicates between admin-client.
admin: Distribute tasks to clients
client : Sends the task to the admin when the task is complete
The question is, I want to configure this module as a slicer extension module so that it works on the python console within the 3D slicer. Is this possible?
Does 3d slicer have support for communication module?
Yes, there are many ways to do this. It will help people understand your goals better if you clarify what type of communication you have in mind (raw tcp, http, other?). And what exactly is the admin program and what is the client (are they both Slicer instances? are they other programs?).
It might help if you look at the WebServer module, which can allow other programs, perhaps your admin program, to control the operation of a Slicer instance, perhaps your client.
Then yes, using something like the requests module from the admin Slicer instance can allow you to connect to an arbitrary number of client Slicer instances (assign unique tcp ports to each) via the WebServer and the exec API to run python code in the client. Let us know how it works for you.
Yes, when you instantiate the server you can supply a certificate. If you are in a controlled network or the same machine this is really optional. If you are using multiple machines on an open network I suggest creating ssh tunnels instead for security rather than relying on network traffic even if it is encrypted. Web server security is a big topic, so be thoughtful about what you expose.
Hard to say, but if your goal is to transfer this task to a human being who will use slicer to do something like segmentation and then give you back the result it may be easier to use .mrb files with a shared network directory or a system like dropbox. You can make some small scripts if you want to automate this and check that the results are in the right format.
OpenIGTLink is for continuous real-time data like video or 3D tracker data.
The WebServer would allow real-time control of one Slicer instance from another, but maybe not as logical to use when there are human beings involved on the client computer.