code: def abp_n4(image, intensity_truncation=(0.025,0.975,256), mask=None, usen3=False):
      
      if (not isinstance(intensity_truncation, (list,tuple))) or (len(intensity_truncation) != 3):
          raise ValueError('intensity_truncation must be list/tuple with 3 values')
      outimage = iMath(image, 'TruncateIntensity',
              intensity_truncation[0], intensity_truncation[1], intensity_truncation[2])
      if usen3 == True:
          outimage = n3_bias_field_correction(outimage, 4)
          outimage = n3_bias_field_correction(outimage, 2)
          return outimage
      else:
          outimage = n4_bias_field_correction(outimage, mask)
          return outimage
docs: Truncate outlier intensities and bias correct with the N4 algorithm.
  
      ANTsR function: `abpN4`
  
      Arguments
      ---------
      image : ANTsImage
          image to correct and truncate
  
      intensity_truncation : 3-tuple
          quantiles for intensity truncation
  
      mask : ANTsImage (optional)
          mask for bias correction
  
      usen3 : boolean
          if True, use N3 bias correction instead of N4
  
      Returns
      -------
      ANTsImage
  
      Example
      -------
      >>> import ants
      >>> image = ants.image_read(ants.get_ants_data('r16'))
      >>> image2 = ants.abp_n4(image)