ReclassTransformer#
- class ReclassTransformer[source]#
Bases:
RasterTransformer
Maps class IDs in a label raster to other values.
Methods
__init__
(mapping)Construct a new ReclassTransformer.
transform
(chip[, channel_order])Transform a chip.
- transform(chip: np.ndarray, channel_order: Optional[List[int]] = None)[source]#
Transform a chip.
Reclassify a label raster using the given mapping.
- Parameters
chip (np.ndarray) – ndarray of shape [height, width, channels] This is assumed to already have the channel_order applied to it if channel_order is set. In other words, channels should be equal to len(channel_order).
channel_order (Optional[List[int]]) – list of indices of channels that were extracted from the raw imagery.
- Returns
[height, width, channels] numpy array