Package qupath.opencv.tools
Class OpenCVTools.IndexedPixel
java.lang.Object
qupath.opencv.tools.OpenCVTools.IndexedPixel
- Enclosing class:
- OpenCVTools
Class representing the indices of a pixel and its value.
This has considerable overhead, so should be used sparingly.
-
Method Summary
Modifier and TypeMethodDescriptionlongGet the euclidean distance to another pixel, based upon the inds array and assuming unit spacing for all dimensions.intgetC()Get channel index.long[]getInds()Get the index array.doublegetValue()Get the value stored internally for this pixel.doubleGet the value from another image via itsIndexer.intgetX()Get x index.intgetY()Get y index.
-
Method Details
-
getX
public int getX()Get x index.- Returns:
-
getY
public int getY()Get y index.- Returns:
-
getC
public int getC()Get channel index.- Returns:
-
getInds
public long[] getInds()Get the index array. Note that this returns a clone of the array.- Returns:
- See Also:
-
getValue
public double getValue()Get the value stored internally for this pixel.- Returns:
-
getValue
Get the value from another image via itsIndexer. This is equivalent toIndexer.getDouble(IndexedPixel.getInds())but avoids copying the inds array.- Parameters:
idx-- Returns:
-
distanceSq
Get the euclidean distance to another pixel, based upon the inds array and assuming unit spacing for all dimensions.- Parameters:
p2-- Returns:
-