{"id":15491781,"url":"https://github.com/tristanpenman/lung-segmentation-tool","last_synced_at":"2026-01-28T18:33:12.787Z","repository":{"id":74416225,"uuid":"157954190","full_name":"tristanpenman/lung-segmentation-tool","owner":"tristanpenman","description":"Python scripts to perform lung segmentation on a CT scan and view the output using OpenGL","archived":false,"fork":false,"pushed_at":"2025-09-21T01:52:35.000Z","size":25566,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-21T03:24:23.294Z","etag":null,"topics":["dicom","image-processing","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/tristanpenman.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-11-17T05:34:16.000Z","updated_at":"2025-09-21T01:52:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"4949bb4b-d7ea-46e0-aef4-12b08606077b","html_url":"https://github.com/tristanpenman/lung-segmentation-tool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tristanpenman/lung-segmentation-tool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tristanpenman%2Flung-segmentation-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tristanpenman%2Flung-segmentation-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tristanpenman%2Flung-segmentation-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tristanpenman%2Flung-segmentation-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tristanpenman","download_url":"https://codeload.github.com/tristanpenman/lung-segmentation-tool/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tristanpenman%2Flung-segmentation-tool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28849160,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T15:15:36.453Z","status":"ssl_error","status_checked_at":"2026-01-28T15:15:13.020Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["dicom","image-processing","python"],"created_at":"2024-10-02T07:56:22.009Z","updated_at":"2026-01-28T18:33:12.781Z","avatar_url":"https://github.com/tristanpenman.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lung Segmentation Tool\n\nThis package contains scripts to perform lung segmentation on a CT scan. These have been combined into a simple visualisation tool that can be used to inspect CT scans using OpenGL.\n\nThe segmentation functions are based on a traditional CV-based algorithm, described in the [Kaggle DSB 2017 Tutorial](https://www.kaggle.com/c/data-science-bowl-2017#tutorial).\n\n## Requirements\n\nThis package requires Python 3.12.\n\nAll critical dependencies are locked to compatible versions in `requirements.txt`.\n\nTo get the source code and install dependencies:\n\n    git clone git@github.com:tristanpenman/lung-segmentation-tool.git\n    cd lung-segmentation-tool\n    pip install -r requirements.txt\n\nYou may also choose to install the package on your system:\n\n    pip install .\n\n## Usage\n\nIncluded in this package is a visualisation tool called `lung-segmentation-tool`. This can be used to load CT scans in MetaImage (.mhd) and DICOM (.dcm) format.\n\nYou can launch the visualisation tool from the command line, using options that configure the step size of the generated mesh:\n\n    lung-segmentation-tool \\\n        --scan-path ${PATH_TO_SCAN} \\\n        --step-size 1\n\nChoosing a larger step size will shorten the time taken to generate a mesh, but will result in lower detail.\n\nIf you have cloned the git repository but not installed the package, you should still be able to run the visualisation tool locally:\n\n    ./bin/lung-segmentation-tool \\\n        --scan-path ${PATH_TO_SCAN} \\\n        --step-size 1\n\n## Example\n\nAn example CT scan is included in the [data](./data) directory. CT scans tend to be quite large, so this scan has been compressed using `xz`. Before using this scan, you'll need to decompress it:\n\n    cd data\n    tar xvf 1.3.6.1.4.1.14519.5.2.1.6279.6001.219909753224298157409438012179.tar.xz\n    cd ..\n\nNow you can run it through the visualisation tool:\n\n    ./bin/lung-segmentation-tool \\\n        --scan-path data/1.3.6.1.4.1.14519.5.2.1.6279.6001.219909753224298157409438012179.mhd \\\n        --step-size 1\n\n## Screenshot\n\nSuccessfully loading and segmenting a CT scan will look something like this:\n\n![Screenshot](screenshot.png)\n\nOn the left is the segmentation view. You can rotate and zoom using the left-mouse button and scroll-wheel.\n\nOn the top-right is the transverse view.\n\nBelow that are two views. On the left is the sagittal view, and on the right is the frontal view.\n\nClicking and dragging on the transverse view will change slices shown on the views below it.\n\n## Known issues and limitations\n\nInteraction with the transverse, sagittal and frontal views is limited.\n\nCurrently only the transverse view will respond to mouse events, changing the slices in the sagittal and frontal views to be centered at the location that is selected.\n\nThe sagittal and frontal views do not respond to mouse events at all.\n\nMy aim is to add planes to the 3D segmented view, to show exactly which location in the scan has been selected via the 2D views.\n\n## License\n\nThis code is licensed under the MIT License.\n\nSee the LICENSE file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftristanpenman%2Flung-segmentation-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftristanpenman%2Flung-segmentation-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftristanpenman%2Flung-segmentation-tool/lists"}