@@ -54,11 +54,11 @@ def gen_mask(t1w_head, t1w_brain, mask):
5454 img = math_img ("img > 0.0" , img = t_img )
5555 img .to_filename (t1w_brain_mask )
5656 t_img .uncache ()
57- time .sleep (0.5 )
57+ time .sleep (1 )
5858
5959 t1w_brain = regutils .apply_mask_to_image (t1w_head , t1w_brain_mask ,
6060 t1w_brain )
61- time .sleep (0.5 )
61+ time .sleep (2 )
6262
6363 assert op .isfile (t1w_brain )
6464 assert op .isfile (t1w_brain_mask )
@@ -153,28 +153,28 @@ def atlas2t1w2dwi_align(
153153 sup = True ,
154154 mask = t1w_brain_mask ,
155155 )
156- time .sleep (0.5 )
156+ time .sleep (1 )
157157
158158 # Apply linear transformation from template to dwi space
159159 regutils .applyxfm (ap_path , aligned_atlas_skull , t1w2dwi_bbr_xfm ,
160160 dwi_aligned_atlas , interp = "nearestneighbour" )
161- time .sleep (0.5 )
161+ time .sleep (1 )
162162 except BaseException :
163163 print (
164164 "Warning: Atlas is not in correct dimensions, or input is low"
165165 " quality,\n using linear template registration." )
166166
167167 combine_xfms (mni2t1_xfm , t1w2dwi_bbr_xfm , mni2dwi_xfm )
168- time .sleep (0.5 )
168+ time .sleep (1 )
169169 regutils .applyxfm (ap_path , aligned_atlas_t1mni , mni2dwi_xfm ,
170170 dwi_aligned_atlas , interp = "nearestneighbour" )
171- time .sleep (0.5 )
171+ time .sleep (1 )
172172 else :
173173 combine_xfms (mni2t1_xfm , t1w2dwi_xfm , mni2dwi_xfm )
174- time .sleep (0.5 )
174+ time .sleep (1 )
175175 regutils .applyxfm (ap_path , aligned_atlas_t1mni , mni2dwi_xfm ,
176176 dwi_aligned_atlas , interp = "nearestneighbour" )
177- time .sleep (0.5 )
177+ time .sleep (1 )
178178
179179 atlas_img = nib .load (dwi_aligned_atlas )
180180 wm_gm_img = nib .load (wm_gm_int_in_dwi )
@@ -200,12 +200,12 @@ def atlas2t1w2dwi_align(
200200 B0_mask ,
201201 dwi_aligned_atlas )
202202
203- time .sleep (0.5 )
203+ time .sleep (1 )
204204
205205 dwi_aligned_atlas_wmgm_int = regutils .apply_mask_to_image (
206206 dwi_aligned_atlas_wmgm_int , B0_mask , dwi_aligned_atlas_wmgm_int )
207207
208- time .sleep (0.5 )
208+ time .sleep (1 )
209209 final_dat = atlas_img_corr .get_fdata ()
210210 unique_a = sorted (set (np .array (final_dat .flatten ().tolist ())))
211211
@@ -264,7 +264,7 @@ def roi2dwi_align(
264264 else :
265265 regutils .applyxfm (t1w_brain , roi , mni2t1_xfm , roi_in_t1w )
266266
267- time .sleep (0.5 )
267+ time .sleep (1 )
268268 # Apply transform from t1w to native dwi space
269269 regutils .applyxfm (ap_path , roi_in_t1w , t1wtissue2dwi_xfm , roi_in_dwi )
270270
@@ -311,15 +311,15 @@ def waymask2dwi_align(
311311 else :
312312 regutils .applyxfm (t1w_brain , waymask_res , mni2t1_xfm , waymask_in_t1w )
313313
314- time .sleep (0.5 )
314+ time .sleep (1 )
315315 # Apply transform from t1w to native dwi space
316316 regutils .applyxfm (
317317 ap_path ,
318318 waymask_in_t1w ,
319319 t1wtissue2dwi_xfm ,
320320 waymask_in_dwi )
321321
322- time .sleep (0.5 )
322+ time .sleep (1 )
323323
324324 return waymask_in_dwi
325325
@@ -355,7 +355,7 @@ def roi2t1w_align(
355355 else :
356356 regutils .applyxfm (t1w_brain , roi_res , mni2t1_xfm , roi_in_t1w )
357357
358- time .sleep (0.5 )
358+ time .sleep (1 )
359359
360360 return roi_in_t1w
361361
@@ -402,7 +402,7 @@ def RegisterParcellation2MNIFunc_align(
402402 interp = "nn" ,
403403 sup = True ,
404404 )
405- time .sleep (0.5 )
405+ time .sleep (1 )
406406 except BaseException :
407407 print (
408408 "Warning: Atlas is not in correct dimensions, or input is "
@@ -418,7 +418,7 @@ def RegisterParcellation2MNIFunc_align(
418418 interp = "nearestneighbour" ,
419419 cost = "mutualinfo" ,
420420 )
421- time .sleep (0.5 )
421+ time .sleep (1 )
422422 else :
423423 regutils .align (
424424 aligned_atlas_t1w ,
@@ -430,7 +430,7 @@ def RegisterParcellation2MNIFunc_align(
430430 interp = "nearestneighbour" ,
431431 cost = "mutualinfo" ,
432432 )
433- time .sleep (0.5 )
433+ time .sleep (1 )
434434 return aligned_atlas_mni
435435
436436
@@ -488,19 +488,19 @@ def atlas2t1w_align(
488488 sup = True ,
489489 mask = t1w_brain_mask ,
490490 )
491- time .sleep (0.5 )
491+ time .sleep (1 )
492492 except BaseException :
493493 print (
494494 "Warning: Atlas is not in correct dimensions, or input is low "
495495 "quality,\n using linear template registration." )
496496
497497 regutils .applyxfm (t1w_brain , aligned_atlas_t1mni , mni2t1_xfm ,
498498 aligned_atlas_skull , interp = "nearestneighbour" )
499- time .sleep (0.5 )
499+ time .sleep (1 )
500500 else :
501501 regutils .applyxfm (t1w_brain , aligned_atlas_t1mni , mni2t1_xfm ,
502502 aligned_atlas_skull , interp = "nearestneighbour" )
503- time .sleep (0.5 )
503+ time .sleep (1 )
504504
505505 # aligned_atlas_gm = regutils.apply_mask_to_image(aligned_atlas_skull,
506506 # gm_mask,
@@ -509,7 +509,7 @@ def atlas2t1w_align(
509509 t1w_brain_mask ,
510510 aligned_atlas_gm )
511511
512- time .sleep (0.5 )
512+ time .sleep (1 )
513513 atlas_img = nib .load (aligned_atlas_gm )
514514
515515 atlas_img_corr = nib .Nifti1Image (
0 commit comments