Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Commit

Permalink
PDF report changes, update README
Browse files Browse the repository at this point in the history
  • Loading branch information
LP-CDF committed Feb 4, 2020
1 parent c25870a commit b8183b6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
9 changes: 6 additions & 3 deletions AMi_Image_Analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down
18 changes: 12 additions & 6 deletions pdf_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit b8183b6

Please sign in to comment.