a779bcd92e4978429799b3cacde20f5781e1ad3d,plot_haxby_searchlight.py,,,#,17

Before Change



// fmri_data is copied to break the reference to the original data
bold_img = nibabel.load(dataset_files.func)
fmri_data = np.asarray(bold_img.get_data()).copy()
affine = bold_img.get_affine().copy()
del bold_img

y, session = np.loadtxt(dataset_files.session_target).astype("int").T
conditions = np.recfromtxt(dataset_files.conditions_target)["f0"]

////// Preprocess data //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Build the mean image because we have no anatomical data
mean_img = fmri_data.mean(axis=-1)

////// Restrict to faces and houses ////////////////////////////////////////////////////////////////////////////////////////////
from nibabel import Nifti1Image
condition_mask = np.logical_or(conditions == "face", conditions == "house")
X = fmri_data[..., condition_mask]
y = y[condition_mask]
session = session[condition_mask]
conditions = conditions[condition_mask]
niimg = Nifti1Image(X, affine)

////// Loading step ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
from nisl.io import NiftiMasker

After Change


//   should be processed (we only keep the slice z = 26 and the back of the
//   brain to speed up computation)

mask_img = nibabel.load(dataset_files.mask)

// .astype() makes a copy.
process_mask = mask_img.get_data().astype(np.int)
process_mask[..., 38:] = 0
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: nilearn/nilearn
Commit Name: a779bcd92e4978429799b3cacde20f5781e1ad3d
Time: 2013-05-31
Author: philippe.gervais@inria.fr
File Name: plot_haxby_searchlight.py
Class Name:
Method Name:


Project Name: ellisdg/3DUnetCNN
Commit Name: a48b055a628bfa648a0b5a371838848e997440e2
Time: 2017-05-17
Author: david.ellis@unmc.edu
File Name: unet3d/normalize.py
Class Name:
Method Name: get_complete_foreground


Project Name: nilearn/nilearn
Commit Name: 02806a3dbb8250b6455ec63ac78348a08ba376e8
Time: 2012-10-02
Author: alexandre.abraham@cea.fr
File Name: plot_nifti_simple.py
Class Name:
Method Name: