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. |
Hi, with these modifications you should have saved the class under
ij/plugin/filter in the directory tree of ImageJ Isn't it more simple instead of modyfing the source just to inherit the BackgroundSubtracter ? best regards Dr Dimiter Prodanov, PhD >------------------------------ > >Date: Sat, 29 Apr 2006 17:44:30 -0700 >From: Ben Liu <[hidden email]> >Subject: modification to the BackgroundSubtracter class > >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. > >------------------------------ > >End of IMAGEJ Digest - 28 Apr 2006 to 29 Apr 2006 (#2006-118) >************************************************************* |
In reply to this post by Ben Liu-3
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. |
In reply to this post by Ben Liu-3
Hi Dimiter Prodanov,
You mean I shoudl put it into the filter directory of IJ.jar file? Actually, I wanna inherit the BackgroundSubtracter class, but I don't know how to. I mean, the whiteBackground in BackgroundSubtracter is a private one, how can I access it in its subclass ? Or do you have any way? Thanks. Best wishes, Bian Liu ======= 2006-04-30 06:34:39:======= >Hi, with these modifications you should have saved the class under >ij/plugin/filter in the directory tree of ImageJ >Isn't it more simple instead of modyfing the source just to inherit the >BackgroundSubtracter ? > >best regards > >Dr Dimiter Prodanov, PhD > > >>------------------------------ >> >>Date: Sat, 29 Apr 2006 17:44:30 -0700 >>From: Ben Liu <[hidden email]> >>Subject: modification to the BackgroundSubtracter class >> >>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. >> >>------------------------------ >> >>End of IMAGEJ Digest - 28 Apr 2006 to 29 Apr 2006 (#2006-118) >>************************************************************* >. = = = = = = = = = = = = = = = = = = = = |
Free forum by Nabble | Edit this page |