{"id":24583861,"url":"https://github.com/neuronets/pialnn-forked","last_synced_at":"2026-01-03T20:33:35.461Z","repository":{"id":199749543,"uuid":"701499403","full_name":"neuronets/pialnn-forked","owner":"neuronets","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-14T22:00:59.000Z","size":65478,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-24T04:53:45.731Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neuronets.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-06T19:13:24.000Z","updated_at":"2024-01-30T15:16:43.000Z","dependencies_parsed_at":"2025-01-24T05:03:52.942Z","dependency_job_id":null,"html_url":"https://github.com/neuronets/pialnn-forked","commit_stats":null,"previous_names":["hvgazula/pialnn-forked","neuronets/pialnn-forked"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuronets%2Fpialnn-forked","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuronets%2Fpialnn-forked/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuronets%2Fpialnn-forked/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuronets%2Fpialnn-forked/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neuronets","download_url":"https://codeload.github.com/neuronets/pialnn-forked/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244076116,"owners_count":20394058,"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":"2025-01-24T04:53:54.618Z","updated_at":"2026-01-03T20:33:35.401Z","avatar_url":"https://github.com/neuronets.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# PialNN: A Fast Deep Learning Framework for Cortical Pial Surface Reconstruction\n\n\u003c!-- ![](figure/visual.png) --\u003e\n\u003cp align=\"center\"\u003e\u003cimg src=\"figure/visual.png\" width=\"600\" \u003e\u003c/p\u003e\n\nThis repository contains the PyTorch implementation of the paper:\n\n**PialNN: A Fast Deep Learning Framework for Cortical Pial Surface Reconstruction** [[Paper]](https://arxiv.org/abs/2109.03693)\n\nQiang Ma, Emma C. Robinson, Bernhard Kainz, Daniel Rueckert, Amir Alansary\n\nThe 4th Workshop on Machine Learning in Clinical Neuroimaging ([MLCN2021](https://mlcnws.com/))\n\n**Abstract.** Pial Neural Network (PialNN) is a 3D deep learning framework for pial surface reconstruction. It is trained end-to-end to deform a given initial white matter surface to a target pial surface by a sequence of learned deformation blocks. PialNN is fast and memory-efficient, which allows reconstructing a pial surface mesh with **150k** vertices within **1s** runtime.\n\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"figure/architecture.png\" width=\"500\" \u003e\u003c/p\u003e\n\n\u003c!-- ![](figure/architecture.png =200x100) --\u003e\n\n\n## Get Started\n\n### Dependencies\n\nThe following packages are required for running PialNN:\n- Python \u003e= 3.6\n- [PyTorch](https://pytorch.org/) \u003e= 1.5.0\n- [PyTorch3D](https://github.com/facebookresearch/pytorch3d/blob/main/INSTALL.md) = 0.4.0\n- [PyTorch Geometric (PyG)](https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html)\n- [Trimesh](https://trimsh.org/install.html)\n- [NiBabel](https://nipy.org/nibabel/installation.html)\n- SciPy, NumPy\n\n\n### Dataset\nThe following files are required for training and testing. The data should be generated by [FreeSurfer](https://surfer.nmr.mgh.harvard.edu/) or in the same format.\n```\n./data/train/SUBJECT_NAME/mri/orig.mgz\n./data/train/SUBJECT_NAME/surf/lh.white\n./data/train/SUBJECT_NAME/surf/lh.pial\n./data/train/SUBJECT_NAME/surf/rh.white\n./data/train/SUBJECT_NAME/surf/rh.pial\n```\n```orig.mgz``` is the brain MRI volume. ```lh.white/rh.white``` are the meshes of initial white matter cortical surfaces of left/right cerebrum hemispheres. ```lh.pial/rh.pial``` are ground truth pial surface meshes. An example data is provided in ```./data/test/example/```.\n\nWe use [HCP Young Adult Dataset](https://www.humanconnectome.org/study/hcp-young-adult/data-releases) for training and testing in this paper.\n\n\n\n### Running Demos\n\nYou can run the following codes to predict a pial surface based on the provided example data.\n```\ngit clone https://github.com/m-qiang/PialNN.git\npython eval.py --data_path=./data/test/ --hemisphere=lh --save_mesh_eval=True\n```\nThe output pial surface mesh will be saved in ```./ckpts/eval/``` as .obj format.\n\n\n## Training\n\nDownload your training data to ```./data/train/``` and run\n```\npython train.py --data_path=./data/train/ --hemisphere=lh\n```\nFor more information about the training configuration, please see\n```\npython train.py --help\n```\nThe pretrained models of PialNN for both left and right hemispheres are provided:\n```\n./ckpts/model/pialnn_pretrained_lh.pt\n./ckpts/model/pialnn_pretrained_rh.pt\n```\n\n## Evaluation\nDownload your testing data to ```./data/test/``` and run\n```\npython eval.py --data_path=./data/test/ --hemisphere=lh\n```\n\nThree distance-based matrics will be computed: Chamfer Distance (CD), Average Absolute Distance (AD), and Hausdorff Distance (HD).\n\nFor the purpose of debugging or validation, the evaluation result of the provided example data in ```./data/test/example/``` should be\n\n- CD=0.39, AD=0.20, HD=0.40\n\n\n\u003c!-- ## Citation\nIf you use this code for your research, please consider citing our paper:\n```\n{@inprocessding}\n``` --\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuronets%2Fpialnn-forked","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneuronets%2Fpialnn-forked","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuronets%2Fpialnn-forked/lists"}