MIPAR Medical Image Processor & Repository Implementation Overview

Slide Note
Embed
Share

"Explore the MIPAR Medical Image Processor and Repository project by Olabanjo Olusola from Lagos State University. Learn about software skills requirements, the benefits of using PHP, uploading and downloading from the Open Access Repository (OAR), and more. Discover why PHP is a preferred choice for web programming and how OAR simplifies data sharing. Get insights into uploading images to MIPAR and OAR using customized XML code. Dive into the features and functionalities of this innovative project."


Uploaded on Oct 05, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. MIPAR MIPAR Medical Image Processor and Medical Image Processor and Repository (Implementation) Repository (Implementation) Olabanjo Olusola Lagos State University - Nigeria (olusola.olabanjo@lasu.edu.ng) WACREN e-Research Hackfest Lagos (Nigeria) This project has received funding from the European Union s Horizon 2020 research and innovation programme under grant agreement n 654237

  2. Overview Overview Software Skills Requirement Why PHP? Uploading to OAR Downloading from OAR Submitting a job, image proccessing Monitoring / Retrieving Output of a job 2

  3. Software Requirements Software Requirements Web programming PHP OAR Open Access Repository MySQL Scripting FutureGateway REST API 3

  4. Why PHP? Why PHP? Free, open source and redistributable Fast Less expensive hosting and maintainable Database compliant E.g. MySQL Interfaceable with other resources using API Comes with Wamp, Xamp or Lamp Easy local Hosting Wamp Shipped with Apache, MySQL, etc 4

  5. Open Access Repository Open Access Repository No need to re-invent the wheel If your data can be opened to the public, use OAR Requires Registration - free

  6. Uploading to MIPAR / OAR Uploading to MIPAR / OAR You will be taught OAR in this You will be taught OAR in this Hackfest Hackfest For MIPAR, upload is done in two stages using a customized XML code Stage 1: Images are uploaded to MIPAR server via the interface Stage 2: The URL generated in stage 1 is used to pass the image to OAR OAR This XML code uses shell_exec the sake of this project, curl shell_exec() () function or curl curl is conveniently preferred. curl command. But for XML ajaxHttp Image Upload Server Storage OAR 6

  7. XML Sample Code for Upload XML Sample Code for Upload $xml = '<?xml version="1.0" encoding="UTF $xml = '<?xml version="1.0" encoding="UTF- -8"?> <collection xmlns="http://www.loc.gov/MARC21/slim"> <collection xmlns="http://www.loc.gov/MARC21/slim"> <record xmlns="http://www.loc.gov/MARC21/slim"> <record xmlns="http://www.loc.gov/MARC21/slim"> <datafield tag="024" ind1="7" ind2=" "> <datafield tag="024" ind1="7" ind2=" "> <subfield code="a">10.15169/sci <subfield code="a">10.15169/sci- -gaia <subfield code="2">DOI</subfield> <subfield code="2">DOI</subfield> </datafield> </datafield> <datafield tag="260" ind1=" " ind2=" "> <datafield tag="260" ind1=" " ind2=" "> <subfield code="c">'.$ <subfield code="c">'.$dated dated.'</subfield> </datafield> </datafield> <datafield tag="100" ind1=" " ind2=" "> <datafield tag="100" ind1=" " ind2=" "> <subfield code="a"> <subfield code="a">MIPAR Project MIPAR Project</subfield> </datafield> </datafield> <datafield tag="245" ind1=" " ind2=" "> <datafield tag="245" ind1=" " ind2=" "> <subfield code="a">'.$ <subfield code="a">'.$uni uni.'</subfield> </datafield> </datafield> <datafield tag="520" ind1=" " ind2=" "> <datafield tag="520" ind1=" " ind2=" "> <subfield code="a">This is an image of the MIPAR Project.</subfield> <subfield code="a">This is an image of the MIPAR Project.</subfield> </datafield> </datafield> <datafield tag="540" ind1=" " ind2=" "> <datafield tag="540" ind1=" " ind2=" "> <subfield code="a">cc <subfield code="a">cc- -by by- -nc nc- -nd</subfield> nd</subfield> </datafield> </datafield> <datafield tag="536" ind1=" " ind2=" "> <datafield tag="536" ind1=" " ind2=" "> <subfield code="c">MIPAR Project</subfield> <subfield code="c">MIPAR Project</subfield> </datafield> </datafield> <datafield tag="653" ind1="1" ind2=" "> <datafield tag="653" ind1="1" ind2=" "> <subfield code="a">'.$ <subfield code="a">'.$type type.'</subfield> .'</subfield> </ </datafield datafield> > 8"?> gaia:'.$ :'.$time time.'</subfield> .'</subfield> .'</subfield> </subfield> .'</subfield> For the XML code for MIPAR, see GITHUB https://github.com/bsegun/MIPAR/bsegun/MIPAR 7

  8. Upload XML Code Continues Upload XML Code Continues < <datafield datafield tag="653" ind1="1" ind2=" "> tag="653" ind1="1" ind2=" "> <subfield code="a">'.$anatomy.'</subfield> <subfield code="a">'.$anatomy.'</subfield> </ </datafield datafield> > <datafield tag="FFT" ind1="" ind2=" "> <datafield tag="FFT" ind1="" ind2=" "> <subfield code="a">https://mipar.sci <subfield code="a">https://mipar.sci- -gaia.eu/donation/'.$user_id.'/'.$imgname.'</subfield> gaia.eu/donation/'.$user_id.'/'.$imgname.'</subfield> </datafield> </datafield> <datafield xmlns="" tag="980" ind1=" " ind2=" "> <datafield xmlns="" tag="980" ind1=" " ind2=" "> <subfield code="a">IMAGESMIPAR</subfield> <subfield code="a">IMAGESMIPAR</subfield> </datafield> </datafield> <datafield xmlns="" tag="041" ind1=" " ind2=" "> <datafield xmlns="" tag="041" ind1=" " ind2=" "> <subfield code="a">eng</subfield> <subfield code="a">eng</subfield> </datafield> </datafield> <datafield xmlns="" tag="042" ind1=" " ind2=" "> <datafield xmlns="" tag="042" ind1=" " ind2=" "> <subfield code="a">Researchers</subfield> <subfield code="a">Researchers</subfield> </datafield> </datafield> <datafield xmlns="" tag="043" ind1=" " ind2=" "> <datafield xmlns="" tag="043" ind1=" " ind2=" "> <subfield code="a">Image</subfield> <subfield code="a">Image</subfield> </datafield> </datafield> </record> </record> </collection> </collection> '; '; For the XML code for MIPAR, see GITHUB https://github.com/bsegun/MIPAR/bsegun/MIPAR 8

  9. Downloading from MIPAR / OAR Downloading from MIPAR / OAR Downloading is done on MIPAR interface, connected to OAR Stage 1: User select the type of image and anatomy Stage 2: OAR is searched and all images that met the selection is displayed on MIPAR Note: The user does not see OAR Images are searched automatically using the unique ID allocated to images during uploads An XML file is returned containing the URL of OAR Images pointing to the actual image found. The user does not see/need the unique ID $ $url url= =https gaia gaia: :< <uniqueid uniqueid>of=xm https: ://oar //oar. .sci >of=xm sci- -gaia gaia. .eu/search?p=doi eu/search?p=doi: :10 10. .15169 15169/sci /sci- - 9

  10. XML Sample Code for Downloads XML Sample Code for Downloads <collection> <collection> <record> <record> < <controlfield controlfield tag=" < <controlfield controlfield tag=" < <datafield datafield tag=" <subfield <subfield code=" <subfield code="a">10.15169/sci <subfield code="a">10.15169/sci- -gaia: </ </datafield datafield> > < <datafield datafield tag=" tag="260 260" " ind ind1 1=" <subfield <subfield code="c"> code="c">2016 2016- -09 < <datafield datafield tag=" tag="520 520" " ind ind1 1=" <subfield <subfield code="a">This code="a">This is is an < <datafield datafield tag=" tag="540 540" " nd nd</subfield></ </subfield></datafield datafield> > < <datafield datafield tag=" tag="653 code="a">MRI</subfield></ code="a">MRI</subfield></datafield < <datafield datafield tag=" tag="653 code="a">Brain</subfield></ code="a">Brain</subfield></datafield < <datafield datafield tag=" tag="856 code="s"> code="s">2751433 2751433</subfield><subfield </subfield><subfield gaia gaia. .eu/record/ eu/record/283 283/files/betta /files/betta001 tag="001 tag="005 tag="024 024" " ind code="2 2">DOI</subfield> ">DOI</subfield> 001"> 005"> ind1 1=" ">283 283</ ">20160913115359 20160913115359. .0 0</ ="7 7" " ind ind2 2=" </controlfield controlfield> > </controlfield controlfield> > =" "> "> gaia:1473751368.68 1473751368.68</subfield> </subfield> =" " " ind 09- -13 =" " " ind an image image of ind ind1 1=" =" ind2 2=" 13</subfield></ </subfield></datafield ind2 2=" =" "> "> of the the MIPAR " " ind ind2 2=" =" "> "> datafield> > MIPAR project</subfield></ project</subfield></datafield =" "><subfield "><subfield datafield> > code="a">cc code="a">cc- -by by- -nc nc- - 653" " ind ind1 1=" ="1 1" " ind ind2 2=" =" "><subfield "><subfield datafield> > 653" " datafield> > 856" " ind ind1 1=" ="1 1" " ind ind2 2=" =" "><subfield "><subfield ind ind1 1=" ="4 4" " ind ind2 2=" code="u"> code="u">http =" "><subfield "><subfield http: ://oar //oar. .sci sci- - 001. .zip zip</subfield></datafield> </subfield></datafield> For the XML code for MIPAR, see GITHUB https://github.com/bsegun/MIPAR/bsegun/MIPAR 10

  11. Image Processing / Jobs Submission Image Processing / Jobs Submission The focus here is to process Image Processing The image processing codes are written in c++ code and shell scripts, saved on MIPAR server All that is required is to submit a job Job here implies notifying the server which c++ code to call and what to do with it 11

  12. Image Processing / Jobs Submission Image Processing / Jobs Submission The user selects the type of process and upload the image to process Then a job ID is automatically generated using json code The job ID is then sent to MIPAR server, together with the image to process MIPAR process the image using the c++ code and the shell scripts MIPAR then returns the output to the user by providing the URL of the output, via MIPAR interface 12

  13. Json Json Code for Job Submission Code for Job Submission Stage 1: Prepare a Stage 1: Prepare a json json file to initialize task and get a task ID file to initialize task and get a task ID $json = '{ "application": <application ID for pilot script>", "description":"Brain Extraction", "input_files": [{ "name":"'.<filename>.'" }], "output_files": [{ "name": <output name>" }] } '; For the json code for job submission, see GITHUB https://github.com/bsegun/MIPAR/bsegun/MIPAR 13

  14. Json Json Code for Job Submission Code for Job Submission Stage 2 Stage 2: The json code is parsed to the server through the curl command http://151.97.41.48/v1.0/tasks?user='.<username>; will return status 200 onsuccess and as a result, a taskid is generated. 14

  15. Json Json Code for Job Submission Code for Job Submission An array of file parameters is passed through CURL using the given URL $POST_DATA = array( $POST_DATA = array( 'file[]' => new 'file[]' => new \ \CurlFile < <fileName fileName>) >) ); ); CurlFile( (realpath realpath($ ($file_path_str file_path_str), 'application/zip', ), 'application/zip', $ $url_path_str url_path_str = 'http://151.97.41.48/v1.0/tasks/' . < = 'http://151.97.41.48/v1.0/tasks/' . <taskid '/ '/input?user input?user='.<username>; ='.<username>; taskid>. >. On success, we can say an image has successfully been submitted for On success, we can say an image has successfully been submitted for extraction. extraction. 15

  16. Retrieving Job Output Retrieving Job Output A successfully submitted job has either of the 4 status Submitted Submitted, Waiting Waiting, Running Running, Done Done. A successfully completed / done job will return a JSON file contain URL pointing to the output as well as other metadata. The output is then downloaded to our disk storage where it stays for download for the next 48hrs after which it is automatically deleted. $url = 'http://151.97.41.48/v1.0/tasks/'.<taskid>; 16

  17. Federated Logging for MIPAR Federated Logging for MIPAR MIPAR used Federated Identity for authentication / authorization This is to allow users from IDPOpen to access the MIPAR portal using the same account. MIPAR user directory was protected using Shibboleth to allow federated login. 17

  18. Federated Federated Login Login Code Code $username = $_SERVER["REMOTE_USER"]; $name = getName(); 18

  19. Federated Logging Code Federated Logging Code function getName() { if (array_key_exists("displayName", $_SERVER)) { return implode(" ", explode(";", $_SERVER["displayName"])); } else if (array_key_exists("cn", $_SERVER)) { return implode(" ", explode(";", $_SERVER["cn"])); } else if (array_key_exists("givenName", $_SERVER) && array_key_exists("sn", $_SERVER)) { return implode(" ", explode(";", $_SERVER["givenName"])) . " " . implode(" ", explode(";",$_SERVER["sn"])); }else{ return "Unknown"; }} 19

  20. Appreciations Appreciations A big appreciation to the co-funders - SCI-GAIA, INDIGO-DATACLOUD AND ENEL We appreciate Eko-Konnect and WACREN for the opportunity to attend and for this meeting 1.Roberto Barbera, sci-gaia 2.Bruce Becker, sci-gaia 3.Owen Ivoha, Eko-Konnect 4.Omo Oaiya, WACREN 5.Mario Torrisi 20

  21. Thank you! sci-gaia.eu info@sci-gaia.eu

Related