class_docstr: Convert box to int16 mask image, which has the same size with the input image.
  
  Args:
      bg_label: background labels for the output mask image, make sure it is smaller than any foreground(fg) labels.
      ellipse_mask: bool.
  
          - If True, it assumes the object shape is close to ellipse or ellipsoid.
          - If False, it assumes the object shape is close to rectangle or cube and well occupies the bounding box.
          - If the users are going to apply random rotation as data augmentation, we suggest setting ellipse_mask=True
            See also Kalra et al. "Towards Rotation Invariance in Object Detection", ICCV 2021.
class_docstr_tok: ["Convert","box","to","int16","mask","image",",","which","has","the","same","size","with","the","input","image",".","Args",":","bg_label",":","background","labels","for","the","output","mask","image",",","make","sure","it","is","smaller","than","any","foreground","(","fg",")","labels",".","ellipse_mask",":","bool",".","-","If","True",",","it","assumes","the","object","shape","is","close","to","ellipse","or","ellipsoid",".","-","If","False",",","it","assumes","the","object","shape","is","close","to","rectangle","or","cube","and","well","occupies","the","bounding","box",".","-","If","the","users","are","going","to","apply","random","rotation","as","data","augmentation",",","we","suggest","setting","ellipse_mask=True","See","also","Kalra","et","al",".","``","Towards","Rotation","Invariance","in","Object","Detection","''",",","ICCV","2021","."]
docstr: Args:
      boxes: bounding boxes, Nx4 or Nx6 torch tensor or ndarray. The box mode is assumed to be ``StandardMode``.
      labels: classification foreground(fg) labels corresponding to `boxes`, dtype should be int, sized (N,).
      spatial_size: image spatial size.
  
  Return:
      - int16 array, sized (num_box, H, W). Each channel represents a box.
          The foreground region in channel c has intensity of labels[c].
          The background intensity is bg_label.
docstr_tok: ["Args",":","boxes",":","bounding","boxes",",","Nx4","or","Nx6","torch","tensor","or","ndarray",".","The","box","mode","is","assumed","to","be","``","StandardMode","``",".","labels",":","classification","foreground","(","fg",")","labels","corresponding","to","`","boxes","`",",","dtype","should","be","int",",","sized","(","N",",",")",".","spatial_size",":","image","spatial","size",".","Return",":","-","int16","array",",","sized","(","num_box",",","H",",","W",")",".","Each","channel","represents","a","box",".","The","foreground","region","in","channel","c","has","intensity","of","labels","[","c","]",".","The","background","intensity","is","bg_label","."]
code: def __call__(  # type: ignore
      self,
      boxes: NdarrayOrTensor,
      labels: NdarrayOrTensor,
      spatial_size: Sequence[int] | int,
  ) -> NdarrayOrTensor:
      """
      Args:
          boxes: bounding boxes, Nx4 or Nx6 torch tensor or ndarray. The box mode is assumed to be ``StandardMode``.
          labels: classification foreground(fg) labels corresponding to `boxes`, dtype should be int, sized (N,).
          spatial_size: image spatial size.
  
      Return:
          - int16 array, sized (num_box, H, W). Each channel represents a box.
              The foreground region in channel c has intensity of labels[c].
              The background intensity is bg_label.
      """
      return convert_box_to_mask(
          boxes, labels, spatial_size, self.bg_label, self.ellipse_mask
      )
  
imports: from __future__ import annotations
  from typing import Any, Sequence
  import numpy
  import torch
  from monai.config.type_definitions import DtypeLike, NdarrayOrTensor, NdarrayTensor
  from monai.data.box_utils import BoxMode, clip_boxes_to_image, convert_box_mode, convert_box_to_standard_mode, get_spatial_dims, spatial_crop_boxes, standardize_empty_box
  from monai.transforms import Rotate90, SpatialCrop
  from monai.transforms.transform import Transform
  from monai.utils import ensure_tuple, ensure_tuple_rep, fall_back_tuple, look_up_option
  from monai.utils.enums import TransformBackends
  from .box_ops import apply_affine_to_boxes, convert_box_to_mask, convert_mask_to_box, flip_boxes, resize_boxes, rot90_boxes, select_labels, zoom_boxes
label_desc: Use image node_id 2 for calling the BoxToMask obj's underlying member method code with example usage: obj.__call__(boxes, labels, spatial_size) and returns: convert_box_to_mask