Dear Mohammed,
On Fri, 4 Nov 2011, Mohammed Tlais wrote:
> I have a java file called Sigma_Filter_Plus.java which has a run
> function that takes an imageProcessor as an argument:
>
> [code]
> public class Sigma_Filter_Plus implements ExtendedPlugInFilter,
> DialogListener {
> ....
> public void run(ImageProcessor ip) {
> ... }
> [/code]
>
> trying to call the run function will return a NullPointerException error
> as if I am not able to pass the ImageProcessor from my main.java
> application into Sigma_Filter_Plus.java. AnyOne familiar with this?
Most PlugInFilter implementations are not meant to be called directly. The
reason is that they want to be called in the following sequence:
setup(arg, imagePlus); <check return value> run(imageProcessor);
Since the interface PlugInFilter cannot be changed for
backwards-compatibility reasons, the run() method never takes a full
ImagePlus, however, many plugins require an ImagePlus. That is most
likely the reason for your NullPointerException.
However, I was forced to guess here. In the future, please include the
full source code (in this case both of the caller and callee) and the
_full_ error message (i.e. in the NullPointerException the full stack
trace including most importantly file and line numbers).
Ciao,
Johannes