Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slicer one-click python dependencies #10

Open
bingogome opened this issue Apr 10, 2023 · 2 comments
Open

Slicer one-click python dependencies #10

bingogome opened this issue Apr 10, 2023 · 2 comments

Comments

@bingogome
Copy link
Owner

Dr. Andras Lasso offered to advise how to install dependencies with one-click. I am reaching out.

@lassoan
Copy link

lassoan commented Apr 11, 2023

One important simplification would be to not require an additional Python environment, but use Slicer's Python environment for installing Pytorch and any other required dependencies. Usually we just pip_install what is needed, but Pytorch is a bit special (large package, must be installed from URL, etc.), so its installation is delegated to the Pytorch Slicer extension. See how it is done in TotalSegmentator extension - https://github.com/lassoan/SlicerTotalSegmentator/blob/main/TotalSegmentator/TotalSegmentator.py

Another simplification is to launch the processing server directly from Slicer and instead of zmq and memory-mapped files, send the pickled numpy array via process stdin/stdout. This technique is used in the Processes module in ParallelProcessing extension (https://github.com/pieper/SlicerParallelProcessing/blob/master/Processes/Processes.py) and it is very fast and robust and works on all operating systems. The module could be used as is (as shown in this example). If we find that there is a significant delay due to launching the process, importing pytorch, etc. then we could modify the implementation so that the server keeps running (does not terminate after processing a single image).

@bingogome
Copy link
Owner Author

bingogome commented Apr 11, 2023

Creating a new branch https://github.com/bingogome/samm/tree/dev-py-dep-slicer

I have some comments but will need to get back here later when I get more time.

Decided not to comment on it. I will try to implement both suggestions first and then come to see whether delay becomes an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants