Interface ImageOp
- All Superinterfaces:
UriResource
- All Known Implementing Classes:
ImageOps.PaddedOp
Mat
.
This is intended to apply simple transforms to an image (e.g. color transforms, channel extraction, filtering, normalization), which may impact the number and type of image channels - but not other aspects of the image, with the exception of removing any padding.
Operations may be chained
-
Method Summary
Modifier and TypeMethodDescriptionApply operation to the image.default List
<ImageChannel> getChannels
(List<ImageChannel> channels) Get appropriate channels to reflect the output of this transform.default PixelType
getOutputType
(PixelType inputType) Get the output pixel type.default Padding
Get the padding requested for this operation.default Collection
<URI> getURIs()
Default implementation returns an empty list; classes should override this if necessary.default boolean
updateURIs
(Map<URI, URI> replacements) Default implementation makes no changes; classes should override this if necessary.Methods inherited from interface qupath.lib.io.UriResource
getUris, updateUris
-
Method Details
-
apply
Apply operation to the image. The input may be modified (and the operation applied in-place), therefore should be duplicated if a copy is required to be kept.Note that any non-empty padding will be removed, potentially giving an output image smaller than the input. If this is not desirable use
ImageOps.padAndApply(ImageOp, Mat)
.- Parameters:
input
- input image- Returns:
- output image, which may be the same as the input image
- See Also:
-
getPadding
Get the padding requested for this operation. The default is to returnPadding.empty()
.Subclasses that perform neighborhood operations should override this. If the padding is non-empty, it will be removed when
apply(Mat)
is called - and so theMat
that is output will be smaller than theMat
that was input.- Returns:
- the padding requested by this operation
-
getChannels
Get appropriate channels to reflect the output of this transform. The default is to return the input list unchanged.Classes that change the meaning or number of channels should override this. In particular, the number of channels in the output list should match the number of channels output by this transformer, given the input channels.
- Parameters:
channels
-- Returns:
-
getOutputType
Get the output pixel type. The default is to return the pixel type unchanged.- Parameters:
inputType
- the input pixel type- Returns:
- the output pixel type
-
getURIs
Default implementation returns an empty list; classes should override this if necessary.- Specified by:
getURIs
in interfaceUriResource
- Returns:
- the required URIs
- Throws:
IOException
-
updateURIs
Default implementation makes no changes; classes should override this if necessary.- Specified by:
updateURIs
in interfaceUriResource
- Parameters:
replacements
- replacement map, where the key gives the current URI and the value gives its replacement.- Returns:
- true if URIs were changed, false otherwise
- Throws:
IOException
-