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.
- Author:
- Pete Bankhead
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfloat[]
getArray
(boolean direct) Request the pixel array representing all the pixels in this image, returned row-wise.int
Get the image height.float
getValue
(int x, int y) Get the value of a single pixel as a float.int
getWidth()
Get the image width.void
setValue
(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:SimpleImage
Get the value of a single pixel as a float.- Specified by:
getValue
in 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:SimpleModifiableImage
Set the value of a single pixel.- Specified by:
setValue
in 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:SimpleImage
Get the image width.- Specified by:
getWidth
in interfaceSimpleImage
- Returns:
-
getHeight
public int getHeight()Description copied from interface:SimpleImage
Get the image height.- Specified by:
getHeight
in interfaceSimpleImage
- Returns:
-
getArray
public float[] getArray(boolean direct) Description copied from interface:SimpleModifiableImage
Request the pixel array representing all the pixels in this image, returned row-wise.- Specified by:
getArray
in interfaceSimpleModifiableImage
- Parameters:
direct
- if true, the internal array will be returned if possible- Returns:
-