Python package in fiji

HI Guys,

I was wondering if you someone could tell me that if I have a python library that uses all the scipy and other such standard python libraries, what would be the fastest way to convert that into sort of a Fiji plugin without have to rewrite the code in Java?

Can you explain a bit more what you mean? Fiji can run python scripts, so other than things like image opening/grabbing or other calls to parts of Fiji, you shouldn’t need to rewrite much of anything.

Hey @kapoorlab ,

Fiji doesn’t run python. The name in the menu is misleading. Fiji runs Jython.

So yes, you need to rewrite everything that uses scipy, numpy, skimage and friends.

:-/

Best,
Robert

1 Like

Addendum: #clEsperanto code runs in Python and in Jython :sunglasses:

2 Likes

Hi @bcimini, it is more of a package that I want to put inside Fiji, like stardist was first made in python and then they actually converted their python code to java to put in Fiji. So I wanted to avoid doing this but as @haesleinhuepf pointed out that it seems I would have to rewrite the whole package for Fiji, other options being making a gui in python itself or maybe ImJoy plugin? How do you guys ship your python packages? Lets say you make a yolov1 detector and now you want to give it users, would you just make jupyter notebooks and give it to them or would you also give it a plugin shape?

You could make a GUI on it, or a jupyter notebook, or you could make it into a CellProfiler plugin. Or you could contribute it to something like scikit!

2 Likes

Wow thats cool, how did you invoke python from Fiji? Is it possible to start conda enviornment from inside Fiji, well in that way a user can click on a Fiji panel but it will open a jupyter notebook with a conda enviornment. The problem in translating Python->Fiji is that some functions may be missing or implemented in a way that the python function and java function results do not match.

I should really get inside clij at some point, seems really ool that you can call python from Fiji like that, I use jython scripts yes but have not invoked jupyter notebooks or napari from inside fiji.

Thanks for the cellprofiler plugin link, how do you mean contribute it to scikit? I am doing this more to make the python tool more user friendly and since they are accustomed to Fiji they want to put it inside that container. But that seems way more complicated than making a GUI in python itself or with cell profiler plugin that you mentioned.

I meant if it is something that’s more of a mathematical measurement or operation, you could contribute it to a bigger library like scikit-image.

If it’s something that makes more sense in a GUI though, I’m clearly biased but Cell Profiler is a good way to make something that is user friendly but still stay in python!

1 Like

Thanks Beth, I would say it is kinda like stardist package so it is useful for the end users so something like GUI, Cell Profiler could be an idea also for putting this package on a workstation which people book to use these tools and for that I can definitely see it being next to Imaris to use the python packages we build around here.