ImageIO.getPixelsize#

ImageIO.getPixelsize(diff=1e-06)#

Return pixel size at the specimen level in nanometers.

For mrc files, it returns a single pixelsize if it’s the same for all dimensions, otherwise a list of pixelsizes for each dimension is returned. Pixelsizes are considered the same if they do not differ more than the specified difference.

Parameters:
difffloat, optional

The threshold for pixel size difference to be considered the same, by default 1e-6.

Returns:
float or list of float

Pixel size(s) in nm.

Raises:
ValueError

If the file format is neither ‘em’ nor ‘mrc’.