Skip to content

Commit

Permalink
[FIX] Fix usage of group labels in non-regression tests (#1371)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasGensollen authored Nov 13, 2024
1 parent 88afa1e commit 93292a0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 22 deletions.
8 changes: 4 additions & 4 deletions test/nonregression/pipelines/anat/test_t1_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def run_t1_volume_create_dartel(
caps_directory=fspath(output_dir / "caps"),
tsv_file=fspath(input_dir / "subjects.tsv"),
base_dir=fspath(working_dir),
parameters={"group_label": "UnitTest"},
group_label="UnitTest",
)
pipeline.build()
pipeline.run(plugin="MultiProc", plugin_args={"n_procs": 4}, bypass_check=True)
Expand Down Expand Up @@ -162,7 +162,7 @@ def run_t1_volume_dartel_to_mni(
caps_directory=fspath(output_dir / "caps"),
tsv_file=fspath(input_dir / "subjects.tsv"),
base_dir=fspath(working_dir),
parameters={"group_label": "UnitTest"},
group_label="UnitTest",
)
pipeline.build()
pipeline.run(plugin="MultiProc", plugin_args={"n_procs": 4}, bypass_check=True)
Expand Down Expand Up @@ -222,7 +222,7 @@ def run_t1_volume_register_dartel(
caps_directory=fspath(output_dir / "caps"),
tsv_file=fspath(input_dir / "subjects.tsv"),
base_dir=fspath(working_dir),
parameters={"group_label": "UnitTest"},
group_label="UnitTest",
)
pipeline.build()
pipeline.run(plugin="MultiProc", plugin_args={"n_procs": 4}, bypass_check=True)
Expand Down Expand Up @@ -282,7 +282,7 @@ def run_t1_volume_parcellation(
caps_directory=fspath(output_dir / "caps"),
tsv_file=fspath(input_dir / "subjects.tsv"),
base_dir=fspath(working_dir),
parameters={"group_label": "UnitTest"},
group_label="UnitTest",
)
pipeline.build()
pipeline.run(plugin="MultiProc", plugin_args={"n_procs": 4}, bypass_check=True)
Expand Down
2 changes: 1 addition & 1 deletion test/nonregression/pipelines/pet/test_pet_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def run_pet_volume(
region = SUVRReferenceRegion.PONS

parameters = {
"group_label": "UnitTest",
"acq_label": tracer,
"suvr_reference_region": region,
"skip_question": True,
Expand All @@ -34,6 +33,7 @@ def run_pet_volume(
caps_directory=fspath(output_dir / "caps"),
tsv_file=fspath(input_dir / "subjects.tsv"),
base_dir=fspath(working_dir),
group_label="UnitTest",
parameters=parameters,
)
pipeline.build()
Expand Down
4 changes: 2 additions & 2 deletions test/nonregression/pipelines/test_run_pipelines_ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ def run_spatial_svm(
# Copy necessary data from in to out
shutil.copytree(input_dir / "caps", caps_dir, copy_function=shutil.copy)

parameters = {"group_label": "ADNIbl", "orig_input_data_ml": "t1-volume"}
pipeline = SpatialSVM(
caps_directory=fspath(caps_dir),
tsv_file=fspath(tsv),
base_dir=fspath(working_dir),
parameters=parameters,
group_label="ADNIbl",
parameters={"orig_input_data_ml": "t1-volume"},
)
pipeline.build()
pipeline.run(plugin="MultiProc", plugin_args={"n_procs": 4}, bypass_check=True)
Expand Down
22 changes: 7 additions & 15 deletions test/nonregression/pipelines/test_run_pipelines_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ def run_statistics_surface(
shutil.copytree(input_dir / "caps", caps_dir, copy_function=shutil.copy)

parameters = {
"group_label": "UnitTest",
"orig_input_data": "t1-freesurfer",
"glm_type": "group_comparison",
"contrast": "group",
Expand All @@ -95,6 +94,7 @@ def run_statistics_surface(
caps_directory=caps_dir,
tsv_file=tsv,
base_dir=working_dir,
group_label="UnitTest",
parameters=parameters,
)
pipeline.build()
Expand Down Expand Up @@ -154,25 +154,22 @@ def run_statistics_volume_pet(
# Copy necessary data from in to out
shutil.copytree(input_dir / "caps", caps_dir, copy_function=shutil.copy)

# Instantiate pipeline and run()
parameters = {
# Clinica compulsory parameters
"group_label": "UnitTest",
"orig_input_data_volume": "pet-volume",
"contrast": "group",
# Optional arguments for inputs from pet-volume pipeline
"acq_label": Tracer.FDG,
"use_pvc_data": False,
"suvr_reference_region": SUVRReferenceRegion.PONS,
}

pipeline = StatisticsVolume(
caps_directory=fspath(caps_dir),
tsv_file=fspath(tsv),
base_dir=fspath(working_dir),
group_label="UnitTest",
parameters=parameters,
)

pipeline.run(plugin="MultiProc", plugin_args={"n_procs": 2}, bypass_check=True)

output_t_stat = (
Expand Down Expand Up @@ -217,21 +214,16 @@ def run_statistics_volume_t1(
# Copy necessary data from in to out
shutil.copytree(input_dir / "caps", caps_dir, copy_function=shutil.copy)

# Instantiate pipeline and run()
parameters = {
# Clinica compulsory parameters
"group_label": "UnitTest",
"orig_input_data_volume": "t1-volume",
"contrast": "group",
}

pipeline = StatisticsVolume(
caps_directory=fspath(caps_dir),
tsv_file=fspath(tsv),
base_dir=fspath(working_dir),
parameters=parameters,
group_label="UnitTest",
parameters={
"orig_input_data_volume": "t1-volume",
"contrast": "group",
},
)

pipeline.run(plugin="MultiProc", plugin_args={"n_procs": 2}, bypass_check=True)

output_t_stat = (
Expand Down

0 comments on commit 93292a0

Please sign in to comment.