class_docstr: Holds the path to mask image file.
  
  # Arguments
      filepath: Path to the mask image file.
code: def to_mask(self, h=None, w=None):
      mask_img = open_img(self.filepath, gray=True)
  
      if (h is not None) and (w is not None):
          # If the dimensions provided in h and w do not match the size of the mask, resize the mask accordingly
          (w_org, h_org) = mask_img.size
  
          # TODO: Check NEAREST is always the best option or only for binary?
          if w_org != w or h_org != h:
              mask_img = mask_img.resize(
                  (w, h), resample=PIL.Image.NEAREST
              )
  
      mask = np.array(mask_img)
      obj_ids = np.unique(mask)[1:]
      masks = mask == obj_ids[:, None, None]
  
      return MaskArray(masks)
  
imports: from icevision.imports import *
  from icevision.utils import *
  from PIL import Image
label_desc: Use image node_id 2 for calling the MaskFile obj's underlying member method code with example usage: obj.to_mask(h, w) and returns: MaskArray