@@ -20,8 +20,7 @@ def setup_module():
20
20
21
21
# Select some arbitrary chunks of data so this goes quicker
22
22
subset_b0 = mean_b0 [40 :50 , 40 :50 , 40 :50 ]
23
- subset_dwi_data = nb .Nifti1Image (hardi_data [40 :50 , 40 :50 , 40 :50 ],
24
- hardi_affine )
23
+ subset_dwi_data = nb .Nifti1Image (hardi_data [40 :50 , 40 :50 , 40 :50 ], hardi_affine )
25
24
subset_t2 = MNI_T2_data [40 :60 , 40 :60 , 40 :60 ]
26
25
subset_b0_img = nb .Nifti1Image (subset_b0 , hardi_affine )
27
26
subset_t2_img = nb .Nifti1Image (subset_t2 , MNI_T2_affine )
@@ -34,10 +33,10 @@ def setup_module():
34
33
@pytest .mark .parametrize ("sigmas" , [[5.0 , 2.5 ], [0.0 ]])
35
34
@pytest .mark .parametrize ("factors" , [[4 , 2 ], [1 ]])
36
35
@pytest .mark .parametrize ("params0" , [np .eye (4 ), None ])
37
- @pytest .mark .parametrize ("pipeline" , [["rigid" ], ["affine" ],
38
- [ "rigid" , "affine" ]])
39
- def test_affine_registration ( nbins , sampling_prop , metric , level_iters ,
40
- sigmas , factors , params0 , pipeline ):
36
+ @pytest .mark .parametrize ("pipeline" , [["rigid" ], ["affine" ], [ "rigid" , "affine" ]])
37
+ def test_affine_registration (
38
+ nbins , sampling_prop , metric , level_iters , sigmas , factors , params0 , pipeline
39
+ ):
41
40
moving = subset_b0
42
41
static = subset_b0
43
42
moving_affine = static_affine = np .eye (4 )
@@ -52,8 +51,16 @@ def test_affine_registration(nbins, sampling_prop, metric, level_iters,
52
51
# If providing nifti image objects, don't need to provide affines:
53
52
moving_img = nb .Nifti1Image (moving , moving_affine )
54
53
static_img = nb .Nifti1Image (static , static_affine )
55
- xformed , affine = affine_registration (moving_img , static_img , nbins ,
56
- sampling_prop , metric , pipeline ,
57
- level_iters , sigmas , factors ,
58
- params0 )
54
+ xformed , affine = affine_registration (
55
+ moving_img ,
56
+ static_img ,
57
+ nbins ,
58
+ sampling_prop ,
59
+ metric ,
60
+ pipeline ,
61
+ level_iters ,
62
+ sigmas ,
63
+ factors ,
64
+ params0 ,
65
+ )
59
66
npt .assert_almost_equal (affine [:3 , :3 ], np .eye (3 ), decimal = 1 )
0 commit comments