{"id":18142417,"url":"https://github.com/benoitberanger/openrecon-template","last_synced_at":"2025-10-28T00:31:49.719Z","repository":{"id":249851512,"uuid":"832628859","full_name":"benoitberanger/openrecon-template","owner":"benoitberanger","description":"Template to use as starting point for OpenRecon applications.","archived":false,"fork":false,"pushed_at":"2025-01-22T12:25:11.000Z","size":71,"stargazers_count":1,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T12:31:20.682Z","etag":null,"topics":["ismrmrd","mrd","openrecon","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benoitberanger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-23T12:03:11.000Z","updated_at":"2025-01-22T12:25:14.000Z","dependencies_parsed_at":"2024-11-01T18:26:05.494Z","dependency_job_id":"15fe9848-bba0-4da0-9cde-b7b0c43947c8","html_url":"https://github.com/benoitberanger/openrecon-template","commit_stats":null,"previous_names":["benoitberanger/openrecon-template"],"tags_count":1,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitberanger%2Fopenrecon-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitberanger%2Fopenrecon-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitberanger%2Fopenrecon-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitberanger%2Fopenrecon-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benoitberanger","download_url":"https://codeload.github.com/benoitberanger/openrecon-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238575284,"owners_count":19494812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ismrmrd","mrd","openrecon","python"],"created_at":"2024-11-01T18:21:56.236Z","updated_at":"2025-10-28T00:31:44.442Z","avatar_url":"https://github.com/benoitberanger.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# openrecon-template\n\nThis repo is a template made to help building OpenRecon apps.\n\nThe puropose is to build the `i2i` demo provided by Siemens for the SDK on https://www.magnetom.net, using a single build script, without any modification.\n\nFor later developments, the first step of a new OpenRecon project it to create a new repo based on this `openrecon-template`, then modify the `app` dir (or any other dir), to finnaly call the building process.\n\n\n# Requirement\n\n A Python environment manager is **strongly** recomanded.\n\n- Python\n    - `python 3.10` minimum : 100% sure  \n    OR\n    - `python 3.12` : don't know\n- Additional (non-builtin) modules\n    - `jsonschema` : a simple `pip install jsonschema` should work\n\n\n# Build\n\nSimply run the `build.py` script :\n```bash\npython build.py\n```\nIt will build the `demo-i2i` directory.\nAll output files will be in the `build` directory\n\nThe script is quite verbose, helping troubleshooting at each step of the process in case of error.\n\nTo build a specific dir, such as the `app` dir :\n```bash\npython build.py --dirname app\n```\n\n# Outputs\nAll output files will be placed in a _build_ subdir.\nThe finale file, ready for the upload on the magnet will be the _.zip_ file.\n\nBuilding the `demo-i2i` dir (default option) you should have this :\n```bash\n$ ls -1 build\ni2i_json_ui.json\ni2i.py\nOpenReconSchema_1.1.0.json\nOpenRecon_SiemensHealthineersAG_PythonMRDi2i_V1.0.0.Dockerfile\nOpenRecon_SiemensHealthineersAG_PythonMRDi2i_V1.0.0.pdf\nOpenRecon_SiemensHealthineersAG_PythonMRDi2i_V1.0.0.tar\nOpenRecon_SiemensHealthineersAG_PythonMRDi2i_V1.0.0.zip\n```\n\nBuilding the `app` dir : \n```bash\n$ ls -1 build\ni2i-save-original-images_json_ui.json\ni2i-save-original-images.py\nOpenRecon_openrecon-template_i2i-save-original-images_V1.0.0.Dockerfile\nOpenRecon_openrecon-template_i2i-save-original-images_V1.0.0.pdf\nOpenRecon_openrecon-template_i2i-save-original-images_V1.0.0.tar\nOpenRecon_openrecon-template_i2i-save-original-images_V1.0.0.zip\nOpenReconSchema_1.1.0.json\n```\n\n# App\n\n## Objective : templatization \u0026 separation of environments\n\nThe `app` dir will contained the versioned code.  \nThe `python-ismrmrd-server` dir is **NOT** versioned.  \nTo _add_ your app files files in the `python-ismrmrd-server`, create symbolic links.\n\n## How to test locally the reconstruction\n\n### Prepare the python environment \n\nOpen a Terminal in the repository directory, then :\n\n```bash\n# setup Conda environment\nconda create --name openrecon-template\nconda activate openrecon-template\nconda install python=3.12\nconda install ipython\npip install ismrmrd\npip install pydicom\npip install pynetdicom\n\n# create .py file symbolic link in `python-ismrmrd-server`\n# this is how the MRD client/server will behave : all files/modules in the same dir\ncd python-ismrmrd-server\nln -s ../app/i2i-save-original-images.py .\n```\nRepeat the `ln -s` for the files you need.\n\n\n\n### Convert your test dicom into MRD\n\nPut DICOMs in a dir then convert to MRD (.h5 file)\n```bash\npython python-ismrmrd-server/dicom2mrd.py -o \u003cpath_to_data\u003e/in/test.h5 \u003cpath_to_data\u003e/in/\n```\n\n### Start the reco\n\nIn a terminal or an IDE like VSCode, start the `main.py`. This will help a lot debugging.\n\nSend data using `client.py`\n```bash\npython python-ismrmrd-server/client.py -o \u003cpath_to_data\u003e/out/reco_test.h5 -c \u003cmyrecon\u003e \u003cpath_to_data\u003e/in/test.h5 \n```\n\n### Convert the output of your reco to DICOM for visualization\n```bash\npython python-ismrmrd-server/mrd2dicom.py -o \u003cpath_to_data\u003e/out/ \u003cpath_to_data\u003e/out/reco_test.h5\n```\n\nUse any DICOM viewer to check visually.\n\n### All-in-one\n\nStart the `main.py` in VSCode.\nIt can be in Debug mode, with breakpoints.\nThen : \n\n```bash\n#!/bin/bash\n\n## path management\nIN_DIR=data/in\nOUT_DIR=data/out\nDATASET_NAME=test\n\n## clean out dir\nrm $OUT_DIR/*dcm $OUT_DIR/*h5\n\n## send h5 MRD dataset using th client -\u003e the server will process them\nTARGET_CONFIG=i2i-save-original-images\npython python-ismrmrd-server/client.py -o $OUT_DIR/OR_$DATASET_NAME.h5 -c $TARGET_CONFIG $IN_DIR/$DATASET_NAME.h5\n\n# convert fresh OR processed MRD dataset into DICOM for visu\npython python-ismrmrd-server/mrd2dicom.py -o $OUT_DIR/ $OUT_DIR/OR_$DATASET_NAME.h5\n\n# use your favorite DICOM viewer\nmrview $OUT_DIR/ -mode 2\n```\n\n## VSCode tips\n\nI found that, when you modify the `\u003creco\u003e.py` file when the `main.py` is running, the code is not updated =\u003e you need to restart the server (started by the main.py) so the `\u003creco\u003e.py` is reloaded.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitberanger%2Fopenrecon-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenoitberanger%2Fopenrecon-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitberanger%2Fopenrecon-template/lists"}