Packaging Acute Stroke Detection Module for Slicer

Repository: GitHub - Chin-Fu-Liu/Acute-stroke_Detection_Segmentation

Problem: I want to package the Acute Stroke Detection and Segmentation (ADS) module for 3D Slicer with pre-trained models.

Specific Challenges:

  • Including pre-trained deep learning models in the Slicer extension
  • Managing specific Python library dependencies (TensorFlow, h5py, etc.)
  • Ensuring the module works across different systems

Key Questions:

  1. What’s the recommended way to include machine learning models in a Slicer extension?
  2. How can I handle complex Python dependencies within Slicer?
  3. What’s the best practice for cross-platform module packaging?

Seeking guidance from experienced Slicer developers on creating a distributable, self-contained extension for this ADS tool.

Thanks for your interest in making this tool available in Slicer. It looks like a valuable tool. Here are some high-level answers and some comments.

There are many examples to look at (TotalSegmentator, Auto3DSeg, MHub, etc) so you can see that there is not yet one clear suggested architecture. But porting your model to run inside one of those already supported frameworks could be the easiest option. For example, retraining with MONAI Auto3DSeg would let you simply publish the model and weights. I see you use tensorflow, which you might be able to make work, but most of the community use PyTorch, so adapting to that path would make development and maintenance easier.

Also I see that your model is GPL licensed. We discourage this for many reasons (you can search the forum archives for threads on this topic). If you absolutely must retain the GPL license, it may prevent you from using some of the distribution methods I mentioned above.

If you end up using GPL for any code you distribute please put a clear disclaimer of this at the top of the readme so that others don’t accidentally incorporate any of your code as this would cause problems for everyone.