Skip to content

Commit

Permalink
fixed positions of args in lesion_preproc and added default RPI
Browse files Browse the repository at this point in the history
  • Loading branch information
birajstha committed Oct 3, 2024
1 parent 022f036 commit 96f5871
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions CPAC/anat_preproc/lesion_preproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def inverse_lesion(lesion_path):
return lesion_out


def create_lesion_preproc(wf_name="lesion_preproc", orientation="RPI"):
def create_lesion_preproc(cfg=None, wf_name="lesion_preproc"):
"""Process lesions masks.
Lesion mask file is deobliqued and reoriented in the same way as the T1 in
Expand Down Expand Up @@ -133,7 +133,9 @@ def create_lesion_preproc(wf_name="lesion_preproc", orientation="RPI"):
mem_x=(0.0115, "in_file", "t"),
)

lesion_reorient.inputs.orientation = orientation
lesion_reorient.inputs.orientation = (
cfg.pipeline_setup["desired_orientation"] if cfg else "RPI"
)
lesion_reorient.inputs.outputtype = "NIFTI_GZ"

preproc.connect(lesion_deoblique, "out_file", lesion_reorient, "in_file")
Expand Down
2 changes: 1 addition & 1 deletion CPAC/registration/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1736,7 +1736,7 @@ def ANTs_registration_connector(
"ANTs"
]["use_lesion_mask"]:
# Create lesion preproc node to apply afni Refit and Resample
lesion_preproc = create_lesion_preproc(wf_name=f"lesion_preproc{symm}", cfg.pipeline_setup["desired_orientation"])
lesion_preproc = create_lesion_preproc(cfg, wf_name=f"lesion_preproc{symm}")
wf.connect(inputNode, "lesion_mask", lesion_preproc, "inputspec.lesion")
wf.connect(
lesion_preproc,
Expand Down
2 changes: 1 addition & 1 deletion CPAC/registration/tests/test_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def test_registration_lesion():

anat_preproc.inputs.inputspec.anat = anat_file

lesion_preproc = create_lesion_preproc(wf_name="lesion_preproc")
lesion_preproc = create_lesion_preproc(cfg, wf_name="lesion_preproc")

lesion_preproc.inputs.inputspec.lesion = lesion_file

Expand Down

0 comments on commit 96f5871

Please sign in to comment.