Login  Register

Re: Can anybody help me debug my plugin?

Posted by dscho on Jan 23, 2006; 5:44pm
URL: http://imagej.273.s1.nabble.com/Can-anybody-help-me-debug-my-plugin-tp3703969p3703970.html

Hi,

> public class Z_Direction_Median_Filter implements PlugInFilter{
>    
>       int m = stack.getWidth();

There is no member stack. You have to define it first (probably in the
setup() or run() method. After that, you can initialize m, but not before.

> public void run() {

The method run() gets passed one parameter of type ImageProcessor.

>   for (j=1; j<=dimension; j++)
>    for (i=1; i<=nSlices; i++) {
>        setSlice(i);

This is inefficient. You might want to initialize a member of type
double[][] to the value returned by (double[])stack.getPixels().

>   run("Duplicate...", "title=zMedian");
>   run("Select All");    
>   setColor(xyPixels);
>   run("Fill");
> }

What is this? Seems you got something mixed up here.

Hth,
Dscho