Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export to omero #210

Merged
merged 12 commits into from
Jun 13, 2017
Merged

Export to omero #210

merged 12 commits into from
Jun 13, 2017

Conversation

will-moore
Copy link
Member

@will-moore will-moore commented Apr 27, 2017

Allows export of a figure as new OMERO Images (one per page).

This is a preliminary part of https://trello.com/c/qqpED5kE/129-export-as-movie

To test:

  • Choose "New OMERO Image" from the export options drop-down menu
  • Export the figure... when done, should see a link to the new Image.
  • Image will be named according to figure name and have the figure legend as it's description (if legend exists).
  • Multi-page figures should create an Image per page, named ..._page_01 etc.

NB: I'll need to upload the figure export script before this is tested...

@jburel
Copy link
Member

jburel commented Apr 28, 2017

omero_api_IScript_ice.py", line 909, in runScript
    return _M_omero.api.IScript._op_runScript.invoke(self, ((scriptID, inputs, waitSecs), _ctx))
ValidationException: exception ::omero::ValidationException
{
    serverStackTrace = 
    serverExceptionClass = 
    message = Invalid parameters:
VALUE LIST for "Export_Option": OMERO not in ['PDF', 'PDF_IMAGES', 'TIFF', 'TIFF_IMAGES']

@will-moore
Copy link
Member Author

Ah, yes, I needed to update the script on eel.... Done now, and seems to be working.

@snoopycrimecop snoopycrimecop mentioned this pull request Apr 30, 2017
@jburel
Copy link
Member

jburel commented May 1, 2017

Did some initial tests the creation works fine
I have not tested yet the multi-pages situations,
Image from plate will always be orphaned, we should probably rethink that section

@will-moore
Copy link
Member Author

@jburel If none of the images from the figure are in a Dataset then new image will simply be an orphan. I'm not sure there's a better way to handle that, but an orphaned image is not a major problem. I mostly assume people aren't using HCS images to make figures, and also the 'export to OMERO' is mostly meant for showing your figure alongside the images in a Dataset, so HCS users can't do that anyway.

will-moore added 3 commits May 2, 2017 16:00
Since we only use numpy for OMERO export, this means the script can
still be used for other export if we happen to be missing numpy
@will-moore
Copy link
Member Author

Improved new image description. If the figure is saved, description will have a link to the figure, so you can find the figure from the image.

@@ -60,6 +60,11 @@
logger.error("Reportlab not installed. See"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message should be reviewed since we no longer recommend to install from pypi

@@ -60,6 +60,11 @@
logger.error("Reportlab not installed. See"
" https://pypi.python.org/pypi/reportlab/")

try:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unlike since it is a dependency we already have for omero

self.save_figure()

# PDF will get created in this group
if group_id is None:
group_id = self.conn.getEventContext().groupId
self.conn.SERVICE_OPTS.setOmeroGroup(group_id)

file_ann = self.create_file_annotation(image_ids)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no real to assign file_ann can do return self.create_file_annotation(image_ids)


def save_page(self, page=None):
"""
Save the current PIL image page as a new OMERO images and start a new
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new OMERO image no s

@@ -1616,7 +1697,8 @@ def run_script():
"""

export_options = [rstring('PDF'), rstring('PDF_IMAGES'),
rstring('TIFF'), rstring('TIFF_IMAGES')]
rstring('TIFF'), rstring('TIFF_IMAGES'),
rstring('OMERO')]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to be explicit in the option i.e. OMERO_IMAGES

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the others PDF_IMAGES/ TIFF_IMAGES means create a zip file with the Figure as a PDF/TIFF and include all the rendered images in the figure as TIFFs (so you have a record of how the figure was created on export and you can use them to tweak the figure later). We don't need to support the equivalent option for export to OMERO.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was just to be more explicit

@@ -758,6 +759,11 @@ <h4 class="modal-title">Open</h4>
<span class="glyphicon glyphicon-ok" style="color:#333; visibility:hidden"></span>
TIFF with images</a>
</li>
<li><a href="#" data-export-option="to OMERO"
title="Export as an Image in OMERO">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image(s)

@jburel
Copy link
Member

jburel commented May 3, 2017

Export of figure with multiple pages generates as expected the corresponding number of images in OMERO

The color of the button during the generation is modified, but having a spinner will be clearer in general since the generation could take some time

@will-moore
Copy link
Member Author

@jburel Addressed those suggestions.

@will-moore
Copy link
Member Author

I can look into showing a spinner during export, but I wouldn't want it to hold up this PR since it's not related to this PR and this PR is conflicting with #211

@jburel
Copy link
Member

jburel commented May 3, 2017

I will not do that in that PR. I will add a card on the priorities board

@will-moore
Copy link
Member Author

Ah, I just pushed a commit for that:
screen shot 2017-05-03 at 12 36 52

@jburel
Copy link
Member

jburel commented May 3, 2017

looks better thanks

@will-moore
Copy link
Member Author

@jburel - If this can be merged I can fix and re-open #211, thanks.

@jburel jburel merged commit cb9299f into ome:master Jun 13, 2017
@jburel jburel added this to the 3.1.0 milestone Jun 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants