{"id":18785308,"url":"https://github.com/jpdefrutos/ddmr","last_synced_at":"2025-04-13T12:33:53.383Z","repository":{"id":82946556,"uuid":"334159854","full_name":"jpdefrutos/DDMR","owner":"jpdefrutos","description":"3D image registration training framework using adaptive loss weighting and synthetic data generation","archived":false,"fork":false,"pushed_at":"2024-05-21T13:39:47.000Z","size":423,"stargazers_count":7,"open_issues_count":4,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-22T06:14:34.245Z","etag":null,"topics":["adaptive-loss","ct","ddmr","deep-learning","image-registration","mri","synthetic-data-generation","tensorflow","voxelmorph"],"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/jpdefrutos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-01-29T13:53:12.000Z","updated_at":"2024-05-22T06:14:34.246Z","dependencies_parsed_at":"2023-04-12T17:47:52.699Z","dependency_job_id":"f28877c3-a4e5-4d45-bb51-a9ca5197390b","html_url":"https://github.com/jpdefrutos/DDMR","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpdefrutos%2FDDMR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpdefrutos%2FDDMR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpdefrutos%2FDDMR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpdefrutos%2FDDMR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpdefrutos","download_url":"https://codeload.github.com/jpdefrutos/DDMR/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223588797,"owners_count":17169883,"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":["adaptive-loss","ct","ddmr","deep-learning","image-registration","mri","synthetic-data-generation","tensorflow","voxelmorph"],"created_at":"2024-11-07T20:46:15.616Z","updated_at":"2024-11-07T20:46:16.246Z","avatar_url":"https://github.com/jpdefrutos.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\ntitle: 'DDMR: Deep Deformation Map Registration of CT/MRIs'\ncolorFrom: indigo\ncolorTo: indigo\nsdk: docker\napp_port: 7860\nemoji: 🧠\npinned: false\nlicense: mit\napp_file: demo/app.py\n---\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/30429725/204778476-4d24c659-9287-48b8-b616-92016ffcf4f6.svg\" alt=\"drawing\" width=\"600\"\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n\u003ch1 align=\"center\"\u003eDDMR: Deep Deformation Map Registration\u003c/h1\u003e\n\u003ch3 align=\"center\"\u003eLearning deep abdominal CT registration through adaptive loss weighting and synthetic data generation\u003c/h3\u003e\n\n[![license](https://img.shields.io/github/license/DAVFoundation/captain-n3m0.svg?style=flat-square)](https://github.com/DAVFoundation/captain-n3m0/blob/master/LICENSE)\n[![CI/CD](https://github.com/jpdefrutos/DDMR/actions/workflows/deploy.yml/badge.svg)](https://github.com/jpdefrutos/DDMR/actions/workflows/deploy.yml)\n[![Paper](https://zenodo.org/badge/DOI/10.1371/journal.pone.0282110.svg)](https://doi.org/10.1371/journal.pone.0282110)\n\u003ca target=\"_blank\" href=\"https://huggingface.co/spaces/andreped/DDMR\"\u003e\u003cimg src=\"https://img.shields.io/badge/🤗%20Hugging%20Face-Spaces-yellow.svg\"\u003e\u003c/a\u003e\n\n\n**DDMR** was developed by SINTEF Health Research. The corresponding manuscript describing the framework has been published in [PLOS ONE](https://journals.plos.org/plosone/) and the manuscript is openly available [here](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0282110).\n\n\u003c/div\u003e\n\n## 💻 Getting started\n\n1. Setup virtual environment:\n```\nvirtualenv -ppython3 venv --clear\nsource venv/bin/activate\n```\n\n2. Install requirements:\n```\npip install git+https://github.com/jpdefrutos/DDMR\n```\n\n## 🤖 How to use\nUse the following CLI command to register images\n```\nddmr --fixed path/to/fixed_image.nii.gz --moving path/to/moving_image.nii.gz --outputdir path/to/output/dir -a \u003canatomy\u003e --model \u003cmodel\u003e --gpu \u003cgpu-number\u003e --original-resolution\n```\nwhere:\n* anatomy: is the type of anatomy you want to register: B (brain) or L (liver)\n* model: is the model you want to use:\n    + BL-N (baseline with NCC)\n    + BL-NS (baseline with NCC and SSIM)\n    + SG-ND (segmentation guided with NCC and DSC)\n    + SG-NSD (segmentation guided with NCC, SSIM, and DSC)\n    + UW-NSD (uncertainty weighted with NCC, SSIM, and DSC)\n    + UW-NSDH (uncertainty weighted with NCC, SSIM, DSC, and HD).\n* gpu: is the GPU number you want to the model to run on, if you have multiple and want to use only one GPU\n* original-resolution: (flag) whether to upsample the registered image to the fixed image resolution (disabled if the flag is not present)\n\nUse ```ddmr --help``` to see additional options like using precomputed segmentations to crop the images to the desired ROI, or debugging.\n\n## 🤗 Demo  \u003ca target=\"_blank\" href=\"https://huggingface.co/spaces/andreped/DDMR\"\u003e\u003cimg src=\"https://img.shields.io/badge/🤗%20Hugging%20Face-Spaces-yellow.svg\"\u003e\u003c/a\u003e\n\nA live demo to easily test the best performing pretrained models was developed in Gradio and is deployed on `Hugging Face`.\n\nTo access the live demo, click on the `Hugging Face` badge above. Below is a snapshot of the current state of the demo app.\n\n\u003cimg width=\"1800\" alt=\"Screenshot 2023-10-22 at 14 42 49\" src=\"https://github.com/jpdefrutos/DDMR/assets/29090665/ceb8797d-1a06-4929-994c-0838e1261e32\"\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\n\n### Development\u003c/summary\u003e\n\nTo develop the Gradio app locally, you can use either Python or Docker.\n\n#### Python\n\nYou can run the app locally by:\n\n```\npython demo/app.py --cwd ./ --share 0\n```\n\nThen open `http://127.0.0.1:7860` in your favourite internet browser to view the demo.\n\n#### Docker\n\nAlternatively, you can use docker:\n\n```\ndocker build -t ddmr .\ndocker run -it -p 7860:7860 ddmr\n```\n\nThen open `http://127.0.0.1:7860` in your favourite internet browser to view the demo.\n\n\u003c/details\u003e\n\n## 🏋️‍♂️ Training\n\nUse the \"MultiTrain\" scripts to launch the trainings, providing the neccesary parameters. Those in the COMET folder accepts a `.ini` configuration file (see `COMET/train_config_files/` for example configurations).\n\nFor instance:\n```\npython TrainingScripts/Train_3d.py\n```\n\n## 🔍 Evaluate\n\nUse Evaluate_network to test the trained models. On the Brain folder, use `Evaluate_network__test_fixed.py` instead.\n\nFor instance:\n```\npython EvaluationScripts/evaluation.py\n```\n\n## ✨ How to cite\nPlease, consider citing our paper, if you find the work useful:\n\u003cpre\u003e\n@article{perezdefrutos2022ddmr,\n    title = {Learning deep abdominal CT registration through adaptive loss weighting and synthetic data generation},\n    author = {Pérez de Frutos, Javier AND Pedersen, André AND Pelanis, Egidijus AND Bouget, David AND Survarachakan, Shanmugapriya AND Langø, Thomas AND Elle, Ole-Jakob AND Lindseth, Frank},\n    journal = {PLOS ONE},\n    publisher = {Public Library of Science},\n    year = {2023},\n    month = {02},\n    volume = {18},\n    doi = {10.1371/journal.pone.0282110},\n    url = {https://doi.org/10.1371/journal.pone.0282110},\n    pages = {1-14},\n    number = {2}\n}\n\u003c/pre\u003e\n\n## ⭐ Acknowledgements\nThis project is based on [VoxelMorph](https://github.com/voxelmorph/voxelmorph) library, and its related publication:\n\u003cpre\u003e\n@article{balakrishnan2019voxelmorph,\n    title={VoxelMorph: A Learning Framework for Deformable Medical Image Registration}, \n    author={Balakrishnan, Guha and Zhao, Amy and Sabuncu, Mert R. and Guttag, John and Dalca, Adrian V.},\n    journal={IEEE Transactions on Medical Imaging}, \n    year={2019},\n    volume={38},\n    number={8},\n    pages={1788-1800},\n    doi={10.1109/TMI.2019.2897538}\n}\n\u003c/pre\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpdefrutos%2Fddmr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpdefrutos%2Fddmr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpdefrutos%2Fddmr/lists"}