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

Add Dataset_ID param to export script #296

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions omero_figure/scripts/omero/figure_scripts/Figure_To_Pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2005,12 +2005,19 @@ def save_page(self, page=None):

# Try to get a Dataset
dataset = None
for panel in self.figure_json['panels']:
parent = self.conn.getObject('Image', panel['imageId']).getParent()
if parent is not None and parent.OMERO_CLASS == 'Dataset':
if parent.canLink():
dataset = parent
break

dataset_id = self.script_params.get('Dataset_ID')
if dataset_id:
self.conn.SERVICE_OPTS.setOmeroGroup(-1)
dataset = self.conn.getObject("Dataset", dataset_id)
else:
for panel in self.figure_json['panels']:
parent = self.conn.getObject('Image',
panel['imageId']).getParent()
if parent is not None and parent.OMERO_CLASS == 'Dataset':
if parent.canLink():
dataset = parent
break

# Need to specify group for new image
group_id = self.conn.getEventContext().groupId
Expand Down Expand Up @@ -2097,7 +2104,10 @@ def run_script():
description="Name of the Pdf Figure"),

scripts.String("Figure_URI",
description="URL to the Figure")
description="URL to the Figure"),

scripts.Long("Dataset_ID",
description="Dataset to add the new Image")
)

try:
Expand Down