Re: modification to the BackgroundSubtracter class
Posted by
Wayne Rasband on
URL: http://imagej.273.s1.nabble.com/modification-to-the-BackgroundSubtracter-class-tp3702953p3702955.html
When removing "package ij.plugin.filter;" to convert a built in
plugin to a user plugin you have to replace it with "import
ij.plugin.filter.PlugInFilter;" or the compiler will not be able to
find the PlugInFilter interface.
-wayne
On Apr 29, 2006, at 8:44 PM, Ben Liu wrote:
> Hi there,
> I modified the BackgroundSubtracter class by adding one method:
> public void setWhiteBackground(boolean b) { whiteBackground
> = b; }
> and delete: package ij.plugin.filter; changed its name to
> BackgroundSubtracterM.java; Then I saved to plugin folder.
>
> I used in a plugin as:
> BackgroundSubtracterM bgs = new BackgroundSubtracterM();
> bgs.setWhiteBackground(false);
> bgs.subtractBackround(ip, 50);
>
>
> D:\Program Files\ImageJ\plugins\ALM\BackgroundSubtracterM.java:23:
> Interface PlugInFilter of class BackgroundSubtracterM not found.
> public class BackgroundSubtracterM implements PlugInFilter {
>
> But it does not happen if I use the original class:
> BackgroundSubtracter bgs = new BackgroundSubtracter();
> ///bgs.setWhiteBackground(false);
> bgs.subtractBackround(ip, 50);
>
> What is wrong with my modification?
> Thanks.
> Bian
>
>
>
> ---------------------------------
> Love cheap thrills? Enjoy PC-to-Phone calls to 30+ countries for
> just 2ยข/min with Yahoo! Messenger with Voice.