Skip to content

Commit

Permalink
Solved Issue nipy#3654: added no surface measure (no ROI) option to c…
Browse files Browse the repository at this point in the history
…at12 interface
  • Loading branch information
Oweda authored and effigies committed Oct 6, 2024
1 parent 83e3903 commit 37d3ac2
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions nipype/interfaces/cat12/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,13 @@ def _format_arg(self, opt, spec, val):
return scans_for_fname(val)
elif opt in ["tpm", "shooting_tpm"]:
return Cell2Str(val)

if opt == "surface_measures":
if not self.inputs.surface_measures:
self.inputs.neuromorphometrics = False
self.inputs.lpba40 = False
self.inputs.cobra = False
self.inputs.hammers = False

return super()._format_arg(opt, spec, val)

Expand Down Expand Up @@ -583,12 +590,14 @@ def _list_outputs(self):
str(label) for label in Path(pth).glob("label/*") if label.is_file()
]

outputs["label_rois"] = fname_presuffix(
f, prefix=os.path.join("label", "catROIs_"), suffix=".xml", use_ext=False
)
outputs["label_roi"] = fname_presuffix(
f, prefix=os.path.join("label", "catROI_"), suffix=".xml", use_ext=False
)
if self.inputs.surface_measures:
outputs["label_rois"] = fname_presuffix(
f, prefix=os.path.join("label", "catROIs_"), suffix=".xml", use_ext=False
)
else:
outputs["label_roi"] = fname_presuffix(
f, prefix=os.path.join("label", "catROI_"), suffix=".xml", use_ext=False
)

return outputs

Expand Down

0 comments on commit 37d3ac2

Please sign in to comment.