Table Of Contents

Previous topic

neurospin.utils.roi

Next topic

neurospin.utils.smoothing

This Page

neurospin.utils.simul_2d_multisubject_fmri_dataset

Module: neurospin.utils.simul_2d_multisubject_fmri_dataset

This module conatins a function to produce a dataset which simulates a collection of 2D images This dataset is saved as a 3D nifti image (each slice being a subject) and a 3D array

example of use: make_surrogate_array(nbsubj=1,fid=”/tmp/toto.dat”,verbose=1)

todo: rewrite it as a class

Author : Bertrand Thirion, 2008-2009

Functions

nipy.neurospin.utils.simul_2d_multisubject_fmri_dataset.cone(shape, ij, pos, ampli, width)
Define a cone of the proposed grid
make_surrogate_array(nbsubj=10, dimx=30, dimy=30, sk=1.0, noise_level=1.0, pos=array([[ 6, 7],
[10, 10],
[15, 10]]), ampli=array([3, 4, 4]), spatial_jitter=1.0, signal_jitter=1.0, width=5.0, out_text_file=None, out_niftifile=None, verbose=False)

Create surrogate (simulated) 2D activation data with spatial noise.

Parameters:

nbsubj: integer, optionnal :

The number of subjects, ie the number of different maps generated.

dimx: integer, optionnal :

The x size of the array returned.

dimy: integer :

The y size of the array returned.

sk: float, optionnal :

Amount of spatial noise smoothness.

noise_level: float, optionnal :

Amplitude of the spatial noise. amplitude=noise_level)

pos: 2D ndarray of integers, optionnal :

x, y positions of the various simulated activations.

ampli: 1D ndarray of floats, optionnal :

Respective amplitude of each activation

spatial_jitter: float, optionnal :

Random spatial jitter added to the position of each activation, in pixel.

signal_jitter: float, optionnal :

Random amplitude fluctuation for each activation, added to the amplitude specified by ampli

width: float or ndarray, optionnal :

Width of the activations

out_text_file: string or None, optionnal :

If not None, the resulting array is saved as a text file with the given file name

out_niftifile: string or None, optionnal :

If not None, the resulting is saved as a nifti file with the given file name.

verbose: boolean, optionnal :

If verbose is true, the data for the last subject is plotted as a 2D image.

Returns:

dataset: 3D ndarray :

The surrogate activation map, with dimensions (nbsubj, dimx, dimy)