Code Monkey home page Code Monkey logo

ttoz's Introduction

TtoZ

DOI

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.

distributions

Here we show the image histograms (from mricron) for:

  1. the original t-stat map with 484 degrees of freedom,
  2. a z-score map produced with AFNI's 3dcalc (3dcalc -a tstat.nii.gz -expr 'fitt_t2z (a,484)' -prefix afni_zstat.nii -float),
  3. a z-score map our original effort using scipy.stats that did not split into +/- values, and
  4. a z-score map produced with TtoZ (Hughett's method that splits at 0 into two sets first).
  1. 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.

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.

Installation

 pip install git+https://github.com/vsoch/TtoZ.git

or from pypi:

pip install TtoZ

Usage

  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.

Example

 TtoZ --t_stat_map=t_stat_map.nii.gz --dof=484 --output_nii=z_score_map.nii

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.