CastTransformer#

class CastTransformer[source]#

Bases: RasterTransformer

Casts chips to the specified dtype.

__init__(to_dtype: str)[source]#

Constructor.

Parameters

to_dtype (str) – (str) dtype to cast the chips to.

Methods

__init__(to_dtype)

Constructor.

transform(chip[, channel_order])

Cast chip to self.to_dtype.

__init__(to_dtype: str)[source]#

Constructor.

Parameters

to_dtype (str) – (str) dtype to cast the chips to.

transform(chip: ndarray, channel_order: Optional[list] = None) ndarray[source]#

Cast chip to self.to_dtype.

Parameters
  • chip (ndarray) – ndarray of shape [height, width, channels]

  • channel_order (Optional[list]) –

Returns

[height, width, channels] numpy array

Return type

ndarray