ants.deeplearn.histogram_warp_image_intensities

histogram_warp_image_intensities(image, break_points=(0.25, 0.5, 0.75), displacements=None, clamp_end_points=(False, False), sd_displacements=0.05, transform_domain_size=20)[source]

Transform image intensities based on histogram mapping.

Apply B-spline 1-D maps to an input image for intensity warping.

Parameters:
  • image (ants.core.ANTsImage) – Input image.

  • break_points (int or tuple) – Parametric points at which the intensity transform displacements are specified between [0, 1]. Alternatively, a single number can be given and the sequence is linearly spaced in [0, 1].

  • displacements (tuple) – displacements to define intensity warping. Length must be equal to the breakPoints. Alternatively, if None random displacements are chosen (random normal: mean = 0, sd = sd_displacements).

  • sd_displacements (float) – Characterize the randomness of the intensity displacement.

  • clamp_end_points (2-element tuple of booleans) – Specify non-zero intensity change at the ends of the histogram.

  • transform_domain_size (int) – Defines the sampling resolution of the B-spline warping.

Return type:

ANTs image

Example

>>> import ants
>>> image = ants.image_read(ants.get_ants_data("r64"))
>>> transformed_image = histogram_warp_image_intensities( image )