code: def do_region(self, x, y, w, h):
          
          infile = self.tmpfile
          outfile = self.basename + '.reg'
          # simeon@ice ~>cat m.pnm | pnmcut 10 10 100 200 > m1.pnm
          if (x is None):
              # print "region: full"
              self.tmpfile = infile
          else:
              # print "region: (%d,%d,%d,%d)" % (x,y,w,h)
              if (self.shell_call('cat ' + infile + ' | ' + self.pnmcut + ' ' + str(x) + ' ' + str(y) + ' ' + str(w) + ' ' + str(h) + '  > ' + outfile)):
                  raise IIIFError(text="Oops... got nonzero output from pnmcut.")
              self.width = w
              self.height = h
              self.tmpfile = outfile
docs: Apply region selection.