530fc4fcd459962531b150dc1a58310d81cd6f1f,examples/03_connectivity/plot_signal_extraction.py,,,#,28

Before Change


time_series = masker.fit_transform(fmri_filenames)
// Note how we did not specify confounds above. This is bad!

correlation_matrix = np.corrcoef(time_series.T)

// Mask the main diagonal for visualization:
np.fill_diagonal(correlation_matrix, 0)

After Change


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Compute and display a correlation matrix
from nilearn.connectome import ConnectivityMeasure
correlation_measure = ConnectivityMeasure(kind="correlation")
correlation_matrix = correlation_measure.fit_transform([time_series])[0]

// Plot the correlation matrix
import numpy as np
from matplotlib import pyplot as plt
plt.figure(figsize=(10, 10))
// Mask the main diagonal for visualization:
np.fill_diagonal(correlation_matrix, 0)

plt.imshow(correlation_matrix, interpolation="nearest", cmap="RdBu_r",
           vmax=0.8, vmin=-0.8)

// Add labels and adjust margins
x_ticks = plt.xticks(range(len(labels) - 1), labels[1:], rotation=90)
y_ticks = plt.yticks(range(len(labels) - 1), labels[1:])
plt.gca().yaxis.tick_right()
plt.subplots_adjust(left=.01, bottom=.3, top=.99, right=.62)


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Same thing without confounds, to stress the importance of confounds

time_series = masker.fit_transform(fmri_filenames)
// Note how we did not specify confounds above. This is bad!

correlation_matrix = correlation_measure.fit_transform([time_series])[0]

// Mask the main diagonal for visualization:
np.fill_diagonal(correlation_matrix, 0)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 9

Instances


Project Name: nilearn/nilearn
Commit Name: 530fc4fcd459962531b150dc1a58310d81cd6f1f
Time: 2016-08-07
Author: salmabougacha@hotmail.com
File Name: examples/03_connectivity/plot_signal_extraction.py
Class Name:
Method Name:


Project Name: nilearn/nilearn
Commit Name: 6e5083f80d4c6878a02d65f3b0f3431d534938ca
Time: 2016-06-09
Author: abraham.alexandre@gmail.com
File Name: examples/connectivity/plot_power_connectome.py
Class Name:
Method Name:


Project Name: nilearn/nilearn
Commit Name: 530fc4fcd459962531b150dc1a58310d81cd6f1f
Time: 2016-08-07
Author: salmabougacha@hotmail.com
File Name: examples/03_connectivity/plot_probabilistic_atlas_extraction.py
Class Name:
Method Name:


Project Name: nilearn/nilearn
Commit Name: 6ac381e9730a6ceb1807c346408513baae097789
Time: 2016-06-09
Author: abraham.alexandre@gmail.com
File Name: examples/connectivity/plot_power_connectome.py
Class Name:
Method Name: