original_docstring: 
          Solve the DPC absorption and phase deconvolution with TV regularization using ADMM algorithm.
          Inputs:
                  AHA, determinant: auxiliary functions
                  fIntensity      : Fourier spectra of DPC intensities
                  fDx, fDy        : TV filters in Fourier space
                  tv_order        : number of times applying fDx and fDy on the signals for each filtering operation
                  tv_max_iter     : number of ADMM iterations for solving this deconvolution problem
          Output:
                  The optimal absorption and phase given the input DPC intensities and regularization parameters
          
docstring: Solve the DPC absorption and phase deconvolution with TV regularization using ADMM algorithm.
docstring_tokens: Solve the DPC absorption and phase deconvolution with TV regularization using ADMM algorithm .
code: def deconvTV(self,AHA,determinant,fIntensity,fDx,fDy,tv_order,tv_max_iter):
          '''
          Solve the DPC absorption and phase deconvolution with TV regularization using ADMM algorithm.
          Inputs:
                  AHA, determinant: auxiliary functions
                  fIntensity      : Fourier spectra of DPC intensities
                  fDx, fDy        : TV filters in Fourier space
                  tv_order        : number of times applying fDx and fDy on the signals for each filtering operation
                  tv_max_iter     : number of ADMM iterations for solving this deconvolution problem
          Output:
                  The optimal absorption and phase given the input DPC intensities and regularization parameters
          '''
          z_k     = np.zeros((4,)+self.dpc_imgs.shape[1:], dtype='complex64')
          u_k     = np.zeros((4,)+self.dpc_imgs.shape[1:], dtype='complex64')
          D_k     = np.zeros((4,)+self.dpc_imgs.shape[1:], dtype='complex64')
          for iteration in range(tv_max_iter):
              y_k        = [F(z_k[index] - u_k[index]) for index in range(4)]
              AHy        = np.asarray([(self.Hu.conj()*fIntensity).sum(axis=0)+self.rho*(fDx.conj()*y_k[0]+fDy.conj()*y_k[1]),\
                                       (self.Hp.conj()*fIntensity).sum(axis=0)+self.rho*(fDx.conj()*y_k[2]+fDy.conj()*y_k[3])])
              absorption = IF((AHA[3]*AHy[0]-AHA[1]*AHy[1])/determinant).real
              phase      = IF((AHA[0]*AHy[1]-AHA[2]*AHy[0])/determinant).real
              if iteration < tv_max_iter-1:
                  if tv_order==1:
                      D_k[0] = absorption - np.roll(absorption,-1,axis=1)
                      D_k[1] = absorption - np.roll(absorption,-1,axis=0)
                      D_k[2] = phase - np.roll(phase,-1,axis=1)
                      D_k[3] = phase - np.roll(phase,-1,axis=0)
                  elif tv_order==2:
                      D_k[0] = 2*absorption - np.roll(absorption,-1,axis=1) - np.roll(absorption,1,axis=1)
                      D_k[1] = 2*absorption - np.roll(absorption,-1,axis=0) - np.roll(absorption,1,axis=0)
                      D_k[2] = 2*phase - np.roll(phase,-1,axis=1) - np.roll(phase,1,axis=1)
                      D_k[3] = 2*phase - np.roll(phase,-1,axis=0) - np.roll(phase,1,axis=0)
                  elif tv_order==3:
                      D_k[0] = 3*absorption - np.roll(absorption,-1,axis=1) - 3*np.roll(absorption,1,axis=1) + np.roll(absorption,2,axis=1)
                      D_k[1] = 3*absorption - np.roll(absorption,-1,axis=0) - 3*np.roll(absorption,1,axis=0) + np.roll(absorption,2,axis=0)
                      D_k[2] = 3*phase - np.roll(phase,-1,axis=1) - 3*np.roll(phase,1,axis=1) + np.roll(phase,2,axis=1)
                      D_k[3] = 3*phase - np.roll(phase,-1,axis=0) - 3*np.roll(phase,1,axis=0) + np.roll(phase,2,axis=0)
                  z_k         = D_k + u_k
                  z_k[:2,:,:] = _softThreshold(z_k[:2,:,:], self.tau_u/self.rho)
                  z_k[2:,:,:] = _softThreshold(z_k[2:,:,:], self.tau_p/self.rho)
                  u_k        += D_k - z_k
              print("DPC deconvolution with TV regularization, iteration:{:d}/{:d}".format(iteration+1, tv_max_iter), end="\r")
  
          return absorption+1.0j*phase
code_tokens: def deconvTV ( self , AHA , determinant , fIntensity , fDx , fDy , tv_order , tv_max_iter ) : z_k = np . zeros ( ( 4 , ) + self . dpc_imgs . shape [ 1 : ] , dtype = 'complex64' ) u_k = np . zeros ( ( 4 , ) + self . dpc_imgs . shape [ 1 : ] , dtype = 'complex64' ) D_k = np . zeros ( ( 4 , ) + self . dpc_imgs . shape [ 1 : ] , dtype = 'complex64' ) for iteration in range ( tv_max_iter ) : y_k = [ F ( z_k [ index ] - u_k [ index ] ) for index in range ( 4 ) ] AHy = np . asarray ( [ ( self . Hu . conj ( ) * fIntensity ) . sum ( axis = 0 ) + self . rho * ( fDx . conj ( ) * y_k [ 0 ] + fDy . conj ( ) * y_k [ 1 ] ) , ( self . Hp . conj ( ) * fIntensity ) . sum ( axis = 0 ) + self . rho * ( fDx . conj ( ) * y_k [ 2 ] + fDy . conj ( ) * y_k [ 3 ] ) ] ) absorption = IF ( ( AHA [ 3 ] * AHy [ 0 ] - AHA [ 1 ] * AHy [ 1 ] ) / determinant ) . real phase = IF ( ( AHA [ 0 ] * AHy [ 1 ] - AHA [ 2 ] * AHy [ 0 ] ) / determinant ) . real if iteration < tv_max_iter - 1 : if tv_order == 1 : D_k [ 0 ] = absorption - np . roll ( absorption , - 1 , axis = 1 ) D_k [ 1 ] = absorption - np . roll ( absorption , - 1 , axis = 0 ) D_k [ 2 ] = phase - np . roll ( phase , - 1 , axis = 1 ) D_k [ 3 ] = phase - np . roll ( phase , - 1 , axis = 0 ) elif tv_order == 2 : D_k [ 0 ] = 2 * absorption - np . roll ( absorption , - 1 , axis = 1 ) - np . roll ( absorption , 1 , axis = 1 ) D_k [ 1 ] = 2 * absorption - np . roll ( absorption , - 1 , axis = 0 ) - np . roll ( absorption , 1 , axis = 0 ) D_k [ 2 ] = 2 * phase - np . roll ( phase , - 1 , axis = 1 ) - np . roll ( phase , 1 , axis = 1 ) D_k [ 3 ] = 2 * phase - np . roll ( phase , - 1 , axis = 0 ) - np . roll ( phase , 1 , axis = 0 ) elif tv_order == 3 : D_k [ 0 ] = 3 * absorption - np . roll ( absorption , - 1 , axis = 1 ) - 3 * np . roll ( absorption , 1 , axis = 1 ) + np . roll ( absorption , 2 , axis = 1 ) D_k [ 1 ] = 3 * absorption - np . roll ( absorption , - 1 , axis = 0 ) - 3 * np . roll ( absorption , 1 , axis = 0 ) + np . roll ( absorption , 2 , axis = 0 ) D_k [ 2 ] = 3 * phase - np . roll ( phase , - 1 , axis = 1 ) - 3 * np . roll ( phase , 1 , axis = 1 ) + np . roll ( phase , 2 , axis = 1 ) D_k [ 3 ] = 3 * phase - np . roll ( phase , - 1 , axis = 0 ) - 3 * np . roll ( phase , 1 , axis = 0 ) + np . roll ( phase , 2 , axis = 0 ) z_k = D_k + u_k z_k [ : 2 , : , : ] = _softThreshold ( z_k [ : 2 , : , : ] , self . tau_u / self . rho ) z_k [ 2 : , : , : ] = _softThreshold ( z_k [ 2 : , : , : ] , self . tau_p / self . rho ) u_k += D_k - z_k print ( "DPC deconvolution with TV regularization, iteration:{:d}/{:d}" . format ( iteration + 1 , tv_max_iter ) , end = "\r" ) return absorption + 1.0j * phase
short_docstring: Solve the DPC absorption and phase deconvolution with TV regularization using ADMM algorithm.
short_docstring_tokens: Solve the DPC absorption and phase deconvolution with TV regularization using ADMM algorithm .
comment: '''
          Solve the DPC absorption and phase deconvolution with TV regularization using ADMM algorithm.
          Inputs:
                  AHA, determinant: auxiliary functions
                  fIntensity      : Fourier spectra of DPC intensities
                  fDx, fDy        : TV filters in Fourier space
                  tv_order        : number of times applying fDx and fDy on the signals for each filtering operation
                  tv_max_iter     : number of ADMM iterations for solving this deconvolution problem
          Output:
                  The optimal absorption and phase given the input DPC intensities and regularization parameters
          '''