def stitchFolder(self, targetFolder): stitcherHandler = Stitcher() filesToStitch = [] onlyFiles = [ f for f in os.listdir(targetFolder) if isfile(join(targetFolder, f)) ] for files in onlyFiles: if (files.endswith(".jpg")): filesToStitch.append(targetFolder + "/" + files) if (len(filesToStitch) < 2): return parentName = os.path.split(os.path.dirname(filesToStitch[0]))[1] outputFile = os.path.join(os.path.dirname(filesToStitch[0]), parentName + ".tiff") logFile = os.path.join(os.path.dirname(filesToStitch[0]), parentName + "_log.txt") filesToStitch.sort() print(filesToStitch) print(outputFile) print("Logging to: " + logFile) if (outputFile is None): exit() stitcherHandler.stitchFileList(filesToStitch, outputFile, logFile, self.progressCallback, self.maskBox.IsChecked(), self.scalePath, self.verticalCore.IsChecked()) if (self.archiveImages.IsChecked()): self.ArchiveQueue.put(targetFolder)