Imported from https://github.com/saalfeldlab/em-thickness-estimation