Closed Rdornier closed 8 months ago
This looks like it's working well in the web app. I'm afraid it will also need a corresponding change in the export script: https://github.com/ome/omero-figure/blob/master/omero_figure/scripts/omero/figure_scripts/Figure_To_Pdf.py
Actually, I didn't know that Figure_to_pdf also need to be modified... I try to add the right vertical position but it seems to not work properly. Right vertical labels are not displayed. Do you know if I only need to modify this file or if there is anther one linked to Figure_to_Pdf.py that I also need to change ?
@Rdornier After spending a while to remember how labels are laid out in reportlab, I finally found that this is what you need:
$ git diff
diff --git a/omero_figure/scripts/omero/figure_scripts/Figure_To_Pdf.py b/omero_figure/scripts/omero/figure_scripts/Figure_To_Pdf.py
index 1c24f14..aa0adfe 100644
--- a/omero_figure/scripts/omero/figure_scripts/Figure_To_Pdf.py
+++ b/omero_figure/scripts/omero/figure_scripts/Figure_To_Pdf.py
@@ -2044,11 +2044,11 @@ class FigureExport(object):
# Switch axes
c.rotate(-90)
px = x
- x = y
- y = -px
+ x = -y
+ y = px
# Align center
alignment = TA_CENTER
- x = x + (para_width/2)
+ x = x - (para_width/2)
# set fully opaque background color to avoid transparent text
c.setFillColorRGB(0, 0, 0, 1)
Thanks @will-moore ; However, the labels are still not displayed yet
Are you sure you've got the changes applied (and updated the script on the server)? This is certainly working for me - even tested with multi-page figure (PDF export)
PDF on the right:
However, I just tried TIFF export and got an error, so I can't test that just now...
Ok, happy to see that it works well on your side !
I'm running the tests on docker. I just run grunt build
in docker terminal and until now, it works pretty well. Is that possible the script also needs to be updated on the server side ? (the one mounted on OMEROHOST $ docker run -ti -e OMEROHOST=YOUR_HOST -p 4080:4080 figure-devel
)
Yes, the script will need to be uploaded to the server.
If it's a remote server, you'll need to be an Admin on the server, then you can use the webclient to upload or replace the script. You'll see the "Upload Script" option in the scripts menu. You'll need to choose the /omero/figure_scripts/
folder so the script replaces the existing one.
Ok, now it works correctly ! Thanks !
Having got my TIFF export working (see https://github.com/ome/omero-figure/pull/523), I found that I needed to shift them left a bit (see comment above) to get the TIFF to match the app:
Add the option to put labels to the right-vertical of the image