ImageJ - Trigger event when frame in ImageStack is changed

岁酱吖の 提交于 2019-12-08 11:13:13

问题


I'm trying to make an ImageJ plugin that generates a stack of masks based on a selection in each frame in an active stack.

To do that, I need to clear the mask and save it when the frame in the stack changed. I don't see any event options available on the API for ImageStack; how would I trigger a sequence of steps when the stack frame is changed? Is there an event to do this?


回答1:


The event options are implemented in the ImagePlus class, not in the ImageStack.

Your plugin should implement the ImageListener interface. In its imageUpdated() method, you should be able to get the current slice number and react accordingly.

Use the static method ImagePlus.addImageListener(this) to add your plugin as an ImageListener.



来源:https://stackoverflow.com/questions/21791105/imagej-trigger-event-when-frame-in-imagestack-is-changed

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!