Skip to content

Commit 5ef7218

Browse files
committed
Updated 'lif_to_stack' API endpoint to load and pass on more information
1 parent f6fd56d commit 5ef7218

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/murfey/server/api/clem.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,7 @@ def register_image_stack(
635635
def lif_to_stack(
636636
session_id: int, # Used by the decorator
637637
lif_file: Path,
638+
db: Session = murfey_db,
638639
):
639640
# Get command line entry point
640641
murfey_workflows = entry_points().select(
@@ -643,14 +644,26 @@ def lif_to_stack(
643644

644645
# Use entry point if found
645646
if len(murfey_workflows) == 1:
647+
648+
# Get instrument name from the database
649+
# This is needed in order to load the correct config file
650+
row: MurfeySession = db.exec(
651+
select(MurfeySession).where(MurfeySession.id == session_id)
652+
).one()
653+
instrument_name = row.instrument_name
654+
655+
# Pass arguments along to the correct workflow
646656
workflow: EntryPoint = list(murfey_workflows)[0]
647657
workflow.load()(
648658
# Match the arguments found in murfey.workflows.lif_to_stack
649659
file=lif_file,
650660
root_folder="images",
661+
session_id=session_id,
662+
instrument_name=instrument_name,
651663
messenger=_transport_object,
652664
)
653665
return True
666+
654667
# Raise error if Murfey workflow not found
655668
else:
656669
raise RuntimeError("The relevant Murfey workflow was not found")

0 commit comments

Comments
 (0)