NIPY logo

Site Navigation

NIPY Community

Table Of Contents

Next topic

algorithms.diagnostics.timediff

This Page

algorithms.diagnostics.screens

Module: algorithms.diagnostics.screens

Diagnostic 4d image screen

Functions

nipy.algorithms.diagnostics.screens.screen(img4d, ncomp=10)

Diagnostic screen for 4d FMRI image

Includes PCA, tsdiffana and mean, std, min, max images.

Parameters :

img4d : Image

4d image file

ncomp : int, optional

number of component images to return. Default is 10

Returns :

screen : dict

with keys:

  • mean : mean image (all summaries are over last dimension)
  • std : standard deviation image
  • max : image of max
  • min : min
  • pca : 4D image of PCA component images
  • pca_res : dict of results from PCA
  • ts_res : dict of results from tsdiffana

Examples

>>> import nipy as ni
>>> from nipy.testing import funcfile
>>> img = ni.load_image(funcfile)
>>> screen_res = screen(img)
>>> screen_res['mean'].ndim
3
>>> screen_res['pca'].ndim
4
nipy.algorithms.diagnostics.screens.write_screen_res(res, out_path, out_root, out_img_ext='.nii', pcnt_var_thresh=0.10000000000000001)

Write results from screen to disk as images

Parameters :

res : dict

output from screen function

out_path : str

directory to which to write output images

out_root : str

part of filename between image-specific prefix and image-specific extension to use for writing images

out_img_ext : str, optional

extension (identifying image type) to which to write volume images. Default is ‘.nii’

pcnt_var_thresh : float, optional

threshold below which we do not plot percent variance explained by components; default is 0.1. This removes the long tail from percent variance plots.

Returns :

None :