Extending Analyzer class

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

Extending Analyzer class

Joachim Wesner
Hi list,

I was just wondering, is there an easy way to supplement the list if
measurements in the Analyzer class with own definitions and without
touching the main source code?

IMHO this would be a very useful feature!

I think "extending" from that class (in the OO sense) would not help here
much (!?), as it seems I would need to duplicate quite a bit of code of the
original Analyzer and if this is done,
can I overload the internal Plugin with mine so nothing else changes?

Thanx


Mit freundlichen Grüßen / Best regards

Joachim Wesner


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
Reply | Threaded
Open this post in threaded view
|

Re: Extending Analyzer class

Wayne Rasband
On Aug 16, 2009, at 5:24 AM, Joachim Wesner wrote:

> Hi list,
>
> I was just wondering, is there an easy way to supplement the list if
> measurements in the Analyzer class with own definitions and without
> touching the main source code?
>
> IMHO this would be a very useful feature!
>
> I think "extending" from that class (in the OO sense) would not help  
> here
> much (!?), as it seems I would need to duplicate quite a bit of code  
> of the
> original Analyzer and if this is done,
> can I overload the internal Plugin with mine so nothing else changes?

The Analyzer class was not designed to be extendable but you can  
easily add custom measurements to the Results Table by using the  
ResultsTable.addValue(label, value) method or the setResult(label,  
row, value) macro function. There are examples at:

     http://rsbweb.nih.gov/ij/plugins/sine-cosine.html

-wayne