getpixels

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

getpixels

Don Anderson-3
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 );

               
        }