{"id":25411385,"url":"https://github.com/gregspangenberg/armcortnet","last_synced_at":"2025-04-14T08:28:12.842Z","repository":{"id":277403226,"uuid":"931691323","full_name":"gregspangenberg/armcortnet","owner":"gregspangenberg","description":"Automatic segmentation of the scapula, humerus, and their cortical / trabecular subregions.","archived":false,"fork":false,"pushed_at":"2025-04-06T04:42:49.000Z","size":267,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T05:23:54.558Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pypi.org/project/armcortnet/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gregspangenberg.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":"2025-02-12T17:41:19.000Z","updated_at":"2025-04-06T04:42:53.000Z","dependencies_parsed_at":"2025-02-13T19:28:08.009Z","dependency_job_id":"d883d858-3785-4f05-923e-c10546164981","html_url":"https://github.com/gregspangenberg/armcortnet","commit_stats":null,"previous_names":["gregspangenberg/armcortnet"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregspangenberg%2Farmcortnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregspangenberg%2Farmcortnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregspangenberg%2Farmcortnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregspangenberg%2Farmcortnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gregspangenberg","download_url":"https://codeload.github.com/gregspangenberg/armcortnet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248845197,"owners_count":21170721,"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-02-16T10:17:38.486Z","updated_at":"2025-04-14T08:28:12.832Z","avatar_url":"https://github.com/gregspangenberg.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# *armcortnet*\n[![PyPI Latest Release](https://img.shields.io/pypi/v/armcortnet.svg)](https://pypi.org/project/armcortnet)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n\nArmcortnet provides automatic segmentation of the humerus and scapula from CT scans. The deep learning model is trained to also segment out the cortical and trabecular subregions from each bone as well.\n\n\nThe deep learning pipeple consists of using [armcrop](https://pypi.org/project/armcrop/) to crop to an oriented bounding box around each humerus or scapula in the image and then a neural network based traine from the nnUNet framework segments that cropped volume. The segmetnation is then transformed back to the original coordinate system, post-processed and finally saved as a .seg.nrrd file.\n\n## Installation\nPlease install pytorch first before installing armcortnet. You can learn about installing pytorch from the official website [here](https://pytorch.org/get-started/locally/).\n\nThen install armcortnet using pip:\n```bash\npip install armcortnet\n```\nFor faster oriented bounding box cropping you can replace onnxruntime with onnxruntime-gpu.\n\n## Usage\nTo generate a segmentation of the humerus or scapula from a CT volume, use the following:\n```python\nimport armcortnet\nimport SimpleITK as sitk\n\n# initialize the segmentation model\nmodel = armcortnet.Net(bone_type=\"scapula\")  # or \"humerus\"\n\n# perform segmentation prediction on a CT volume\npred_segmentations = model.predict(\n    vol_path=\"path/to/input/ct.nrrd\"\n)\n# output is a list of SimpleITK images, one for each bone_type detected in the CT\nfor i, pred_seg in enumerate(pred_segmentations):\n    # write each of the segmentations to the disk\n    sitk.WriteImage(pred_seg, f\"scapula-{i}.seg.nrrd\")\n\n```\nA mesh of the predicted bone can be generated using the following:\n```python\n# perform mesh prediction on a CT volume, returns list of vtkPolyData objects\npred_meshes = model.predict_poly(\n    vol_path=\"path/to/input/ct.nrrd\"\n)\n\n# iterate over each detected object\nfor i, cort_trab_polys in enumerate(pred_meshes):\n    # iterate over the cortical and trabecular meshes\n    for j, poly in enumerate(cort_trab_polys):\n        armcortnet.write_polydata(p, f\"scapula_{i}_{j}.ply\")\n```\n\n\n## Output Labels\n\nThe segmentation output contains the following labels:\n- 0: Background\n- 1: Other adjacent bones (\"i.e clavicle, radius, ulna, etc.\")\n- 2: Cortical region of bone of interest\n- 3: Trabecular region of bone of interest\n\nNote: label 1 is removed when post-processing is used\n\n## Models\nTrained models are automatically downloaded from HuggingFace Hub (`gregspangenberg/armcortnet`) on first use.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregspangenberg%2Farmcortnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgregspangenberg%2Farmcortnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregspangenberg%2Farmcortnet/lists"}