brian brian - 21 days ago 9
Java Question

Is it possible to access each pixel value using ImageJ

I'm starting a project for college that uses ImageJ and Micro Manager. I want to be able to access each pixel of the image taken from a snapshot of the camera feed. My goal is to be able to apply a custom built function to each pixel on the snapshot of the image. Is it possible to do this using ImageJ.

Answer

Yes you can, but at which level do you want to work: ImageJ macros or dive into the java code?

If you stay at the macros level, I don't think that you can access the pixel values.

However, if you want to do a little bit of programming, ImageJ uses the ImageProcessor class, which is extended according to the encoding type: ByteProcessor, ShortProcessor, BinaryProcessor, ColorProcessor. Then, you can access the pixel values using the methods getPixels(), getPixel(x,y), getPixelValue(x,y). But be careful to the encoding type, these methods are encoding specific.