code: def get_scaled_cutout_wdht(self, x1, y1, x2, y2, new_wd, new_ht,
                                 method='basic'):
          
  
          if method in ('basic', 'view'):
              shp = self.shape
  
              (view, (scale_x, scale_y)) = \
                  trcalc.get_scaled_cutout_wdht_view(shp, x1, y1, x2, y2,
                                                     new_wd, new_ht)
              newdata = self._slice(view)
  
          else:
              data_np = self._get_data()
              (newdata, (scale_x, scale_y)) = \
                  trcalc.get_scaled_cutout_wdht(data_np, x1, y1, x2, y2,
                                                new_wd, new_ht,
                                                interpolation=method,
                                                logger=self.logger)
  
          res = Bunch.Bunch(data=newdata, scale_x=scale_x, scale_y=scale_y)
          return res
docs: Extract a region of the image defined by corners (x1, y1) and
          (x2, y2) and resample it to fit dimensions (new_wd, new_ht).
  
          `method` describes the method of interpolation used, where the
          default "basic" is nearest neighbor.