code: def box_mask(self, box):
          
          if not isinstance(box, Box):
              raise ValueError('Must provide Box object')
          if box.frame != self.frame:
              raise ValueError('Box must be in same frame as PointCloud')
          all_points = self.data.T
          cond1 = np.all(box.min_pt <= all_points, axis=1)
          cond2 = np.all(all_points <= box.max_pt, axis=1)
          valid_point_indices = np.where(np.logical_and(cond1, cond2))[0]
          valid_points = all_points[valid_point_indices]
  
          return PointCloud(valid_points.T, self.frame), valid_point_indices
docs: Return a PointCloud containing only points within the given Box.
  
          Parameters
          ----------
          box : :obj:`Box`
              A box whose boundaries are used to filter points.
  
          Returns
          -------
          :obj:`PointCloud`
              A filtered PointCloud whose points are all in the given box.
          :obj:`numpy.ndarray`
              Array of indices of the segmented points in the original cloud
  
          Raises
          ------
          ValueError
              If the input is not a box in the same frame as the PointCloud.