Login  Register

Re: FloatProcessor

Posted by Dimiter Prodanov on Oct 05, 2006; 2:26pm
URL: http://imagej.273.s1.nabble.com/FloatProcessor-tp3701377p3701378.html

Hi wayne, hi Johannes

Plase take a look at this code:

public void erode(FloatProcessor ip) {

         int width = ip.getWidth();
         int height = ip.getHeight();
         float min =imin; //,k=0,x=0,y=0;

         //int sz=pg.length;//se.getWidth()*se.getHeight();

         float[] pixels=(float[])ip.getPixels();

         float[] wnd=new float[2];

         float[] newpix= new float[pixels.length];

         int i,j=0;
         for (int c=0;c<pixels.length;c++) {
              i=c/width;
              j=c%width;
                 IJ.log("pixel "+ip.getPixelValue(i, j));

             wnd=getMinMax(c, width, height, pixels, pg, ERODE);
             min=wnd[0]+imax; //v2 = max - (v1 - min);
             newpix[c]=min;

         }


         System.arraycopy(newpix, 0, pixels, 0, pixels.length);

         }


>I dont see a mistake but may be you'll find it.


best


_______________________________________________________________________
Dr Dimiter Prodanov, MD, Ph.D.

Neural Engineering Rehabilitation Laboratory
(Laboratoire de Génie de la Réhabilitation Neurale)
Département de Physiologie et Pharmacologie
Université catholique de Louvain
Avenue Hippocrate, 54
POBox UCL-5446 / B-1200 Bruxelles -Belgique-
Phone: 00-322-764 5596
Fax: 00-322-764 9422

http://www.md.ucl.ac.be/gren