Package qupath.imagej.tools
Class PixelImageIJ
java.lang.Object
qupath.imagej.tools.PixelImageIJ
- All Implemented Interfaces:
SimpleImage,SimpleModifiableImage
Very simple wrapper that allows some non-ImageJ-oriented QuPath commands to access ImageProcessor pixel values.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat[]getArray(boolean direct) Request the pixel array representing all the pixels in this image, returned row-wise.intGet the image height.floatgetValue(int x, int y) Get the value of a single pixel as a float.intgetWidth()Get the image width.voidsetValue(int x, int y, float val) Set the value of a single pixel.
-
Constructor Details
-
PixelImageIJ
Constructor.- Parameters:
ip- ImageProcessor to wrap
-
-
Method Details
-
getValue
public float getValue(int x, int y) Description copied from interface:SimpleImageGet the value of a single pixel as a float.- Specified by:
getValuein interfaceSimpleImage- Parameters:
x- x-coordinate of the pixely- y-coordinate of the pixel- Returns:
-
setValue
public void setValue(int x, int y, float val) Description copied from interface:SimpleModifiableImageSet the value of a single pixel.- Specified by:
setValuein interfaceSimpleModifiableImage- Parameters:
x- x-coordinate of the pixel to sety- y-coordinate of the pixel to setval- new pixel value
-
getWidth
public int getWidth()Description copied from interface:SimpleImageGet the image width.- Specified by:
getWidthin interfaceSimpleImage- Returns:
-
getHeight
public int getHeight()Description copied from interface:SimpleImageGet the image height.- Specified by:
getHeightin interfaceSimpleImage- Returns:
-
getArray
public float[] getArray(boolean direct) Description copied from interface:SimpleModifiableImageRequest the pixel array representing all the pixels in this image, returned row-wise.- Specified by:
getArrayin interfaceSimpleModifiableImage- Parameters:
direct- if true, the internal array will be returned if possible- Returns:
-