def convertImages(self):
<EOL>exts=['<STR_LIT>','<STR_LIT>']<EOL>for fname in [x for x in self.files1 if cm.ext(x) in exts]:<EOL><INDENT>ID="<STR_LIT>"<EOL>if len(fname)><NUM_LIT:8> and fname[:<NUM_LIT:8>] in self.IDs:<EOL><INDENT>ID=fname[:<NUM_LIT:8>]<EOL><DEDENT>fname2=ID+"<STR_LIT>"+fname<EOL>if not fname2 in self.files2:<EOL><INDENT>self.log.info("<STR_LIT>"%fname2)<EOL>shutil.copy(os.path.join(self.folder1,fname),os.path.join(self.folder2,fname2))<EOL><DEDENT>if not fname[:<NUM_LIT:8>]+"<STR_LIT>" in self.files1:<EOL><INDENT>self.log.error("<STR_LIT>",fname)<EOL><DEDENT><DEDENT>exts=['<STR_LIT>','<STR_LIT>']<EOL>for fname in [x for x in self.files1 if cm.ext(x) in exts]:<EOL><INDENT>ID="<STR_LIT>"<EOL>if len(fname)><NUM_LIT:8> and fname[:<NUM_LIT:8>] in self.IDs:<EOL><INDENT>ID=fname[:<NUM_LIT:8>]<EOL><DEDENT>fname2=ID+"<STR_LIT>"+fname+"<STR_LIT>"<EOL>if not fname2 in self.files2:<EOL><INDENT>self.log.info("<STR_LIT>"%fname2)<EOL>imaging.TIF_to_jpg(os.path.join(self.folder1,fname),saveAs=os.path.join(self.folder2,fname2))<EOL><DEDENT>if not fname[:<NUM_LIT:8>]+"<STR_LIT>" in self.files1:<EOL><INDENT>self.log.error("<STR_LIT>",fname)<EOL><DEDENT><DEDENT>
run this to turn all folder1 TIFs and JPGs into folder2 data.
TIFs will be treated as micrographs and converted to JPG with enhanced
contrast. JPGs will simply be copied over.