Image selection in imagepy

Hi @yxdragon,
I was looking at the documentation for imagepy plugin development.
I haven’t found how to have a GUI element in the plugin window to select a particular image (only getting current image is explained).

Also how should I do if my plugin requires 2 input images (ex for registration, template matching…).
How can I select 2 images ?

Hi, sorry for the document is not in detail. for these days I spent most time in deep learning, And I build sciwx (maybe like napari), and I will reconstruct imagepy on sciwx later. So I did not update ImagePy for a long time.

but please be free, ImagePy’s plugins would be compatible for the new imagepy.

for your question.
there are many advanced parameters, such as image, table, field, fieldes, colormap.


para = {'key-img':None, 'key-tab':None, 'key-cmap':'gray'}

view = [('img', 'key-img', 'pre-label', 'post-label'),
        ('tab', 'key-tab', 'pre-label', 'post-label'),
        ('field', 'key', 'pre-label', 'post-label'),
        ('fields', 'key', 'label'),
        ('cmap', 'key-cmap', 'label')]

# in the run method
from imagepy.core.manager import ImageManager, TableManager, ColorManager

ips = ImageManager.get(para['key-img'])
tps = TableManager.get(para['key-tab'])
lut = ColorManager.lut[para['key-cmap']]

ips is a ImagePlus object, ips.img to get current image, a ndarray, ips.imgs to get the stack, list of ndarray or multi-dim array.

tps is a TablePlus object, tps.data to get current table, a pandas.DataFrame object.

1 Like

Thanks a lot !
I can help with the documentation with a few PR :wink: