def adjust_linewidth(self, img):
     tau = utils.intern_calc_linewidth(img)
     diff = 0.9
     while abs(self.r_tau - tau) > diff:
         r = int(round(self.r_tau - tau))
         r = r if r != 0 else int(
             np.sign(dt))  # Ensures that r is at least 1 or -1
         #print("{rtau : %s, tau: %s, r = %s}" % (self.r_tau, tau, r))
         img = utils.change_linewidth(img, r)
         tau = utils.intern_calc_linewidth(img)
         #print("new line thickness tau = %s" % tau)
     self.reporter.report_complete()
     return img
 def adjust_linewidth(self, img):
     new_img = utils.change_linewidth(img, self.factor)
     self.reporter.report_complete()
     return new_img