class_docstr: Replaces the pixel values in range [0-255] with class values from supplied value_map.
  
  :return     : numpy.ndarray with dtype=np.uint8
class_docstr_tok: ["Replaces","the","pixel","values","in","range","[","0-255","]","with","class","values","from","supplied","value_map",".",":","return",":","numpy.ndarray","with","dtype=np.uint8"]
docstr: :param value_map: Value map to encode. Typically classes are a set of continuous integers starting at 0 (e.g. {55:0, 100:1, 255:2})
code: def __init__(self, value_map: dict = None):
      """
      :param value_map: Value map to encode. Typically classes are a set of continuous integers starting at 0 (e.g. {55:0, 100:1, 255:2})
      """
      self.value_map = value_map
  
imports: import random
  import torch
  from torchvision.transforms.functional import to_tensor
  import numpy
  from ..utils import th_random_choice
label_desc: Use image node_id 1 to create a new MaskPixelsToMap object  with example: obj = MaskPixelsToMap(value_map)