class_docstr: A subclass of ``BoxMode``.
  
  Also represented as "xywh" or "xyzwhd", with format of
  [xmin, ymin, xsize, ysize] or [xmin, ymin, zmin, xsize, ysize, zsize].
  
  Example:
      .. code-block:: python
  
          CornerSizeMode.get_name(spatial_dims=2) # will return "xywh"
          CornerSizeMode.get_name(spatial_dims=3) # will return "xyzwhd"
class_docstr_tok: ["A","subclass","of","``","BoxMode","``",".","Also","represented","as","``","xywh","''","or","``","xyzwhd","''",",","with","format","of","[","xmin",",","ymin",",","xsize",",","ysize","]","or","[","xmin",",","ymin",",","zmin",",","xsize",",","ysize",",","zsize","]",".","Example",":","..","code-block",":",":","python","CornerSizeMode.get_name","(","spatial_dims=2",")","#","will","return","``","xywh","''","CornerSizeMode.get_name","(","spatial_dims=3",")","#","will","return","``","xyzwhd","''"]
code: def corners_to_boxes(self, corners: Sequence) -> torch.Tensor:
      boxes: torch.Tensor
      spatial_dims = get_spatial_dims(corners=corners)
      if spatial_dims == 3:
          xmin, ymin, zmin, xmax, ymax, zmax = (
              corners[0],
              corners[1],
              corners[2],
              corners[3],
              corners[4],
              corners[5],
          )
          boxes = torch.cat(
              (
                  xmin,
                  ymin,
                  zmin,
                  xmax - xmin + TO_REMOVE,
                  ymax - ymin + TO_REMOVE,
                  zmax - zmin + TO_REMOVE,
              ),
              dim=-1,
          )
      elif spatial_dims == 2:
          xmin, ymin, xmax, ymax = (
              corners[0],
              corners[1],
              corners[2],
              corners[3],
          )
          boxes = torch.cat(
              (
                  xmin,
                  ymin,
                  xmax - xmin + TO_REMOVE,
                  ymax - ymin + TO_REMOVE,
              ),
              dim=-1,
          )
      return boxes
  
imports: from __future__ import annotations
  import inspect
  import warnings
  from abc import ABC, abstractmethod
  from collections.abc import Callable, Sequence
  from copy import deepcopy
  import numpy
  import torch
  from monai.config.type_definitions import NdarrayOrTensor, NdarrayTensor
  from monai.utils import look_up_option
  from monai.utils.enums import BoxModeName
  from monai.utils.type_conversion import convert_data_type, convert_to_dst_type
label_desc: Use image node_id 2 for calling the CornerSizeMode obj's underlying member method code with example usage: obj.corners_to_boxes(corners) and returns: boxes