StarDist within CellProfiler

Hi @AnneCarpenter @mweigert,

Would it be possible to ship StarDist with CellProfiler?

IdentifyPrimaryObjectsWithStartDist

I think it would be amaaaaaaazing!

:slight_smile:

6 Likes

I could imagine this being developed as a plugin module if there’s substantial demand for it. Since StarDist requires Tensorflow it probably wouldn’t make sense to bundle this with the core CellProfiler build, but perhaps this could work similarly to the existing NucleAIzer plugin?

1 Like

That sounds very interesting! If you happen to know, could you please point me to the installation instructions?

Hi @Christian_Tischer,

To my understanding the NucleAIzer plugin is for CellProfiler 3 and Tensorflow 1, it’s not been updated for CP4 yet. It’s available here. Within that file are more detailed installation instructions.

As this is a plugin requiring a custom environment you’d need to build CellProfiler from source.

Ok, I see the issue! I am working as support staff for users without coding experience, so I’ll probably have to wait a bit until this is easier to use. Thanks a lot for the information!

1 Like

That’s fair enough, we’re reluctant the package the whole of Tensorflow within CellProfiler so the need to build from source is likely to stay. That said, once the installation is completed it should feel like ‘normal’ CellProfiler for most end-users.

1 Like

Of course it would make a lot of sense to have StarDist in CellProfiler, which a large part of the target audience is using. I/we simply haven’t had time to investigate doing this.

I think deep learning tools like StarDist can run on the CPU just fine, unless you really need high throughput. Hence, having a more lightweight prediction engine would likely be fine. Of course, one would have to export the models in a suitable format for that.

Best,
Uwe

2 Likes

That’s understandable. The issue on our end is more about limiting the number of additional dependencies which CellProfiler ships with by default. At present we package Scikit-Learn and so adding another prediction engine would add another layer of complexity to an already tricky build process.

When running from source the user can install whichever additional dependencies they like, which is why we tend to prefer developing this sort of functionality as a plugin. Within CellProfiler itself it should be relatively simple to create a module that calls tensorflow and loads a provided model file.

1 Like

Sure, I completely understand. What I meant is that CellProfiler may choose in the future to bundle just one prediction engine for all plugins based on deep learning. For example, onnxruntime looks promising but I haven’t tried it.

1 Like