255c1bbfbccef1c96c1e102335752e962816e31f,nilearn/tests/test_parcellations.py,,test_parcellations_transform_single_nifti_image,#,104
Before Change
fmri_img = nibabel.Nifti1Image(data, affine=np.eye(4))
for method in ["kmeans", "ward", "complete", "average"]:
parcellator = Parcellations(method=method, n_parcels=parcels)
parcellator.fit(fmri_img)
// transform to signals
signals = parcellator.transform(fmri_img)
// Test if the signals extracted are of same shape as inputs
// Here, we take index 0 since we return list even for single subject
assert_equal(signals[0].shape, (fmri_img.shape[3], parcels))
def test_parcellations_transform_multi_nifti_images():
data = np.ones((10, 11, 12, 10))
data[6, 7, 8] = 2
data[9, 10, 11] = 3
After Change
fmri_img = nibabel.Nifti1Image(data, affine=np.eye(4))
if LooseVersion(sklearn.__version__) >= LooseVersion("0.15"):
for method in ["kmeans", "ward", "complete", "average"]:
parcellator = Parcellations(method=method, n_parcels=parcels)
parcellator.fit(fmri_img)
// transform to signals
signals = parcellator.transform(fmri_img)
// Test if the signals extracted are of same shape as inputs
// Here, we take index 0 since we return list even for single
// subject
assert_equal(signals[0].shape, (fmri_img.shape[3], parcels))
else:
parcellator2 = Parcellations(method="ward", n_parcels=parcels)
parcellator2.fit(fmri_img)
signals2 = parcellator.transform(fmri_img)
assert_equal(signals[0].shape, (fmri_img.shape[3], parcels))
def test_parcellations_transform_multi_nifti_images():
data = np.ones((10, 11, 12, 10))
data[6, 7, 8] = 2
data[9, 10, 11] = 3
In pattern: SUPERPATTERN
Frequency: 5
Non-data size: 10
Instances
Project Name: nilearn/nilearn
Commit Name: 255c1bbfbccef1c96c1e102335752e962816e31f
Time: 2018-03-08
Author: dkamalakarreddy@gmail.com
File Name: nilearn/tests/test_parcellations.py
Class Name:
Method Name: test_parcellations_transform_single_nifti_image
Project Name: nilearn/nilearn
Commit Name: 721264a465a95f26e449e358d69c72fa1dbf06eb
Time: 2018-03-08
Author: dkamalakarreddy@gmail.com
File Name: nilearn/tests/test_parcellations.py
Class Name:
Method Name: test_parcellations_fit_on_single_nifti_image
Project Name: nilearn/nilearn
Commit Name: 255c1bbfbccef1c96c1e102335752e962816e31f
Time: 2018-03-08
Author: dkamalakarreddy@gmail.com
File Name: nilearn/tests/test_parcellations.py
Class Name:
Method Name: test_parcellations_transform_multi_nifti_images
Project Name: nilearn/nilearn
Commit Name: 255c1bbfbccef1c96c1e102335752e962816e31f
Time: 2018-03-08
Author: dkamalakarreddy@gmail.com
File Name: nilearn/tests/test_parcellations.py
Class Name:
Method Name: test_parcellations_transform_with_multi_confounds_multi_images
Project Name: nilearn/nilearn
Commit Name: 255c1bbfbccef1c96c1e102335752e962816e31f
Time: 2018-03-08
Author: dkamalakarreddy@gmail.com
File Name: nilearn/tests/test_parcellations.py
Class Name:
Method Name: test_fit_transform