{"id":18725319,"url":"https://github.com/sintefmath/implicit-recon","last_synced_at":"2026-02-26T17:50:30.008Z","repository":{"id":54254618,"uuid":"337037550","full_name":"sintefmath/implicit-recon","owner":"sintefmath","description":"Reconstruction of shapes using implicit representations","archived":false,"fork":false,"pushed_at":"2021-03-04T11:50:30.000Z","size":74,"stargazers_count":4,"open_issues_count":3,"forks_count":3,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-06-16T22:02:21.292Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sintefmath.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}},"created_at":"2021-02-08T10:25:11.000Z","updated_at":"2024-03-07T13:02:20.000Z","dependencies_parsed_at":"2022-08-13T10:10:25.526Z","dependency_job_id":null,"html_url":"https://github.com/sintefmath/implicit-recon","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sintefmath/implicit-recon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sintefmath%2Fimplicit-recon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sintefmath%2Fimplicit-recon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sintefmath%2Fimplicit-recon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sintefmath%2Fimplicit-recon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sintefmath","download_url":"https://codeload.github.com/sintefmath/implicit-recon/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sintefmath%2Fimplicit-recon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29867144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T16:38:37.846Z","status":"ssl_error","status_checked_at":"2026-02-26T16:37:58.932Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":[],"created_at":"2024-11-07T14:09:46.296Z","updated_at":"2026-02-26T17:50:29.974Z","avatar_url":"https://github.com/sintefmath.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# implicit-recon\n\n## Introduction\nThe implicit-recon repository contains functionality for the reconstruction of shapes using\nimplicit representations from images or voxel grids with intensity values.\nThis repository is structured as follows:\n\n```\nimplicit-recon\n├── example_output\n│   ├── logs\n│   ├── predictions_chd_ct\n│   ├── saved_models\n│   └── stl\n├── example_runs\n└── src\n    ├── metrics\n    ├── models\n    └── utilities\n```\n\n## Requirements\nThe code has been tested for Python 3.8. It has the following dependencies:\n`numpy`, `pillow`, `scikit-image`, `tqdm`, `torch`, `torchvision`, \n`torchsummary`, `tensorboard`, `numpy-stl`\n\nThese can be installed (in your virtual environment) by running\n\n    pip install -r requirements.txt\n\n__Note:__ If you experience compatibility issues with `torch` and `torchvision`, remove them from the `requirements.txt` and follow the instructions on https://pytorch.org/.\n\n## Creating the data\nThe Congenital Heart Disease (CHD) CT data-set was kindly made available to us by \nDr. Xiaowei Xu from the Department of Computer Science and Engineering,\nUniversity of Notre Dame.\n\nSuppose the root of the above directory tree is `BASE_DATA_DIR=\"CHD_orig/\"`.\nRunning, from the directory `src/utilities/`, the command\n```\npython compute_distance_fields.py --input_dir $BASE_DATA_DIR\n```\nsplits the CHD CT data-set into training, validation and test data (and optionally\ncomputes distance fields) with input images in `images_1_slice_512` and\nsegmented binary masks (labels) in `BP_masks_512`. This results in the \nfollowing directory tree, rooted at the CHD_orig directory:\n\n```\nCHD_orig\n└── output_512\n    ├── test\n    │   ├── BP_masks_512\n    │   └── images_1_slice_512\n    ├── train\n    │   ├── BP_masks_512\n    │   └── images_1_slice_512\n    └── val\n        ├── BP_masks_512\n        └── images_1_slice_512\n```\n\n\n## Scripts\nThe `example_runs` directory contains several Python scripts that can either \nbe called from the command line (straight from their `example_runs` \ndirectory), or imported in another Python script. Documentation for precise\nusage is obtained by running the script with the `--help` argument.\n* `train.py`: Train a VGGTrunc1, VGGTrunc2, or UNetImplicit neural network.\n* `infer.py`: Inference of a trained VGGTrunc1, VGGTrunc2, or UNetImplicit\n  neural network applied to image files in a directory.\n* `parameter_study.py`: Import functionality from `train.py` to train for \n  several UNetImplicit architectures with different network parameters.\n\nIn addition, the `src/utilities` directory contains:\n* `png_to_mesh.py`: Convert alphabetically ordered PNG files in a directory\n  into an STL file.\n\n\n## Example workflow\nSuppose our dataset is split following the directory tree\nshown above, for which the root of the above directory tree is\n`BASE_DATA_DIR=\"CHD_orig/\"` and its subdirectory is\n`SUB_DATA_DIR=\"output_512\"`. As above, input images are stored in the\nsubdirectory `IMAGE_DIR=\"images_1_slice_512\"`, while binary masks (labels)\nare stored in the subdirectory `MASK_DIR=\"BP_masks_512\"`. The base directory\nfor the output is the repository root `BASE_OUTPUT_DIR=\"implicit_recon\"`.\n\nLet's examine an example workflow for:\n* training a `NETWORK=\"UNetImplicit\"`,\n* storing and loading the model weights in `MODEL_FILE=\"../example_output/saved_models/weights_chd_ct.pth\"`\n* applying inference to the directory `IMAGE_INFERENCE_DIR=$BASE_DATA_DIR$SUB_DATA_DIR\"/test/images_1_slice_512\"`,\n* storing the inferred predictions in the directory `PRED_DIR=\"../example_output/predictions_chd_ct\"`, and\n* and converting to an STL file in `STL_DIR=\"../example_output/stl\"`. \n\nWith the above definitions, the following commands should then be run from the `example_runs` directory:\n\n```\n#!/bin/bash\npython train.py --base_data_dir $BASE_DATA_DIR --sub_data_dir $SUB_DATA_DIR --base_output_dir $BASE_OUTPUT_DIR \\\n            --image_dir $IMAGE_DIR --mask_dir $MASK_DIR --model_in $MODEL_FILE --model_out $MODEL_FILE \\\n            --network $NETWORK --n_epochs 10\npython infer.py --model_path $MODEL_FILE --image_paths $IMAGE_INFERENCE_DIR --output_path $PRED_DIR\npython ../src/utilities/png_to_mesh.py --init_slice 0 --final_slice 134 --aspect_ratio 2 \\\n   --in_path $PRED_DIR --out_path $STL_DIR --out_fname model_chd_ct.stl --out_res 0 0 0\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsintefmath%2Fimplicit-recon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsintefmath%2Fimplicit-recon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsintefmath%2Fimplicit-recon/lists"}