Created
December 22, 2014 18:11
-
-
Save joefutrelle/ea96dfc075de993d1235 to your computer and use it in GitHub Desktop.
Extract description from #TIFF files using python-tifffile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/env/python | |
| import os | |
| from glob import glob | |
| from tifffile import TiffFile | |
| BASE_DIR='{whatever}' | |
| for tfpath in sorted(glob(os.path.join(BASE_DIR,'*.tif'))): | |
| tf = TiffFile(tfpath) | |
| tfn = os.path.basename(tfpath) | |
| desc = tf.series[0]['pages'][0].tags['image_description'].value | |
| print '%s,%s' % (tfn, desc) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment