%N boxbound %F $MIR/src/subs/boxes.for
%D Return bounding boxes for each "region" subcommand.
%P mjs
%: region-of-interest
%B
      subroutine BoxBound(boxes,subcmd,naxis,type,mode,blc,trc)

      integer boxes(*),subcmd,naxis
      character type*(*),mode*(*)
      integer blc(naxis),trc(naxis)
  ---------------------------------------------------------------------
  Return the bounding box for each region subcommand.

  Input:
    boxes      The boxes array.
    subcmd     The subcommand number.
    naxis      The dimensionality of blc and trc.
  Output:
    type       Either 'box','poly' or 'mask'.
    mode       Either 'or' or 'and'.
    blc        Blc of the bounding box.
    trc        Trc of the bounding box.
