{"id":17036768,"url":"https://github.com/bast/mri-extract-surfaces","last_synced_at":"2026-01-03T21:52:46.681Z","repository":{"id":198726891,"uuid":"701388139","full_name":"bast/MRI-extract-surfaces","owner":"bast","description":"Set of containerized scripts to extract mesh surfaces from a T1/T2-weighted MRI scans.","archived":false,"fork":false,"pushed_at":"2024-07-15T09:55:19.000Z","size":56,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-24T05:11:23.546Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"eupl-1.2","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bast.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-06T14:29:23.000Z","updated_at":"2024-09-16T08:31:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"a22cec12-977c-4acf-8dd8-5bb6ad43c306","html_url":"https://github.com/bast/MRI-extract-surfaces","commit_stats":null,"previous_names":["bast/ray"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bast%2FMRI-extract-surfaces","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bast%2FMRI-extract-surfaces/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bast%2FMRI-extract-surfaces/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bast%2FMRI-extract-surfaces/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bast","download_url":"https://codeload.github.com/bast/MRI-extract-surfaces/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244082293,"owners_count":20395242,"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":[],"created_at":"2024-10-14T08:51:54.379Z","updated_at":"2026-01-03T21:52:46.636Z","avatar_url":"https://github.com/bast.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MRI-extract-surfaces\n\nSet of containerized scripts to extract mesh surfaces from T1/T2-weighted [MRI\nscans](https://en.wikipedia.org/wiki/Magnetic_resonance_imaging).  Uses\n[SimNIBS](https://simnibs.github.io/simnibs/) under the hood, plus some smaller\nscripts.  The surfaces are then used in another project:\nhttps://github.com/bast/tms-location\n\n\n## Requirements\n\nYou need an installation of [Apptainer](https://apptainer.org/) (e.g. following\nthe [quick\ninstallation](https://apptainer.org/docs/user/latest/quick_start.html#quick-installation)).\nAlternatively, [SingularityCE](https://sylabs.io/singularity/) should also\nwork.\n\n\n## How to use it\n\nFirst download the container image (ending with *.sif) from here:\nhttps://github.com/bast/MRI-extract-surfaces/releases - then make the container image executable.\n\nHere is an example which uses the container with the `T1_ernie.nii.gz` example\ndata file:\n```bash\n$ ./extract-surfaces.sif ernie /home/user/ernie_data T1_ernie.nii.gz\n```\n\nThe above example reads `T1_ernie.nii.gz` and creates the directories\n`m2m_ernie` and `/home/user/ernie_data`.  On my computer the process takes\n30-60 minutes.  The folder `m2m_ernie` is created in the same directory as the\ncontainer image and contains many output files from\n[SimNIBS](https://simnibs.github.io/simnibs/).\n\nThe input-file does not have to be gzipped, you can also use a plain NIfTI file:\n```bash\n$ ./extract-surfaces.sif ernie /home/user/ernie_data T1_ernie.nii\n```\n\nIf you have a T2-weighted MRI scan as well, you can use both T1 and T2 data as input:\n```bash\n$ ./extract-surfaces.sif ernie /home/user/ernie_data T1.nii.gz T2.nii.gz\n```\n\nThe generated directory `/home/user/ernie_data` contains the following files:\n```\nernie_data/\n├── eeg-positions\n│   ├── easycap_BC_TMS64_X21.csv\n│   ├── easycap_BC_TMS64_X21.geo\n│   ├── EEG10-10_Cutini_2011.csv\n│   ├── EEG10-10_Cutini_2011.geo\n│   ├── EEG10-10_Neuroelectrics.csv\n│   ├── EEG10-10_Neuroelectrics.geo\n│   ├── EEG10-10_UI_Jurak_2007.csv\n│   ├── EEG10-10_UI_Jurak_2007.geo\n│   ├── EEG10-20_extended_SPM12.csv\n│   ├── EEG10-20_extended_SPM12.geo\n│   ├── EEG10-20_Okamoto_2004.csv\n│   ├── EEG10-20_Okamoto_2004.geo\n│   ├── Fiducials.csv\n│   └── Fiducials.geo\n├── m2m_data\n│   ├── data.msh\n│   ├── final_tissues.nii.gz\n│   ├── T1.nii.gz\n│   └── toMNI\n│       ├── Conform2MNI_nonl.nii.gz\n│       ├── final_tissues_MNI.nii.gz\n│       └── MNI2Conform_nonl.nii.gz\n├── meshes\n│   ├── 1001.txt\n│   ├── 1002.txt\n│   ├── 1003.txt\n│   ├── 1005.txt\n│   ├── 1006.txt\n│   ├── 1007.txt\n│   ├── 1008.txt\n│   ├── 1009.txt\n│   ├── 1010.txt\n│   └── outside-surface.txt\n└── VERSION\n```\n\n\n## Where to get an example input file\n\nYou can get the [example dataset](https://simnibs.github.io/simnibs/build/html/dataset.html) like this:\n```bash\n$ wget https://github.com/simnibs/example-dataset/releases/latest/download/simnibs4_examples.zip\n```\n\n\n## Please cite [SimNIBS](https://simnibs.github.io/simnibs/) if you use this container\n\n**I am not affiliated with SimNIBS** but this\ncontainer uses SimNIBS under the hood.\n\nWhen you publish results based on SimNIBS, please cite [Thielscher, A.,\nAntunes, A. and Saturnino, G.B. (2015), Field modeling for transcranial\nmagnetic stimulation: a useful tool to understand the physiological effects of\nTMS? IEEE EMBS 2015, Milano,\nItaly](http://dx.doi.org/10.1109/EMBC.2015.7318340).\n\n\u003e [!WARNING]\n\u003e SimNIBS is a research tool. Clinical usage is not supported or advised. In\n\u003e particular, SimNIBS was not tested to give accurate results in the presence\n\u003e of pathological condition. See also https://simnibs.github.io/simnibs/\n\n\n## About the container image\n\nTo build the image, I have used [this wonderful\nguide](https://github.com/singularityhub/singularity-deploy) as starting point\nand inspiration.\n\nI find it important that everybody can verify how the container image was\nbuilt. And you can! You can inspect the definition file and all scripts which\nare all part of this repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbast%2Fmri-extract-surfaces","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbast%2Fmri-extract-surfaces","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbast%2Fmri-extract-surfaces/lists"}