ddd_pylib.labels_manip.

ReplaceValuesOperator#

class ddd_pylib.labels_manip.ReplaceValuesOperator[source]#

Bases: ImageOperator

Takes an image and a dictionary of values representing a LUT and replaces the values in the image according to this LUT. Only images with integer dtypes are supported.

Methods

getPrefix()[source]#

Prefix added to the input image name to generate the output image name.

Return type:

str

sanityCheck()[source]#

Simple check to prevent simple error, it may be implemented in subclasses to check more precise stuff

setValuesDict(values_dict)[source]#

Set the dictionary of values to be replaced. The keys are the original values, and the values are the new values. If a value is not specified in the dictionary, it will be replaced by itself (i.e., it will remain unchanged).

Parameters:

values_dict (Dict[integer, integer] | Dict[int, int])