cortex.surfinfo.distortion(outfile, subject, dist_type='areal', smooth=20)[source]

Compute distortion of flatmap relative to fiducial surface and save it at outfile. Several different types of distortion are available:

‘areal’: computes the areal distortion for each triangle in the flatmap, defined as the log ratio of the area in the fiducial mesh to the area in the flat mesh. Returns a per-vertex value that is the average of the neighboring triangles. See:

‘metric’: computes the linear distortion for each vertex in the flatmap, defined as the mean squared difference between distances in the fiducial map and distances in the flatmap, for each pair of neighboring vertices. See Fishl, Sereno, and Dale, 1999.


Path where the distortion map will be saved as an npz file.


Subject in the pycortex database for whom distortion will be computed.

dist_type[‘areal’, ‘metric’], optional

Type of distortion to compute. Default ‘areal’.

smoothfloat, optional

Amount of smoothing to apply to the distortion map before returning. Default 20.