docs: def rectify(self, slitlet2d, resampling, inverse=False):
          """Rectify slitlet using computed transformation.
  
          Parameters
          ----------
          slitlet2d : numpy array
              Image containing the 2d slitlet image.
          resampling : int
              1: nearest neighbour, 2: flux preserving interpolation.
          inverse : bool
              If true, the inverse rectification transformation is
              employed.
  
          Returns
          -------
          slitlet2d_rect : numpy array
              Rectified slitlet image.
  
          """
  
          if resampling not in [1, 2]:
              raise ValueError("Unexpected resampling value=" + str(resampling))
  
          # check image dimension
          naxis2, naxis1 = slitlet2d.shape
          if naxis1 != self.bb_nc2_orig - self.bb_nc1_orig + 1:
              raise ValueError("Unexpected slitlet2d_rect naxis1")
          if naxis2 != self.bb_ns2_orig - self.bb_ns1_orig + 1:
              raise ValueError("Unexpected slitlet2d_rect naxis2")
  
          if inverse:
              aij = self.tti_aij
              bij = self.tti_bij
          else:
              aij = self.ttd_aij
              bij = self.ttd_bij
  
          # rectify image
          slitlet2d_rect = rectify2d(
              image2d=slitlet2d,
              aij=aij,
              bij=bij,
              resampling=resampling
          )
  
          if abs(self.debugplot % 10) != 0:
              if inverse:
                  self.ximshow_unrectified(slitlet2d_rect)
              else:
                  self.ximshow_rectified(slitlet2d_rect)
  
          return slitlet2d_rect