@@ -96,22 +96,29 @@ def check_conversion(cmd, pr_data, out_fname):
96
96
assert_true (np .allclose (data , pr_data ))
97
97
assert_true (np .allclose (img .header ['cal_min' ], data .min ()))
98
98
assert_true (np .allclose (img .header ['cal_max' ], data .max ()))
99
+ del img , data # for windows to be able to later delete the file
99
100
# Check minmax options
100
101
run_command (cmd + ['--minmax' , '1' , '2' ])
101
102
img = load (out_fname )
103
+ data = img .get_data ()
102
104
assert_true (np .allclose (data , pr_data ))
103
105
assert_true (np .allclose (img .header ['cal_min' ], 1 ))
104
106
assert_true (np .allclose (img .header ['cal_max' ], 2 ))
107
+ del img , data # for windows
105
108
run_command (cmd + ['--minmax' , 'parse' , '2' ])
106
109
img = load (out_fname )
110
+ data = img .get_data ()
107
111
assert_true (np .allclose (data , pr_data ))
108
112
assert_true (np .allclose (img .header ['cal_min' ], data .min ()))
109
113
assert_true (np .allclose (img .header ['cal_max' ], 2 ))
114
+ del img , data # for windows
110
115
run_command (cmd + ['--minmax' , '1' , 'parse' ])
111
116
img = load (out_fname )
117
+ data = img .get_data ()
112
118
assert_true (np .allclose (data , pr_data ))
113
119
assert_true (np .allclose (img .header ['cal_min' ], 1 ))
114
120
assert_true (np .allclose (img .header ['cal_max' ], data .max ()))
121
+ del img , data
115
122
116
123
117
124
@script_test
@@ -134,6 +141,8 @@ def test_parrec2nii():
134
141
assert_almost_equal (img .header .get_zooms (), eg_dict ['zooms' ])
135
142
# Standard save does not save extensions
136
143
assert_equal (len (img .header .extensions ), 0 )
144
+ # Delete previous img, data to make Windows happier
145
+ del img , data
137
146
# Does not overwrite unless option given
138
147
code , stdout , stderr = run_command (
139
148
['parrec2nii' , fname ], check_code = False )
@@ -161,6 +170,7 @@ def test_parrec2nii():
161
170
run_command (base_cmd + ['--store-header' ])
162
171
img = load (out_froot )
163
172
assert_equal (len (img .header .extensions ), 1 )
173
+ del img # To help windows delete the file
164
174
165
175
166
176
@script_test
0 commit comments