{"id":13689076,"url":"https://github.com/vsoch/TtoZ","last_synced_at":"2025-05-01T23:32:01.221Z","repository":{"id":28708483,"uuid":"32229052","full_name":"vsoch/TtoZ","owner":"vsoch","description":"Convert T score brain statistical map to Z score map","archived":false,"fork":false,"pushed_at":"2024-01-25T14:21:15.000Z","size":4502,"stargazers_count":17,"open_issues_count":2,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-07T12:54:32.518Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vsoch.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":"2015-03-14T19:47:51.000Z","updated_at":"2024-01-05T15:50:04.000Z","dependencies_parsed_at":"2024-06-12T20:47:07.491Z","dependency_job_id":null,"html_url":"https://github.com/vsoch/TtoZ","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsoch%2FTtoZ","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsoch%2FTtoZ/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsoch%2FTtoZ/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsoch%2FTtoZ/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vsoch","download_url":"https://codeload.github.com/vsoch/TtoZ/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224282108,"owners_count":17285771,"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-08-02T15:01:32.917Z","updated_at":"2024-11-12T13:30:43.749Z","avatar_url":"https://github.com/vsoch.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# TtoZ\n\n[![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.32508.svg)](http://dx.doi.org/10.5281/zenodo.32508)\n\nTtoZ is a python implementation of Hughett's t-to-z tranform for whole brain statistical maps. \n\nFor background about the problem, see [Hughett's paper](doc/JStats_Hughett.pdf). For a detailed example of the problem pertaining to whole brain statistical maps, see [this ipython notebook](http://nbviewer.ipython.org/github/vsoch/TtoZ/blob/master/doc/t_to_z_procedure.ipynb). For a more concise summary of the particular problems addressed by Hughett's algorithm, as compared to traditional procedures using scipy see [this ipython notebook](http://nbviewer.ipython.org/github/vsoch/TtoZ/blob/master/doc/TtoZ_method_comparison.ipynb).\n\n[![distributions](doc/histograms.png)](https://raw.githubusercontent.com/vsoch/TtoZ/master/doc/histograms.png)  \n\nHere we show the image histograms (from mricron) for: \n\n 1. [the original t-stat map](example/tfMRI_LANGUAGE_STORY.nii_tstat1.nii.gz) with 484 degrees of freedom, \n 2. a [z-score map](example/zstat_afni.nii) produced with AFNI's 3dcalc (`3dcalc -a tstat.nii.gz -expr 'fitt_t2z (a,484)' -prefix afni_zstat.nii -float`), \n 3. a [z-score map](example/zstat_nosplit.nii) [our original effort](http://nbviewer.ipython.org/github/vsoch/TtoZ/blob/master/doc/t_to_z_procedure.ipynb#Converting-from-P-Values-to-Z-Scores) using scipy.stats that did not split into +/- values, and \n 4. a [z-score map](example/zstat_ttz.nii) produced with TtoZ (Hughett's method that splits at 0 into two sets first). \n\n2) and 3) have truncation of the distributions.  For both 3) and 4) it was also necessary to convert p-values exactly == 1 to 0.999999, as a value of exactly 1 will be converted to inf when converted to the standard normal score.\n\nNote that the y-axis scales are slightly different, most noticably for the second image, 3dcalc, which extends to a density of 2.0 due to the number of zeros that are replaced to prevent error. \n\n# Installation\n\n     pip install git+https://github.com/vsoch/TtoZ.git\n\n\nor from pypi:\n\n    pip install TtoZ\n\n\n# Usage\n\n      usage: TtoZ [-h] --t_stat_map T_STAT_MAP --dof DOF [--output_nii OUTPUT_NII]\n\n      Convert a whole brain T score map to a Z score map without loss of precision\n      for strongly positive and negative values.\n\n      optional arguments:\n       -h, --help            show this help message and exit\n        --t_stat_map T_STAT_MAP\n                              T-score statistical map in the form of a 3D NIFTI file\n                              (.nii or .nii.gz).\n        --dof DOF             Degrees of freedom (eg. for a two-sample T-test:\n                              number of subjects in group - 2)\n        --output_nii OUTPUT_NII\n                              The name for the output Z-Score Map.\n\n\n# Example\n\n     TtoZ --t_stat_map=t_stat_map.nii.gz --dof=484 --output_nii=z_score_map.nii\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvsoch%2FTtoZ","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvsoch%2FTtoZ","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvsoch%2FTtoZ/lists"}