How does nilearn.plotting.plot_anat automatically calculate cut_coords?

I use nilearn.plotting.plot_anat to plot my structural T1-weighted images. If one does not provide the function with cut_coords they will be calculated automatically:

cut_coords None, a tuple of floats, or an integer

The MNI coordinates of the point where the cut is performed If display_mode is ‘ortho’ or ‘tiled’, this should be a 3-tuple: (x, y, z) For display_mode == ‘x’, ‘y’, or ‘z’, then these are the coordinates of each cut in the corresponding direction. If None is given, the cuts is calculated automaticaly. If display_mode is ‘x’, ‘y’ or ‘z’, cut_coords can be an integer, in which case it specifies the number of cuts to perform

However, I can’t find any documentation on how specifically this is done internally?

it uses nilearn.plotting.find_cuts.find_xyz_cut_coords to cut in the middle of the largest connected component after thresholding the image at the 80th percentile for x,y,z display, otherwise linearly spaced slices. the strategy is the same for anat or stat images, only the default threshold changes