Posted by
ctrueden on
Aug 14, 2006; 5:32pm
URL: http://imagej.273.s1.nabble.com/inheritance-tp3701842p3701844.html
Hi Tony,
If want to perform some operation on an ImageProcessor, you can add a method
to your plugin that takes an ImageProcessor object as an argument. Then when
you need that method during your plugin's operations, you can call it. You
said, "I tried sticking a fresh method class at the bottom of the plugin
itself (outside the main method) but it's not picked up," but I am not sure
what that means. If you put a method within your plugin's source code, it
should work fine. And you shouldn't need to define any new classes 99% of
the time.
I would suggest you model your plugins off of existing work available from
the ImageJ website, rather than starting from scratch. There is also a
tutorial on writing plugins online at:
http://mtd.fh-hagenberg.at/depot/imaging/imagej/Good luck.
-Curtis
On 8/8/06, Tony Shepherd <
[hidden email]> wrote:
>
> Thanks for the advice but I'm missing something crucial here! you wrote:
>
> ".. I question why you need to subclass ImageProcessor at all. The
> subclasses of ImageProcessor are mainly for different bit depths. Do you
> need a new, crazy kind of bit depth?.."
>
> I thought that if I wanted to write a method to do ANYTHING to an
> ImageProgessor object (like filter it, classify it or anything, not just
> fiddle with bit depths) then these methods had to be added on to the end
> of
> the class that constructs the object. (i.e. by editing ImageProcessor.java
> OR creating class MyImageType, which extends ImageProcessor)
>
> It sounds like I was mistaken, but where else can I stick some fresh code,
> so that I can execute the method by adding the line:
>
> myobject.dosomething();
>
> to a plugin?
>
> I tried sticking a fresh method class at the bottom of the plugin itself
> (outside the main method) but it's not picked up.
>
>
> Thanks vey much
>
> Tony
>