Replace Values

This algorithm replaces a series of values in an image.

Input

A single-channel unsigned byte or unsigned short image or volume or set containing any combination thereof. Optionally a reference image(set) of the same size and type.

Output

The image intensities are modified in-place.

Description

DANGER: Before doing anything else, the algorithm converts the input image from storage to original units by applying the current shift&scale values to the stored pixel values. This can cause over- or underflow. Do not use this algorithm on images with shift != 0 or scale != 1 unless you are certain you know what you are doing.

The algorithm replaces all OldValues with NewValues. The values must be entered as numbers separated with a space. For instance, if OldValues is “0 5” and NewValues is “3 1”, then all 0 values will be replaced by 3 and all 5 values will be replaced by 1.

If a reference image has been specified, this second image will determine which pixels get replaced. In the above example, all pixels where the reference image is 0 would be set to 3 in the target image.

Values outside the range [0; 65535] will be ignored. If the size of OldValues does not match the size of NewValues, only the first valid values will be considered.