Very basic question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Very basic question

cihat eldeniz
Hello,

What is the actual difference between PlugIn and PlugInFilter? It seems to
me that I can implement every kind of operations using PlugIn. If you were
to process images, would you prefer one over the other?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Very basic question

Joris FA Meys
That depends. A plugin and a pluginfilter do have some specific methods
(although technically spoken, I believe pluginfilter is actually a subclass
of plugin).

They differ especially in the input they take. The main method of a
pluginfilter takes the current imageprocessor as an argument, whereas a
plugin takes only strings. Generally, you can use both to do the same,
albeit implemented in a slightly different way. The choice depends mainly on
how you want to process (i.e. whether or not you want only to do an
operation on the current image or stack).

A short but good tutorial by Werner Bailer can be found at :
http://www.imagingbook.com/fileadmin/goodies/ijtutorial/tutorial171.pdf

Kind regards

On Wed, Feb 11, 2009 at 7:00 PM, cihat eldeniz <[hidden email]>wrote:

> Hello,
>
> What is the actual difference between PlugIn and PlugInFilter? It seems to
> me that I can implement every kind of operations using PlugIn. If you were
> to process images, would you prefer one over the other?
>
> Thanks.
>
Reply | Threaded
Open this post in threaded view
|

Re: Very basic question

Michael Schmid
Hi Cihat,

my 3 cents:

If you want to combine built-in filters. using 'IJ.run(...)', use a  
Plugin. In this case, a PlugInFilter will have the problem that it  
locks the image, and the internal filters also want to lock it.

If you want to do some processing that works on the pixels, write a  
PlugInFilter. If you have parameters that you set in a dialog, an  
ExtendedPlugInFilter is even better:
- With a few additional lines you can have preview.
- Error messages on having the wrong image type appear before the  
dialog asking for the parameters, not after it.

Michael
________________________________________________________________

On 11 Feb 2009, at 19:26, joris meys wrote:

> That depends. A plugin and a pluginfilter do have some specific  
> methods
> (although technically spoken, I believe pluginfilter is actually a  
> subclass
> of plugin).
>
> They differ especially in the input they take. The main method of a
> pluginfilter takes the current imageprocessor as an argument,  
> whereas a
> plugin takes only strings. Generally, you can use both to do the same,
> albeit implemented in a slightly different way. The choice depends  
> mainly on
> how you want to process (i.e. whether or not you want only to do an
> operation on the current image or stack).
>
> A short but good tutorial by Werner Bailer can be found at :
> http://www.imagingbook.com/fileadmin/goodies/ijtutorial/ 
> tutorial171.pdf
>
> Kind regards
>
> On Wed, Feb 11, 2009 at 7:00 PM, cihat eldeniz  
> <[hidden email]>wrote:
>
>> Hello,
>>
>> What is the actual difference between PlugIn and PlugInFilter? It  
>> seems to
>> me that I can implement every kind of operations using PlugIn. If  
>> you were
>> to process images, would you prefer one over the other?
>>
>> Thanks.
>>