{"id":20215408,"url":"https://github.com/kitwaremedical/habet","last_synced_at":"2025-09-21T16:16:56.437Z","repository":{"id":62067639,"uuid":"555963881","full_name":"KitwareMedical/habet","owner":"KitwareMedical","description":"HArmonization BEnchmarking Tool ","archived":false,"fork":false,"pushed_at":"2023-02-14T04:14:21.000Z","size":100,"stargazers_count":3,"open_issues_count":19,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-24T13:04:25.979Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/KitwareMedical.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":"2022-10-22T18:51:31.000Z","updated_at":"2024-04-30T18:13:06.000Z","dependencies_parsed_at":"2024-11-14T12:35:37.336Z","dependency_job_id":null,"html_url":"https://github.com/KitwareMedical/habet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KitwareMedical%2Fhabet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KitwareMedical%2Fhabet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KitwareMedical%2Fhabet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KitwareMedical%2Fhabet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KitwareMedical","download_url":"https://codeload.github.com/KitwareMedical/habet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248233935,"owners_count":21069493,"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-11-14T06:22:02.864Z","updated_at":"2025-09-21T16:16:51.356Z","avatar_url":"https://github.com/KitwareMedical.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HABET\n\n## About\n\nThe HArmonization BEnchmarking Tool (HABET) streamlines the process of trying multiple different harmonization techniques and evaluating their performance through a simple command-line interface (CLI). Currently, the tool supports harmonization of 3D and 4D NIfTI images of any shape. Support for other file types will be added in the future.\n \nThe control flow diagram for HABET is shown below. HABET features two main components: harmonization (d) and and report generation (e).\n\n![cfd](harmonization_tool_diagram.svg)\n\n## Harmonization\n\nThe harmonization component allows users to easily try multiple different harmonization techniques on their data. The help string for the harmonization subcommand is given below.\n\n\n```\nusage: main.py harmonize [-h] [--mask_path MASK_PATH] --site_colname SITE_COLNAME -o OUTPUT_DIR --harmonization_methods {GlobalScaling,Combat} [{GlobalScaling,Combat} ...] --df_path DF_PATH\n                         [--covariate_cols COVARIATE_COLS [COVARIATE_COLS ...]]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --mask_path MASK_PATH\n                        Path to harmonization mask. Harmonization will only be applied to voxels with intensity value == 1.\n  --site_colname SITE_COLNAME\n                        name of the site variable column in the table at df_path\n  -o OUTPUT_DIR, --output_dir OUTPUT_DIR\n                        Root directory of the harmonized images. A subdirectory for each harmonization technique is created. Each of these subdirectories contains the harmonized images for that\n                        technique, named exactly the same as in input_dir\n  --harmonization_methods {GlobalScaling,Combat} [{GlobalScaling,Combat} ...]\n                        Root directory of the harmonized images. A subdirectory for each harmonization technique is created. Each of these subdirectories contains the harmonized images for that\n                        technique, named exactly the same as in input_dir\n  --df_path DF_PATH     Path to the table matching each image filepath to the corresponding site id. Also contains information on any other variables / covariates to include in the harmonization\n                        technique\n  --covariate_cols COVARIATE_COLS [COVARIATE_COLS ...]\n                        Other colnames of covariates to include. Note that columns with numerical values will be treated as continuous and columns with strings will be treated as categorical\n\n```\n\nAs a simple example, the below command will harmonize the white matter region in a group of images using ComBat:\n```\n$ habet/habet/main.py harmonize --mask_path \u003cwhite_matter_mask_path\u003e --site_colname \u003csite_colname\u003e -o \u003charmonized_dir\u003e --harmonization_methods Combat --df_path \u003cdf_path\u003e\n```\n\nHABET also features a simple API for adding custom harmonization techniques. This API is still in its early stages, but at a high level:\n1. Add a python file to the `habet/harmonization` directory, giving it the name of the harmonization method you'd like to add\n2. In this file, implement a python class that inherits from `HarmonizationMethod` and implements the `_harmonize()` method (see `combat.py` or `global_scaling.py` as examples).\n\n## Report Generation\nThe report generation of HABET summarizes the detected site-effects. The help string for the report generation subcommand is given below.\n\n```\nusage: main.py generate_report [-h] [--mask_path MASK_PATH] --site_colname SITE_COLNAME -o OUTPUT_DIR --im_path_to_site_id_df_path IM_PATH_TO_SITE_ID_DF_PATH [--anova_alpha ANOVA_ALPHA]\n                               [--t_test_alpha T_TEST_ALPHA] [--mtc] [--save_dfs]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --mask_path MASK_PATH\n                        Path to harmonization mask. Harmonization will only be applied to voxels with intensity value == 1.\n  --site_colname SITE_COLNAME\n                        name of the site variable column in the table at df_path\n  -o OUTPUT_DIR, --output_dir OUTPUT_DIR\n                        Root directory of the report files.\n  --im_path_to_site_id_df_path IM_PATH_TO_SITE_ID_DF_PATH\n                        Path to the table matching each image filepath to the corresponding site id\n  --anova_alpha ANOVA_ALPHA\n                        Significance level for the anova to be done at each voxel\n  --t_test_alpha T_TEST_ALPHA\n                        Significance level for the t-tests to be done at each voxel\n  --mtc                 Conduct Bonferroni multiple testing correction for the anovas and t-tests\n  --save_dfs            Save the anova and t-test tables as part of the report Note that these can get large in file size\n\n```\n\nFor example, to generate a report for the images harmonized using the command above, you could use the command below:\n```\n$ habet/habet/main.py generate_report --mask_path \u003cwhite_matter_mask_path\u003e --site_colname \u003csite_colname\u003e -o \u003creport_dir\u003e --im_path_to_site_id_df_path \u003charmonized_dir\u003e/Combat/image_to_site.csv\n```\n## References\nHABET was first introduced in the following paper, where it was used to harmonize fractional anisotropy (FA) images from the Adult Brain and Cognitive Development (ABCD) study.\n\n\u003e T. Osika, E. Ebrahim, M. Styner, M. Niethammer, T. Sawyer, A. Enquobahrie, ‘Harmonization Benchmarking Tool for Neuroimaging Datasets’. arXiv, 2022.\n\u003e\n\u003e [arXiv:2211.07869](https://arxiv.org/abs/2211.07869)\n\n## Acknowledgements\nThis work was supported in part by the National Institutes of Health under Award Number R42MH118845. The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Institutes of Health.\n\n## Disclaimer\n_:warning: This python module is in its early development stage. Its name, content, API, and behavior may change at any time. We mean it!_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitwaremedical%2Fhabet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkitwaremedical%2Fhabet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitwaremedical%2Fhabet/lists"}