@@ -43,14 +43,14 @@ def test_parcel_intra_from_3d_image():
43
43
shape = (10 , 10 , 10 )
44
44
n_parcel , nn , mu = 10 , 6 , 1.
45
45
mask_image = Nifti1Image (np .ones (shape ), np .eye (4 ))
46
- temp_dir = InTemporaryDirectory ()
47
- with temp_dir :
46
+ dir_context = InTemporaryDirectory ()
47
+ with dir_context :
48
48
surrogate_3d_dataset (mask = mask_image , out_image_file = 'image.nii' )
49
49
50
50
#run the algo
51
51
for method in ['ward' , 'kmeans' , 'gkm' ]:
52
52
osp = fixed_parcellation (mask_image , ['image.nii' ], n_parcel , nn ,
53
- method , temp_dir .name , mu )
53
+ method , dir_context .name , mu )
54
54
result = 'parcel_%s.nii' % method
55
55
assert exists (result )
56
56
assert_equal (osp .k , n_parcel )
@@ -65,15 +65,15 @@ def test_parcel_intra_from_3d_images_list():
65
65
method = 'ward'
66
66
mask_image = Nifti1Image (np .ones (shape ), np .eye (4 ))
67
67
68
- temp_dir = InTemporaryDirectory ()
69
- with temp_dir :
68
+ dir_context = InTemporaryDirectory ()
69
+ with dir_context :
70
70
data_image = ['image_%d.nii' % i for i in range (5 )]
71
71
for datim in data_image :
72
72
surrogate_3d_dataset (mask = mask_image , out_image_file = datim )
73
73
74
74
#run the algo
75
75
osp = fixed_parcellation (mask_image , data_image , n_parcel , nn ,
76
- method , temp_dir .name , mu )
76
+ method , dir_context .name , mu )
77
77
assert exists ('parcel_%s.nii' % method )
78
78
assert_equal (osp .k , n_parcel )
79
79
@@ -86,12 +86,12 @@ def test_parcel_intra_from_4d_image():
86
86
n_parcel , nn , mu = 10 , 6 , 1.
87
87
method = 'ward'
88
88
mask_image = Nifti1Image (np .ones (shape ), np .eye (4 ))
89
- temp_dir = InTemporaryDirectory ()
90
- with temp_dir :
89
+ dir_context = InTemporaryDirectory ()
90
+ with dir_context :
91
91
surrogate_3d_dataset (n_subj = 10 , mask = mask_image ,
92
92
out_image_file = 'image.nii' )
93
93
osp = fixed_parcellation (mask_image , ['image.nii' ], n_parcel , nn ,
94
- method , temp_dir .name , mu )
94
+ method , dir_context .name , mu )
95
95
assert exists ('parcel_%s.nii' % method )
96
96
assert_equal (osp .k , n_parcel )
97
97
0 commit comments