@@ -145,6 +145,25 @@ def test_syn_wf(tmpdir, datadir, workdir, outdir, sloppy_mode, sd_prior):
145145 wf .run (plugin = "Linear" )
146146
147147
148+ @pytest .mark .parametrize ("laplacian_weight" , [None , (0.5 , 0.1 ), (0.8 , - 1.0 )])
149+ @pytest .mark .parametrize ("sloppy" , [True , False ])
150+ def test_syn_wf_inputs (sloppy , laplacian_weight ):
151+ """Test the input validation of the SDC-SyN workflow."""
152+ from sdcflows .workflows .fit .syn import MAX_LAPLACIAN_WEIGHT
153+
154+ laplacian_weight = (0.1 , 0.2 ) if laplacian_weight is None else (
155+ max (min (laplacian_weight [0 ], MAX_LAPLACIAN_WEIGHT ), 0.0 ),
156+ max (min (laplacian_weight [1 ], MAX_LAPLACIAN_WEIGHT ), 0.0 ),
157+ )
158+ metric_weight = [
159+ [1.0 - laplacian_weight [0 ], laplacian_weight [0 ]],
160+ [1.0 - laplacian_weight [1 ], laplacian_weight [1 ]],
161+ ]
162+
163+ wf = init_syn_sdc_wf (sloppy = sloppy , laplacian_weight = laplacian_weight )
164+
165+ assert wf .inputs .syn .metric_weight == metric_weight
166+
148167@pytest .mark .parametrize ("ants_version" , ["2.2.0" , "2.1.0" , None ])
149168def test_syn_wf_version (monkeypatch , ants_version ):
150169 """Ensure errors are triggered with ANTs < 2.2."""
0 commit comments