Image-Py / imagepy

Image process framework based on plugin like imagej, it is esay to glue with scipy.ndimage, scikit-image, opencv, simpleitk, mayavi...and any libraries based on numpy
http://imagepy.org
BSD 4-Clause "Original" or "Old" License
1.3k stars 333 forks source link

Can’t install python plugin #19

Closed aseedb closed 6 years ago

aseedb commented 6 years ago

I have tried to install a python plugin by copying the code in the Gaussian filter example and saving in to a .py file in the menu directory or a sub directory but it won’t show in imagepy after I restart it. I have also Tried editing the init.py files in the directories but this didn’t help.

aseedb commented 6 years ago

I found the problem. I had to add plgs = [Class_name] at the end of my plugin file

yxdragon commented 6 years ago

@aseedb sorry to not response in time. Yes, you can subclass Filter/Simple/Free and overwrite the run function. if you write only one plugin in a file, you can Name the class as Plugin. Else you can write many plugin in one file, and add a plgs = [Plugin1, Plugin2, '-', Plugin3...] the '-' would be parsed as a spliter.

and you need not copy the file under menus folder, you can build a github project like this, demo plugin then use Plugins > Install > Install Plugins, input the git path, then imagepy would install it automotive.

Sorry, the document is out-date, and ImagePy is going through a bit upgrade! It will coming soon!