getpixels

Posted by Don Anderson-3 on
URL: http://imagej.273.s1.nabble.com/getpixels-tp3700316.html

I am trying to get the pixel values of an image, I put in the line
byte[] pixels = (byte[])ip.getPixels();
in the following code but it does not work.
can anyone help?



void macro1(ImagePlus imp, ImageProcessor ip) {
               
int volumeCount = ip.getWidth();


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


IJ.write("the width of this image is: " + volumeCount );

               
        }