diff --git a/AMi_Image_Analysis.py b/AMi_Image_Analysis.py index afb83d3..3422110 100755 --- a/AMi_Image_Analysis.py +++ b/AMi_Image_Analysis.py @@ -471,10 +471,10 @@ def export_pdf(self): imgDir=self.imageDir img_list=self.well_images values = [] - name = "" + # name = "" well=self.currentWell - values.append(name) + values.append(well) imgpath=self.buildWellImagePath(imgDir, well, img_list) # path = directory + "/" + well @@ -486,13 +486,16 @@ def export_pdf(self): values.append(self.target) values.append(self.plate) values.append(self.date) + values.append(self.prepdate) + values.append(pdfpath) text=self.Notes_TextEdit.toPlainText() values.append(text) - values.append(pdfpath) pdf_writer.create_pdf(values) print("Report for well %s saved to %s"%(well, pdfpath)) # message="File saved to:\n %s"%pdfpath # self.informationDialog(message) + # print("VALUES :\n", values) + # print("LEN VALUES :", len(values)) def Directory(self, path): diff --git a/README.md b/README.md index 8cbbc31..39f71d6 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ The tree must be organized like: ``` AMi controlling software needs a folder named "images". The date directory must have the format YYYYMMDD_HHMMSS (eg. 20191211_151023) -The file "prep_date.txt" only contains the preparation date of the plate. It contains a single line with a date without specific format. It is used for logging purpose only. +The file "prep_date.txt" contains the preparation date of the plate. It contains a single line with a date with format YYYYMMDD and is created within the program. It is used for logging purpose only and is not mandatory. 2019/12/12: @@ -73,6 +73,10 @@ Release 1.1.8. 2020/01/29: Updated tensorflow to 1.15.2 in requirements.txt +2020/02/03 +Images in Timeline can be clicked to load corresponding image in main viewing frame for closer comparison. +autoMARCO windows can all be displayed at the same time (previously only a single window could be loaded) + ## Screenshots ![Screenshot 1](./screenshot1.png) diff --git a/pdf_writer.py b/pdf_writer.py index 7287a7a..de144ba 100644 --- a/pdf_writer.py +++ b/pdf_writer.py @@ -54,15 +54,21 @@ def footer(self): def create_pdf(_list): unsupported=[".tif",".tiff",".TIFF", ".TIF"] TIFFFILE=False - name = _list[0] + well = _list[0] well_image = _list[1] project_name = _list[2] target_name = _list[3] plate_name = _list[4] date = _list[5] + if _list[6]=="None": + prepdate="Not available" + else: + prepdate=_list[6] + prepdate="%s-%s-%s"%(prepdate[0:4], prepdate[4:6], prepdate[6:]) + outputpath=_list[7] - notes = _list[6] + notes = _list[8] # print("TIF EXT ", os.path.splitext(os.path.basename(well_image))[1]) # print("IMAGE PATH", well_image) # print("OUTPUT JPEG ", os.path.dirname(well_image)+"/"+os.path.splitext(os.path.basename(well_image))[0]+".jpeg") @@ -78,7 +84,7 @@ def create_pdf(_list): pdf.add_page() pdf.set_font("Arial", size=14) - pdf.cell(0, 15, "Prepared by: " + name, align="C", ln=1) + pdf.cell(0, 15, "Well: " + well, align="C", ln=1) pdf.image(well_image, 30, 55, w=153, h=115) @@ -106,15 +112,15 @@ def create_pdf(_list): pdf.cell(50, 18, "Date of image: ", align="R", ln=0) pdf.set_font("Arial", size=14) - pdf.cell(0, 18, date, align="L", ln=1) + pdf.cell(0, 18, "%s-%s-%s (Preparation date: %s)"%(date[0:4], date[4:6], date[6:], prepdate), align="L", ln=1) pdf.ln(10) pdf.set_font("Arial", size=14, style="B") pdf.cell(50, 0, "Notes: ", align="R", ln=0) - pdf.set_font("Arial", size=14) - pdf.cell(0, 0, notes, align="L", ln=1) + pdf.set_font("Arial", size=12) + pdf.multi_cell(120, 8, notes, 'J') pdf.output(outputpath)