|
38 | 38 | ) |
39 | 39 | @pytest.mark.parametrize( |
40 | 40 | ("zoom_x", ), |
41 | | - # [(1.0, ), (-1.0, ), (2.0, ), (-2.0, )], |
42 | | - [(2.0,)], |
| 41 | + [(1.0, ), (-1.0, ), (2.0, ), (-2.0, )], |
43 | 42 | ) |
44 | 43 | @pytest.mark.parametrize( |
45 | 44 | ("zoom_y", ), |
46 | | - # [(1.0, ), (-1.0, ), (2.0, ), (-2.0, )], |
47 | | - [(-2.0,)], |
| 45 | + [(1.0, ), (-1.0, ), (2.0, ), (-2.0, )], |
48 | 46 | ) |
49 | 47 | @pytest.mark.parametrize( |
50 | 48 | ("zoom_z", ), |
51 | | - # [(1.0, ), (-1.0, ), (2.0, ), (-2.0, )], |
52 | | - [(-2.0,)], |
| 49 | + [(1.0, ), (-1.0, ), (2.0, ), (-2.0, )], |
53 | 50 | ) |
54 | 51 | @pytest.mark.parametrize( |
55 | 52 | ("angle_x", ), |
56 | | - # [(0.0, ), (0.2, ), (-0.05, )], |
57 | | - [(-0.05,)] |
| 53 | + [(0.0, ), (0.2, ), (-0.05, )], |
58 | 54 | ) |
59 | 55 | @pytest.mark.parametrize( |
60 | 56 | ("angle_y", ), |
@@ -82,6 +78,7 @@ def test_decimation( |
82 | 78 | angle_y, |
83 | 79 | angle_z, |
84 | 80 | offsets, |
| 81 | + outdir, |
85 | 82 | ): |
86 | 83 | """Exercise decimation.""" |
87 | 84 |
|
@@ -120,8 +117,30 @@ def test_decimation( |
120 | 117 | test_image.to_filename(fname) |
121 | 118 |
|
122 | 119 | # Need to define test oracle. For now, just see if it doesn't smoke. |
123 | | - out = decimate(fname, factor=2, smooth=False, order=1) |
124 | | - out.to_filename(tmp_path / "decimated.nii.gz") |
| 120 | + out = decimate(fname, factor=2, smooth=False) |
| 121 | + |
| 122 | + out = downsample(fname, shape=(10, 10, 10), smooth=False, order=0) |
| 123 | + |
| 124 | + if outdir: |
| 125 | + from niworkflows.interfaces.reportlets.registration import ( |
| 126 | + SimpleBeforeAfterRPT as SimpleBeforeAfter, |
| 127 | + ) |
| 128 | + |
| 129 | + out.to_filename(tmp_path / "decimated.nii.gz") |
| 130 | + |
| 131 | + SimpleBeforeAfter( |
| 132 | + after_label="Decimated", |
| 133 | + before_label="Original", |
| 134 | + after=str(tmp_path / "decimated.nii.gz"), |
| 135 | + before=str(fname), |
| 136 | + out_report=str(outdir / f'decimated-{tmp_path.name}.svg'), |
| 137 | + ).run() |
125 | 138 |
|
126 | | - out = downsample(fname, shape=(10, 10, 10), smooth=False, order=1) |
127 | | - out.to_filename(tmp_path / "downsampled.nii.gz") |
| 139 | + out.to_filename(tmp_path / "downsampled.nii.gz") |
| 140 | + SimpleBeforeAfter( |
| 141 | + after_label="Downsampled", |
| 142 | + before_label="Original", |
| 143 | + after=str(tmp_path / "downsampled.nii.gz"), |
| 144 | + before=str(fname), |
| 145 | + out_report=str(outdir / f'downsampled-{tmp_path.name}.svg'), |
| 146 | + ).run() |
0 commit comments