TtoZ is a python implementation of Hughett's t-to-z tranform for whole brain statistical maps.
For background about the problem, see Hughett's paper. For a detailed example of the problem pertaining to whole brain statistical maps, see this ipython notebook. 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.
Here we show the image histograms (from mricron) for:
3dcalc -a tstat.nii.gz -expr 'fitt_t2z (a,484)' -prefix afni_zstat.nii -float
),Note 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.
pip install git+https://github.com/vsoch/TtoZ.git
or from pypi:
pip install TtoZ
usage: TtoZ [-h] --t_stat_map T_STAT_MAP --dof DOF [--output_nii OUTPUT_NII]
Convert a whole brain T score map to a Z score map without loss of precision
for strongly positive and negative values.
optional arguments:
-h, --help show this help message and exit
--t_stat_map T_STAT_MAP
T-score statistical map in the form of a 3D NIFTI file
(.nii or .nii.gz).
--dof DOF Degrees of freedom (eg. for a two-sample T-test:
number of subjects in group - 2)
--output_nii OUTPUT_NII
The name for the output Z-Score Map.
TtoZ --t_stat_map=t_stat_map.nii.gz --dof=484 --output_nii=z_score_map.nii