Package qupath.lib.classifiers.pixel
Interface PixelClassifier
public interface PixelClassifier
Interface defining a pixel classifier.
Pixel classifiers can be applied directly to an image, typically using colors and textures.
- Author:
- Pete Bankhead
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Default location to use when storing object classifiers in a project. -
Method Summary
Modifier and TypeMethodDescriptionapplyClassification
(ImageData<BufferedImage> server, RegionRequest request) Apply pixel classifier to a specified region of an image.Get metadata that describes how the classifier should be called, and the kind of output it provides.boolean
supportsImage
(ImageData<BufferedImage> imageData) Query whether the classifier supports a particular image.
-
Field Details
-
PROJECT_LOCATION
Default location to use when storing object classifiers in a project.- See Also:
-
-
Method Details
-
supportsImage
Query whether the classifier supports a particular image. It may not if the number of channels (for example) is incompatible.- Parameters:
imageData
-- Returns:
-
applyClassification
BufferedImage applyClassification(ImageData<BufferedImage> server, RegionRequest request) throws IOException Apply pixel classifier to a specified region of an image.An
ImageData
andRegionRequest
are supplied, rather than aBufferedImage
directly, because there may be a need to adapt to the image resolution and/or incorporate padding to reduce boundary effects.There is no guarantee that the returned
BufferedImage
will be the same size as the input region (after downsampling), but rather that it should contain the full classification information for the specified region.Practically, this means that there may be fewer pixels in the output because the classification inherently involves downsampling.
- Parameters:
server
-request
-- Returns:
- a
BufferedImage
representing the pixel classifications as separate bands. - Throws:
IOException
- if unable to read pixels fromserver
-
getMetadata
PixelClassifierMetadata getMetadata()Get metadata that describes how the classifier should be called, and the kind of output it provides.- Returns:
-