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

Calling the LORIS API from LORIS-MRI Python #1147

Open
maximemulder opened this issue Aug 13, 2024 · 0 comments
Open

Calling the LORIS API from LORIS-MRI Python #1147

maximemulder opened this issue Aug 13, 2024 · 0 comments

Comments

@maximemulder
Copy link
Contributor

maximemulder commented Aug 13, 2024

As per our last imaging meeting, I am working on a batch_uploads_imageuploader.pl alternative script that uses the DICOM upload API to run the imaging pipeline through the server process manager. The aim of this new script is to provide better traceability for pipeline runs by registering who runs a pipeline, and keeping better logs.

For this design to work, the Python script needs to call the LORIS API, which is something that does not currently exist in LORIS-MRI (neither in Python nor Perl). There are several problems to solve to implement this feature:

How can LORIS-MRI know the LORIS URL ? There does not seem to be a way to get this information currently. The apparently preferred option would be to store this URL in the database_config.py file. I discussed storing this information in the configuration database table but @driusan thinks it is a bad idea: it has been done in the past and was removed (not reliable, often overlooked when doing syncs...).

How to design the API for calling the API ? I don't think this pattern will be used many times in the near future, so scalability is not really needed. Still, there are many possible designs here and I'd like to do something somewhat clean. The API to call the API needs to answer the following questions:

  • How to get the API token (from credentials ?) ?
  • How to build, store and pass API-related information (LORIS URL, API token...) ?
  • How to handle API versions ?
  • How to call specific routes (generic function for all routes, specific functions for specific routes ?)

I have some ideas but would like to have a design meeting to discuss all of this. As a side note, since there seem to be many changes happening simultaneously that touch the Python configuration (LORIS URL, Python called from Perl, another PR I have in stock), I'd also like to discuss a breaking improvement of the Python configuration.

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

No branches or pull requests

1 participant